Selaa lähdekoodia

feat(setting): udpate debug

gemercheung 3 vuotta sitten
vanhempi
commit
a6214a59b0
5 muutettua tiedostoa jossa 265 lisäystä ja 260 poistoa
  1. 1 0
      config.js
  2. 2 2
      pages/auth/btnAuth/btnAuth.js
  3. 256 256
      project.config.json
  4. 2 1
      socket.js
  5. 4 1
      utils/util.js

+ 1 - 0
config.js

@@ -14,6 +14,7 @@ const dev = {
 //目前没有区分正式服测试服
 const mal = {
   env: 'pro',
+  //  socketHost: 'wss://shop.4dkankan.com',
   socketHost: 'wss://test-socket.4dkankan.com',
   // socketHost: 'wss://192.168.0.79:3031',
   requestHost: 'https://plaza-cszfb.4dkankan.com', // 测试环境

+ 2 - 2
pages/auth/btnAuth/btnAuth.js

@@ -38,14 +38,14 @@ Page({
   bindGetUserInfo: function(e) {
     let that = this;
     //登录远程服务器
-    debugger;
+
     if (that.data.code) {
       util.request(api.AuthLoginByWeixin, {
         code: that.data.code,
         userInfo: e.detail
       }, 'POST', 'application/json').then(res => {
         if (res.errno === 0) {
-          debugger
+  
           //存储用户信息
           res.data.userInfo.userId = res.data.userId
           res.data.userInfo.sessionKey = res.data.sessionKey

+ 256 - 256
project.config.json

@@ -1,266 +1,266 @@
 {
-  "description": "项目配置文件。",
-  "setting": {
-    "urlCheck": false,
-    "es6": true,
-    "enhance": true,
-    "postcss": true,
-    "preloadBackgroundData": false,
-    "minified": true,
-    "newFeature": true,
-    "coverView": true,
-    "nodeModules": false,
-    "autoAudits": false,
-    "showShadowRootInWxmlPanel": true,
-    "scopeDataCheck": false,
-    "uglifyFileName": false,
-    "checkInvalidKey": true,
-    "checkSiteMap": true,
-    "uploadWithSourceMap": true,
-    "compileHotReLoad": false,
-    "lazyloadPlaceholderEnable": false,
-    "useMultiFrameRuntime": true,
-    "useApiHook": true,
-    "useApiHostProcess": true,
-    "babelSetting": {
-      "ignore": [],
-      "disablePlugins": [],
-      "outputPath": ""
-    },
-    "enableEngineNative": false,
-    "useIsolateContext": false,
-    "userConfirmedBundleSwitch": false,
-    "packNpmManually": false,
-    "packNpmRelationList": [],
-    "minifyWXSS": true,
-    "disableUseStrict": false,
-    "minifyWXML": true,
-    "showES6CompileOption": false,
-    "useCompilerPlugins": false
-  },
-  "compileType": "miniprogram",
-  "libVersion": "2.19.3",
-  "appid": "wx564b12f68f5e4feb",
-  "projectname": "FDshop",
-  "simulatorType": "wechat",
-  "simulatorPluginLibVersion": {},
-  "condition": {
-    "search": {
-      "list": []
-    },
-    "conversation": {
-      "list": []
-    },
-    "plugin": {
-      "list": []
-    },
-    "game": {
-      "list": []
-    },
-    "gamePlugin": {
-      "list": []
-    },
-    "miniprogram": {
-      "list": [
-        {
-          "id": 0,
-          "name": "选择优惠券",
-          "pathName": "pages/shopping/selCoupon/selCoupon",
-          "query": "isBuy=false"
-        },
-        {
-          "id": -1,
-          "name": "订单界面",
-          "pathName": "pages/shopping/checkout/checkout",
-          "query": "isBuy=true"
-        },
-        {
-          "id": -1,
-          "name": "我的优惠券",
-          "pathName": "pages/ucenter/coupon/coupon",
-          "query": "isBuy=true"
-        },
-        {
-          "id": -1,
-          "name": "我的订单",
-          "pathName": "pages/ucenter/order/order",
-          "query": ""
-        },
-        {
-          "id": 4,
-          "name": "pages/goods/goods",
-          "pathName": "pages/goods/goods",
-          "query": "id=1181015",
-          "scene": null
-        },
-        {
-          "id": -1,
-          "name": "pages/ucenter/index/index",
-          "pathName": "pages/ucenter/index/index",
-          "query": "",
-          "scene": null
-        },
-        {
-          "id": -1,
-          "name": "pages/cart/cart",
-          "pathName": "pages/cart/cart",
-          "query": "id=1181015",
-          "scene": null
-        },
-        {
-          "id": -1,
-          "name": "pages/catalog/catalog",
-          "pathName": "pages/catalog/catalog",
-          "query": "id=1181015",
-          "scene": null
-        },
-        {
-          "id": -1,
-          "name": "pages/category/category",
-          "pathName": "pages/category/category",
-          "query": "id=1036009",
-          "scene": null
-        },
-        {
-          "id": -1,
-          "name": "pages/ucenter/orderDetail/orderDetail",
-          "pathName": "pages/ucenter/orderDetail/orderDetail",
-          "query": "id=142",
-          "scene": null
+    "description": "项目配置文件。",
+    "setting": {
+        "urlCheck": false,
+        "es6": true,
+        "enhance": true,
+        "postcss": true,
+        "preloadBackgroundData": false,
+        "minified": true,
+        "newFeature": true,
+        "coverView": true,
+        "nodeModules": false,
+        "autoAudits": false,
+        "showShadowRootInWxmlPanel": true,
+        "scopeDataCheck": false,
+        "uglifyFileName": false,
+        "checkInvalidKey": true,
+        "checkSiteMap": true,
+        "uploadWithSourceMap": true,
+        "compileHotReLoad": false,
+        "lazyloadPlaceholderEnable": false,
+        "useMultiFrameRuntime": true,
+        "useApiHook": true,
+        "useApiHostProcess": true,
+        "babelSetting": {
+            "ignore": [],
+            "disablePlugins": [],
+            "outputPath": ""
         },
-        {
-          "id": 10,
-          "name": "pages/payResult/payResult",
-          "pathName": "pages/payResult/payResult",
-          "query": "status=1",
-          "scene": null
-        },
-        {
-          "id": -1,
-          "name": "pages/cart/cart",
-          "pathName": "pages/cart/cart",
-          "query": "",
-          "scene": null
-        },
-        {
-          "id": 12,
-          "name": "pages/ucenter/addressAdd/addressAdd",
-          "pathName": "pages/ucenter/addressAdd/addressAdd",
-          "query": "",
-          "scene": null
-        },
-        {
-          "id": -1,
-          "name": "pages/logistics/index",
-          "pathName": "pages/logistics/index",
-          "query": "no=75326914125277&id=157",
-          "scene": null
-        },
-        {
-          "id": 14,
-          "name": "pages/ucenter/order/order",
-          "pathName": "pages/ucenter/order/order",
-          "query": "",
-          "scene": null
-        },
-        {
-          "id": -1,
-          "name": "pages/ucenter/feedback/feedback",
-          "pathName": "pages/ucenter/feedback/feedback",
-          "query": "",
-          "scene": null
-        },
-        {
-          "id": -1,
-          "name": "pages/ucenter/feedback/feedback",
-          "pathName": "pages/ucenter/feedback/feedback",
-          "query": "",
-          "scene": null
-        },
-        {
-          "id": -1,
-          "name": "pages/shopping/checkout/checkout",
-          "pathName": "pages/shopping/checkout/checkout",
-          "query": "",
-          "scene": null
-        },
-        {
-          "id": -1,
-          "name": "pages/ucenter/address/address",
-          "pathName": "pages/ucenter/address/address",
-          "query": "",
-          "scene": null
-        },
-        {
-          "id": -1,
-          "name": "pages/shopping/address/address",
-          "pathName": "pages/shopping/address/address",
-          "query": "",
-          "scene": null
-        },
-        {
-          "id": -1,
-          "name": "pages/shopping/address/address",
-          "pathName": "pages/shopping/address/address",
-          "query": "",
-          "scene": null
-        },
-        {
-          "id": -1,
-          "name": "pages/search/search",
-          "pathName": "pages/search/search",
-          "query": "",
-          "scene": null
-        },
-        {
-          "id": -1,
-          "name": "pages/webview/index",
-          "pathName": "pages/webview/index",
-          "query": "url=gu6HmTLKp",
-          "scene": null
-        },
-        {
-          "id": -1,
-          "name": "pages/auth/btnAuth/btnAuth",
-          "pathName": "pages/auth/btnAuth/btnAuth",
-          "query": "",
-          "scene": null
+        "useIsolateContext": false,
+        "userConfirmedBundleSwitch": false,
+        "packNpmManually": false,
+        "packNpmRelationList": [],
+        "minifyWXSS": true,
+        "disableUseStrict": false,
+        "minifyWXML": true,
+        "showES6CompileOption": false,
+        "useCompilerPlugins": false,
+        "ignoreUploadUnusedFiles": true
+    },
+    "compileType": "miniprogram",
+    "libVersion": "2.19.3",
+    "appid": "wx564b12f68f5e4feb",
+    "projectname": "FDshop",
+    "simulatorType": "wechat",
+    "simulatorPluginLibVersion": {},
+    "condition": {
+        "search": {
+            "list": []
         },
-        {
-          "id": -1,
-          "name": "pages/brandDetail/brandDetail",
-          "pathName": "pages/brandDetail/brandDetail",
-          "query": "id=1046017",
-          "scene": null
+        "conversation": {
+            "list": []
         },
-        {
-          "id": 25,
-          "name": "pages/ucenter/orderDetail/orderDetail",
-          "pathName": "pages/ucenter/orderDetail/orderDetail",
-          "query": "id=412",
-          "scene": null
+        "plugin": {
+            "list": []
         },
-        {
-          "id": -1,
-          "name": "pages/webview/index",
-          "pathName": "pages/webview/index",
-          "query": "",
-          "scene": null
+        "game": {
+            "list": []
         },
-        {
-          "id": -1,
-          "name": "dataReport/pages/data-report/data-report",
-          "pathName": "dataReport/pages/data-report/data-report",
-          "query": "",
-          "scene": null
+        "gamePlugin": {
+            "list": []
         },
-        {
-          "id": -1,
-          "name": "首页",
-          "pathName": "pages/index/index",
-          "scene": null
+        "miniprogram": {
+            "list": [
+                {
+                    "id": 0,
+                    "name": "选择优惠券",
+                    "pathName": "pages/shopping/selCoupon/selCoupon",
+                    "query": "isBuy=false"
+                },
+                {
+                    "id": -1,
+                    "name": "订单界面",
+                    "pathName": "pages/shopping/checkout/checkout",
+                    "query": "isBuy=true"
+                },
+                {
+                    "id": -1,
+                    "name": "我的优惠券",
+                    "pathName": "pages/ucenter/coupon/coupon",
+                    "query": "isBuy=true"
+                },
+                {
+                    "id": -1,
+                    "name": "我的订单",
+                    "pathName": "pages/ucenter/order/order",
+                    "query": ""
+                },
+                {
+                    "id": 4,
+                    "name": "pages/goods/goods",
+                    "pathName": "pages/goods/goods",
+                    "query": "id=1181015",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/ucenter/index/index",
+                    "pathName": "pages/ucenter/index/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/cart/cart",
+                    "pathName": "pages/cart/cart",
+                    "query": "id=1181015",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/catalog/catalog",
+                    "pathName": "pages/catalog/catalog",
+                    "query": "id=1181015",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/category/category",
+                    "pathName": "pages/category/category",
+                    "query": "id=1036009",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/ucenter/orderDetail/orderDetail",
+                    "pathName": "pages/ucenter/orderDetail/orderDetail",
+                    "query": "id=142",
+                    "scene": null
+                },
+                {
+                    "id": 10,
+                    "name": "pages/payResult/payResult",
+                    "pathName": "pages/payResult/payResult",
+                    "query": "status=1",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/cart/cart",
+                    "pathName": "pages/cart/cart",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "id": 12,
+                    "name": "pages/ucenter/addressAdd/addressAdd",
+                    "pathName": "pages/ucenter/addressAdd/addressAdd",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/logistics/index",
+                    "pathName": "pages/logistics/index",
+                    "query": "no=75326914125277&id=157",
+                    "scene": null
+                },
+                {
+                    "id": 14,
+                    "name": "pages/ucenter/order/order",
+                    "pathName": "pages/ucenter/order/order",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/ucenter/feedback/feedback",
+                    "pathName": "pages/ucenter/feedback/feedback",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/ucenter/feedback/feedback",
+                    "pathName": "pages/ucenter/feedback/feedback",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/shopping/checkout/checkout",
+                    "pathName": "pages/shopping/checkout/checkout",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/ucenter/address/address",
+                    "pathName": "pages/ucenter/address/address",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/shopping/address/address",
+                    "pathName": "pages/shopping/address/address",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/shopping/address/address",
+                    "pathName": "pages/shopping/address/address",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/search/search",
+                    "pathName": "pages/search/search",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/webview/index",
+                    "pathName": "pages/webview/index",
+                    "query": "url=gu6HmTLKp",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/auth/btnAuth/btnAuth",
+                    "pathName": "pages/auth/btnAuth/btnAuth",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/brandDetail/brandDetail",
+                    "pathName": "pages/brandDetail/brandDetail",
+                    "query": "id=1046017",
+                    "scene": null
+                },
+                {
+                    "id": 25,
+                    "name": "pages/ucenter/orderDetail/orderDetail",
+                    "pathName": "pages/ucenter/orderDetail/orderDetail",
+                    "query": "id=412",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "pages/webview/index",
+                    "pathName": "pages/webview/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "dataReport/pages/data-report/data-report",
+                    "pathName": "dataReport/pages/data-report/data-report",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "id": -1,
+                    "name": "首页",
+                    "pathName": "pages/index/index",
+                    "scene": null
+                }
+            ]
         }
-      ]
     }
-  }
 }

+ 2 - 1
socket.js

@@ -61,6 +61,7 @@ export default {
         }
       }
     }
+
     // let base = 'http://127.0.0.1:5500/index.html'
     // let base = remote.viewHost + '/shop-container/shop.html'
     let sponsor = !!this.data.canShow
@@ -299,7 +300,7 @@ export default {
       query: {
         ...options,
         isClient: true,
-        from: 1
+        from: 2
       }
     })
 

+ 4 - 1
utils/util.js

@@ -67,13 +67,16 @@ function request(url, data = {}, method = "POST", header = "application/x-www-fo
                         res.data.errno = (res.data.code === 200 || res.data.code === 0) ? 0 : res.data.code;
                     }
                 }
-                console.log('res', res);
+                console.log('res', res, url);
 
                 if (res.statusCode == 200) {
                     let pages = getCurrentPages()
                     let currPage = pages[pages.length - 1].route
                     let notLogins = ['pages/index/index', 'pages/catalog/catalog', 'pages/category/category', 'pages/ucenter/index/index']
+                    console.log('test',res.data.code == 401 && !~notLogins.indexOf(currPage))
+
                     if (res.data.code == 401 && !~notLogins.indexOf(currPage)) {
+                        
                         resolve(res.data);
                         gotoLogin()
                     } else {