From 9f78f3f014a3423ea3fcab8f9f1056c57cd47fc8 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 26 八月 2022 17:16:26 +0800
Subject: [PATCH] 2022.8.26
---
pages/module_user/userlogin/userlogin.js | 40 ++++++++++++++++++++++++++++++----------
1 files changed, 30 insertions(+), 10 deletions(-)
diff --git a/pages/module_user/userlogin/userlogin.js b/pages/module_user/userlogin/userlogin.js
index 5609ece..6cf3bfd 100644
--- a/pages/module_user/userlogin/userlogin.js
+++ b/pages/module_user/userlogin/userlogin.js
@@ -34,19 +34,22 @@
},
loginWx() {
+ var that = this
wx.getUserProfile({
lang: 'zh_CN',
desc: '鐢ㄤ簬鏄剧ず锛屾彁绀虹敤鎴峰綋鍓嶅凡鐧诲綍',
success(res) {
console.log(res);
- wx.login({
- timeout: 10000,
- success: (result) => {
- console.log(result);
- },
- fail: (res) => {},
- complete: (res) => {},
- })
+ // wx.login({
+ // timeout: 10000,
+ // success: (result) => {
+ // console.log(result);
+ // },
+ // fail: (res) => {},
+ // complete: (res) => {},
+ // })
+
+ that.login()
}
})
},
@@ -56,13 +59,20 @@
var that = this
wx.getStorage({
key: 'accessToken',
- success(res) {
+ success(res) { //鑾峰彇鎴愬姛鑷姩鐧诲綍
app.globalData.accessToken = res.data
that.setData({
userName: res.data.userName,
password: res.data.password
})
+ wx.showLoading({
+ title: '鐧诲綍涓�',
+ mask: true,
+ })
+ setTimeout(() => {
+ wx.hideLoading()
+ }, 10000);
userservice.login(that.data.userName, that.data.password, {
success(data) {
if (data.success) {
@@ -89,17 +99,27 @@
that.setData({
loading: false
})
+ wx.hideLoading()
}
})
},
+ fail(e) { //鑾峰彇澶辫触
+ //鍚庡彴鏌ヨ寰俊鏄惁缁戝畾璐﹀彿锛屾湭缁戝畾鍒欒烦杞敞鍐岀晫闈�
+ wx.navigateTo({
+ url: '/pages/module_user/userregistercompany/userregistercompany',
+ success: (result) => {},
+ fail: (res) => {},
+ complete: (res) => {},
+ })
+ }
})
},
getUserInfo() {
- var that = this
userservice.getUserInfo(app.globalData.accessToken.userId, {
success(data) {
app.globalData.userInfo = data
+ app.globalData.isLogin = true
wx.setStorage({
key: 'userInfo',
data: data,
--
Gitblit v1.9.3