xiaohaizhao 10 месяцев назад
Родитель
Сommit
f8f71b5dc4
4 измененных файлов с 78 добавлено и 61 удалено
  1. 47 41
      manifest.json
  2. 2 2
      pages/login/login.vue
  3. 8 6
      utils/Http.js
  4. 21 12
      vite.config.js

+ 47 - 41
manifest.json

@@ -1,28 +1,28 @@
 {
-    "name" : "美大服务工人小程序",
-    "appid" : "__UNI__0BCE2F5",
-    "description" : "",
-    "versionName" : "1.0.0",
-    "versionCode" : "100",
-    "transformPx" : false,
+    "name": "美大服务工人小程序",
+    "appid": "__UNI__0BCE2F5",
+    "description": "",
+    "versionName": "1.0.0",
+    "versionCode": "100",
+    "transformPx": false,
     /* 5+App特有相关 */
-    "app-plus" : {
-        "usingComponents" : true,
-        "nvueStyleCompiler" : "uni-app",
-        "compilerVersion" : 3,
-        "splashscreen" : {
-            "alwaysShowBeforeRender" : true,
-            "waiting" : true,
-            "autoclose" : true,
-            "delay" : 0
+    "app-plus": {
+        "usingComponents": true,
+        "nvueStyleCompiler": "uni-app",
+        "compilerVersion": 3,
+        "splashscreen": {
+            "alwaysShowBeforeRender": true,
+            "waiting": true,
+            "autoclose": true,
+            "delay": 0
         },
         /* 模块配置 */
-        "modules" : {},
+        "modules": {},
         /* 应用发布信息 */
-        "distribute" : {
+        "distribute": {
             /* android打包配置 */
-            "android" : {
-                "permissions" : [
+            "android": {
+                "permissions": [
                     "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
                     "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
@@ -41,36 +41,42 @@
                 ]
             },
             /* ios打包配置 */
-            "ios" : {},
+            "ios": {},
             /* SDK配置 */
-            "sdkConfigs" : {}
+            "sdkConfigs": {}
         }
     },
     /* 快应用特有相关 */
-    "quickapp" : {},
+    "quickapp": {},
     /* 小程序特有相关 */
-    "mp-weixin" : {
-        "appid" : "wxe89d8c8225f75d79",
-        "mergeVirtualHostAttributes" : true,
-        "setting" : {
-            "urlCheck" : false,
-            "minified" : true
+    "mp-weixin": {
+        "appid": "wxe89d8c8225f75d79",
+        "mergeVirtualHostAttributes": true,
+        "setting": {
+            "urlCheck": false,
+            "minified": true
         },
-        "usingComponents" : true,
-        "permission" : {}
+        "usingComponents": true,
+        "permission": {}
     },
-    "mp-alipay" : {
-        "usingComponents" : true
+    "mp-alipay": {
+        "usingComponents": true
     },
-    "mp-baidu" : {
-        "usingComponents" : true
+    "mp-baidu": {
+        "usingComponents": true
     },
-    "mp-toutiao" : {
-        "usingComponents" : true,
-        "mergeVirtualHostAttributes" : true
+    "mp-toutiao": {
+        "usingComponents": true,
+        "mergeVirtualHostAttributes": true
     },
-    "uniStatistics" : {
-        "enable" : false
+    "uniStatistics": {
+        "enable": false
     },
-    "vueVersion" : "3"
-}
+    "vueVersion": "3",
+    "h5": {
+        "router": {
+            "mode": "history"
+        },
+        "title": "美大服务"
+    }
+}

+ 2 - 2
pages/login/login.vue

@@ -1,5 +1,6 @@
 <template>
-    <view style="height: 100vh;width: 100vw;background-color: #fff;padding-top: 120rpx;box-sizing: border-box;">
+    <view
+        style="height: calc(100vh - env(safe-area-inset-top));width: 100vw;background-color: #fff;padding-top: 120rpx;box-sizing: border-box;">
         <view class="head-image">
             <image src="/static/image/logo1.png" mode="heightFix" />
         </view>
@@ -209,7 +210,6 @@ const isAgreement = ref(false);
 const showModal = ref(false);
 
 function checkTheAgreement() {
-    console.log(122222222222222222)
     uni.showLoading({
         title: "加载中...",
     });

+ 8 - 6
utils/Http.js

@@ -24,11 +24,13 @@ class HTTP {
             return imgObj.url;
         }
 
-        if (process.env.NODE_ENV === 'development') {
-            this.baseUrl = this.urls[0].url;
-        } else {
-            this.baseUrl = this.urls[1].url;
-        }
+        // if (process.env.NODE_ENV === 'development') {
+        //     this.baseUrl = this.urls[0].url;
+        // } else {
+        //     this.baseUrl = this.urls[1].url;
+        // }
+
+        this.baseUrl = "/api";
 
         // 从本地存储加载JSESSIONID
         this.jsessionid = uni.getStorageSync('JSESSIONID') || '';
@@ -43,7 +45,7 @@ class HTTP {
             'content-type': 'application/json',
             "accesstoken": data.accesstoken || uni.getStorageSync('userMsg')?.token || '',
             // 添加Cookie字段
-            "Cookie": `JSESSIONID=${this.jsessionid}`
+            // "Cookie": `JSESSIONID=${this.jsessionid}`
         },
         showLoading = ''
     }) {

+ 21 - 12
vite.config.js

@@ -6,21 +6,30 @@ import { visualizer } from "rollup-plugin-visualizer";
 export default defineConfig({
   plugins: [
     uni(),
-	visualizer()
+    visualizer(),
   ],
-  css: {  
-	preprocessorOptions: {  
-	  scss: {  
-		// 取消sass废弃API的报警
-		silenceDeprecations: ['legacy-js-api', 'color-functions', 'import'],  
-	  },  
-	},  
+  css: {
+    preprocessorOptions: {
+      scss: {
+        silenceDeprecations: {
+          'legacy-js-api': true,
+          'color-functions': true,
+          'import': true,
+        },
+      },
+    },
   },
   server: {
     port: 5100,
     fs: {
-        // Allow serving files from one level up to the project root
-        allow: ['..']
-    }
-},
+      allow: ['..'],
+    },
+    proxy: {
+      '/api': {
+        target: 'http://61.164.207.46:8300',
+        changeOrigin: true,
+        rewrite: (path) => path.replace(/^\/api/, ''),
+      },
+    },
+  },
 });