123456
This commit is contained in:
+21
-17
@@ -47,23 +47,27 @@ const options = {
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.code == 401) {
|
||||
console.log('no login')
|
||||
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: "请登录后再进行操作",
|
||||
confirmText: "确定",
|
||||
cancelText: '取消',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
let nowPage = getCurrentPages();
|
||||
let pageNum = nowPage.length - 1;
|
||||
console.log(nowPage)
|
||||
uni.setStorageSync('loginPage', nowPage[pageNum].route)
|
||||
uni.navigateTo({url: "/pagesA/login/login"})
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(213);
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (s) => {
|
||||
uni.request({
|
||||
url: apiUrl.apiUrl + '/api/user/getOpenid', //仅为示例,并非真实接口地址。
|
||||
data: {
|
||||
code: s.code,
|
||||
ad_code: uni.getStorageSync('get_ad_code'),
|
||||
invite: uni.getStorageSync("invite_number")
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.code == 1) {
|
||||
uni.setStorageSync("userinfo", res.data.userinfo);
|
||||
uni.setStorageSync("token", res.data.userinfo.token);
|
||||
uni.setStorageSync("config", res.data.config);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
reject(res.data)
|
||||
} else if (res.data.code == 0) {
|
||||
resolve(res.data)
|
||||
|
||||
Reference in New Issue
Block a user