Browse Source

fix: tirm

wangyuan 2 years ago
parent
commit
c913b6d64d
4 changed files with 12 additions and 9 deletions
  1. 1 1
      api/request.js
  2. 4 1
      pages/login/login.js
  3. 4 4
      pages/permissions/permissions.js
  4. 3 3
      pages/workbench/workbench.js

+ 1 - 1
api/request.js

@@ -18,7 +18,7 @@ export const wxRequest = (url,data) => {
       },
       method: 'POST',
       success (response) {
-        console.log('当前请求地址:', url);
+        console.log('当前请求地址:', BASE_API + url);
         console.log('当前请求参数:', data);
         console.log('当前请求返回:', response.data);
         if (response.statusCode !== 200) {

+ 4 - 1
pages/login/login.js

@@ -43,7 +43,6 @@ Page({
   },
   handleWXLogin () {
     const workerLoginCode = wx.getStorageSync('workerLoginCode')
-    console.log(workerLoginCode, 'workerLoginCode', wx.getStorageSync('workerLoginCode'));
     if (workerLoginCode == '403') {
       this.handleCode403()
     } else {
@@ -126,9 +125,13 @@ Page({
             content: '请绑定微信',
             confirmColor: '#333',
             showCancel: false,
+            showCancel: true,
+            cancelText: '取消',
             success (res) {
               if (res.confirm) {
                 that.bindWecahtFn(device)
+              } else if (res.cancel) {
+                that.handleDeviceFn(device)
               }
             }
           })

+ 4 - 4
pages/permissions/permissions.js

@@ -59,7 +59,7 @@ Page({
         scanFlag: false
       })
       var response = e.detail.result
-      var scodeType = response.split('|')[0] == 'DEVICE' ? true : false
+      var scodeType = response.split('|')[0].trim() == 'DEVICE' ? true : false
       if (!scodeType) {
         wx.showModal({
           content: '请扫描正确的设备二维码',
@@ -78,9 +78,9 @@ Page({
         })
       } else {
         // DEVICE|deviceCode|nonceCode|timeStamp
-        var deviceCode = response.split('|')[1]
-        var nonceCode = response.split('|')[2]
-        var timeStamp = response.split('|')[3]
+        var deviceCode = response.split('|')[1].trim()
+        var nonceCode = response.split('|')[2].trim()
+        var timeStamp = response.split('|')[3].trim()
         that.bindCarFn(deviceCode, nonceCode, timeStamp)
       }
     }

+ 3 - 3
pages/workbench/workbench.js

@@ -84,7 +84,7 @@ Page({
 
   // 处理扫描用户二维码
   handleScanUser (response) {
-    var scodeType = response.split('|')[0] == 'DOCUMENT' ? true : false
+    var scodeType = response.split('|')[0].trim() == 'DOCUMENT' ? true : false
     if (!scodeType) {
       wx.showModal({
         content: '请扫描正确的二维码',
@@ -94,8 +94,8 @@ Page({
     } else {
       // DOCUMENT|documentId|uuid
       var successScanTimer = setTimeout(() => {
-        var documentId = response.split('|')[1]
-        var uuid = response.split('|')[2]
+        var documentId = response.split('|')[1].trim()
+        var uuid = response.split('|')[2].trim()
         this.writeOffQueryFn(documentId, uuid)
         clearTimeout(successScanTimer)
       }, 300);