优化跳转登录逻辑,退出登录,修改收据复制错误
This commit is contained in:
parent
4963d4f8a6
commit
31870c0222
@ -291,6 +291,13 @@ Page({
|
|||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (!data?.length) {
|
||||||
|
alertInfo("尚无信息")
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '/pages/handleLogin/index',
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
const [firstPark = {}] = data;
|
const [firstPark = {}] = data;
|
||||||
const { park, tenement } = this.data;
|
const { park, tenement } = this.data;
|
||||||
const updateDatas = {}
|
const updateDatas = {}
|
||||||
|
@ -79,15 +79,22 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
async logout() {
|
async logout() {
|
||||||
const { code, message } = await logout()
|
Dialog.alert({
|
||||||
if (code !== OK) {
|
title: '提示',
|
||||||
alertInfo(message)
|
message: '确认退出登录?',
|
||||||
return;
|
showCancelButton: true,
|
||||||
}
|
}).then(async () => {
|
||||||
wx.clearStorageSync()
|
const { code, message } = await logout()
|
||||||
wx.switchTab({
|
if (code !== OK) {
|
||||||
url: '/pages/home/index',
|
alertInfo(message)
|
||||||
})
|
return;
|
||||||
|
}
|
||||||
|
wx.clearStorageSync()
|
||||||
|
wx.switchTab({
|
||||||
|
url: '/pages/home/index',
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
bindTenement() {
|
bindTenement() {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
|
@ -50,19 +50,19 @@ Page({
|
|||||||
// 开发版
|
// 开发版
|
||||||
case 'develop':
|
case 'develop':
|
||||||
wx.setClipboardData({
|
wx.setClipboardData({
|
||||||
data: `https://zgd.hbhcbn.com/print/?id=${detail.serialNumber}`,
|
data: `https://1.92.72.5:8080/print/?id=${detail.serialNumber}`,
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
// 体验版
|
// 体验版
|
||||||
case 'trial':
|
case 'trial':
|
||||||
wx.setClipboardData({
|
wx.setClipboardData({
|
||||||
data: `https://zgd.hbhcbn.com/h5/?report=${id}&tenement=${tenement}`,
|
data: `http://1.92.72.5:8080/print/?id=${detail.serialNumber}`,
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
// 正式版
|
// 正式版
|
||||||
case 'release':
|
case 'release':
|
||||||
wx.setClipboardData({
|
wx.setClipboardData({
|
||||||
data: `https://zgd.hbhcbn.com/reporth5/?report=${id}&tenement=${tenement}`,
|
data: `https://zgd.hbhcbn.com/print/?id=${detail.serialNumber}`,
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,7 @@ const requestWithoutCookie = promisify(wx.request);
|
|||||||
|
|
||||||
// 考虑了Cookie的请求
|
// 考虑了Cookie的请求
|
||||||
const request = async function (options, config = {}) {
|
const request = async function (options, config = {}) {
|
||||||
console.log('请求参数', 'options', options, 'config', config)
|
console.log('请求地址', options.url, "请求参数", options.data, 'config', config)
|
||||||
console.log('token', wx.getStorageSync('token'), 'user', wx.getStorageSync('user'))
|
|
||||||
let token = wx.getStorageSync('token');
|
let token = wx.getStorageSync('token');
|
||||||
const result = wx.getAccountInfoSync();
|
const result = wx.getAccountInfoSync();
|
||||||
const { envVersion } = result.miniProgram;
|
const { envVersion } = result.miniProgram;
|
||||||
@ -74,7 +73,6 @@ const request = async function (options, config = {}) {
|
|||||||
} catch(err) {
|
} catch(err) {
|
||||||
alertInfo(err.errMsg)
|
alertInfo(err.errMsg)
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user