From 997036b27927bcc1e9207a40b7a69c106a10f30c Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期三, 31 七月 2024 15:49:52 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia

---
 wechat_staff/app.js |   44 ++++++++++++--------------------------------
 1 files changed, 12 insertions(+), 32 deletions(-)

diff --git a/wechat_staff/app.js b/wechat_staff/app.js
index d83da7c..553e978 100644
--- a/wechat_staff/app.js
+++ b/wechat_staff/app.js
@@ -1,5 +1,6 @@
 import {
-  wxLoginCustomer
+  wxLoginCustomer,
+  getMemberInfo
 } from './api/index'
 App({
   globalData: {
@@ -12,35 +13,14 @@
     if (WindowInfo.safeArea.top > 20) {
       this.globalData.bottomLift = WindowInfo.screenHeight - WindowInfo.safeArea.bottom;
     }
-    wx.login({
-      timeout: 5000,
-      success(res) {
-        if (res.code) {
-          //鍙戣捣缃戠粶璇锋眰
-          wxLoginCustomer({
-            code: res.code
-          }).then(res => {
-            if (res && res.data) {
-              wx.setStorageSync('member', res.data.users || '')
-              wx.setStorageSync('sessionKey', res.data.sessionKey)
-              wx.setStorageSync('token', res.data.token || '')
-            } else {
-              wx.navigateTo({
-                url: '/pages/login/index',
-              })
-              console.log('鐧诲綍澶辫触锛�')
-            }
-          })
-        } else {
-          wx.navigateTo({
-            url: '/pages/login/index',
-          })
-          console.log('鐧诲綍澶辫触锛�' + res)
-        }
-      },
-      fail(err) {
-        console.log(err)
-      }
-    })
-  }
+    let users =  wx.getStorageSync('token') 
+    if(users ==null){
+      wx.navigateTo({
+        url: '/pages/login/index',
+      })
+    }else{
+      getMemberInfo({goLogin:true}).then(res => {  
+      }) 
+    }
+  }, 
 })
\ No newline at end of file

--
Gitblit v1.9.3