|
@@ -411,6 +411,8 @@ export default {
|
|
|
agentName: "", // 缘起
|
|
agentName: "", // 缘起
|
|
|
user_id: undefined,
|
|
user_id: undefined,
|
|
|
userinfo: undefined, // 获取用户信息
|
|
userinfo: undefined, // 获取用户信息
|
|
|
|
|
+
|
|
|
|
|
+ unid: '',
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onLoad: function (options) {
|
|
onLoad: function (options) {
|
|
@@ -442,10 +444,18 @@ export default {
|
|
|
success(res) {
|
|
success(res) {
|
|
|
if (res.code) {
|
|
if (res.code) {
|
|
|
post("appletLogin", { code: res.code }).then(res => {
|
|
post("appletLogin", { code: res.code }).then(res => {
|
|
|
- setTimeout(() => {
|
|
|
|
|
- that.showAuth = true
|
|
|
|
|
- that.shopInfo = app.globalData.shopInfo
|
|
|
|
|
- }, 500);
|
|
|
|
|
|
|
+ if(res.code === 0){
|
|
|
|
|
+ if(res.data.token){
|
|
|
|
|
+ uni.setStorageSync('token', res.data.token);
|
|
|
|
|
+ that.getuserInfo();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ that.unid = res.data.unid
|
|
|
|
|
+ // setTimeout(() => {
|
|
|
|
|
+ that.showAuth = true
|
|
|
|
|
+ that.shopInfo = app.globalData.shopInfo
|
|
|
|
|
+ // }, 500);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -457,11 +467,21 @@ export default {
|
|
|
// #endif
|
|
// #endif
|
|
|
},
|
|
},
|
|
|
onauthGetTelSuccess(da){
|
|
onauthGetTelSuccess(da){
|
|
|
- console.log(da);
|
|
|
|
|
- post("getMobile", da.detail).then(res => {
|
|
|
|
|
- console.log(res);
|
|
|
|
|
|
|
+ this.showAuth = false;
|
|
|
|
|
+ post("getMobile", {unid:this.unid, ...da.detail}).then(res => {
|
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
|
+ uni.setStorageSync('token', res.data.token);
|
|
|
|
|
+ this.getuserInfo();
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ getuserInfo() {
|
|
|
|
|
+ post("/user/userinfo").then((res) => {
|
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
|
+ uni.setStorageSync('userinfo', res.data.data);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
// 获取用户信息
|
|
// 获取用户信息
|
|
|
loadData() {
|
|
loadData() {
|