|
@@ -1,5 +1,3 @@
|
|
-// pages/login/login.ts;
|
|
|
|
-const app = getApp();
|
|
|
|
const {
|
|
const {
|
|
login,
|
|
login,
|
|
register
|
|
register
|
|
@@ -48,7 +46,6 @@ Page({
|
|
wx.showLoading({
|
|
wx.showLoading({
|
|
title: '加载中',
|
|
title: '加载中',
|
|
});
|
|
});
|
|
-
|
|
|
|
// {"openid":"oZHPJ5JcNem2och3ToaocggmUENw","unionid":null,"userId":null,"deviceUid":null,"accessToken":null,"phone":null,"headUrl":"","nickname":"","isNewUser":true}
|
|
// {"openid":"oZHPJ5JcNem2och3ToaocggmUENw","unionid":null,"userId":null,"deviceUid":null,"accessToken":null,"phone":null,"headUrl":"","nickname":"","isNewUser":true}
|
|
login({
|
|
login({
|
|
code: res1.code,
|
|
code: res1.code,
|
|
@@ -59,35 +56,19 @@ Page({
|
|
code: phoneCode,
|
|
code: phoneCode,
|
|
unShowLoad: true,
|
|
unShowLoad: true,
|
|
}).then((res3) => {
|
|
}).then((res3) => {
|
|
- // {"openid":"oZHPJ5JcNem2och3ToaocggmUENw","userId":933625,"deviceUid":1,"accessToken":"PUK8WVnLbIFsWYjSteitmg3OhllpbUMvIPKUtfJgwhRtpl1jx4Fm1NkHQIiZYhHz","phone":"15915390284","headUrl":"https://music-play.oss-cn-shenzhen.aliyuncs.com/user/headurl/20220316194115703366576.png","nickname":"儿子的爸爸叫啥"}
|
|
|
|
- wx.login({
|
|
|
|
- success: res4 => {
|
|
|
|
- // {"openid":"oZHPJ5JcNem2och3ToaocggmUENw","unionid":null,"userId":933625,"deviceUid":1,"accessToken":"kaKdNAb9eO0iUGKsaLP18UE0wRwrvoCr4opjNC3AieaigH4Fu1IspQKi2zTPgLNG","phone":"15915390284","headUrl":"https://music-play.oss-cn-shenzhen.aliyuncs.com/user/headurl/20220316194115703366576.png","nickname":"儿子的爸爸叫啥","isNewUser":false}
|
|
|
|
- login({
|
|
|
|
- code: res4.code,
|
|
|
|
- phone: res3.phone,
|
|
|
|
- }).then((res5) => {
|
|
|
|
- wx.showToast({
|
|
|
|
- title: "登录成功",
|
|
|
|
- icon: 'success',
|
|
|
|
- duration: 2000
|
|
|
|
- });
|
|
|
|
- app.globalData.userInfo = res5;
|
|
|
|
- wx.setStorageSync("userInfo", res5);
|
|
|
|
- wx.setStorageSync("token", JSON.stringify({
|
|
|
|
- id: res5.userId,
|
|
|
|
- token: res5.accessToken,
|
|
|
|
- }), );
|
|
|
|
-
|
|
|
|
- getCurrentPages()[0].onUserInfoLoad();
|
|
|
|
- setTimeout(() => {
|
|
|
|
- route_util.redirectTo(route_constant.deviceList);
|
|
|
|
- }, 2000);
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- fail(fail4) {
|
|
|
|
- wx.hideLoading();
|
|
|
|
- },
|
|
|
|
|
|
+ var phone = res3.phone;
|
|
|
|
+ getCurrentPages()[0].loginReset(phone, function () {
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: "登录成功",
|
|
|
|
+ icon: 'success',
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
|
|
+ }, function () {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ route_util.redirectTo(route_constant.deviceList);
|
|
|
|
+ }, 2000);
|
|
|
|
+ }, function () {
|
|
|
|
+ wx.hideLoading();
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|