qingcheng-xiaochengxu/pages/mypage/mypage.js

101 lines
1.9 KiB
JavaScript
Raw Normal View History

2025-05-21 12:24:34 +00:00
2025-05-16 01:58:51 +00:00
import {url} from '../../request'
2025-04-28 07:59:21 +00:00
Page({
2025-05-11 07:12:01 +00:00
2025-04-28 07:59:21 +00:00
data: {
2025-05-21 12:24:34 +00:00
2025-04-28 07:59:21 +00:00
},
2025-05-21 12:24:34 +00:00
2025-05-16 01:58:51 +00:00
2025-04-28 07:59:21 +00:00
onLoad(options) {
2025-05-16 01:58:51 +00:00
checkLogin();
2025-04-28 07:59:21 +00:00
},
onReady() {
},
2025-05-16 03:02:59 +00:00
tiaozhuan(){
wx.navigateTo({
url: '/pages/tuiguangma/tuiguangma',
})
},
2025-04-28 07:59:21 +00:00
onShow() {
2025-05-21 12:24:34 +00:00
2025-04-28 07:59:21 +00:00
},
2025-05-15 01:40:36 +00:00
wodejiedan(){
wx.navigateTo({
url: '/pages/wodejiedan/wodejiedan',
})
2025-05-16 01:58:51 +00:00
},
out(){
wx.showModal({
title: '提示',
content: '确定退出登录吗?',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
wx.getStorage({
key: "logmessage",
success(res) {
const userinfo = res.data.Authorization
wx.request({
url: url + '/userInfo/mini/logout',
method: 'GET',
data: {
},
header: {
'content-type': 'application/json',
'Authorization': userinfo
},
success(res) {
console.log('查询成功', res);
if(res.data.code==1){
wx.showToast({
title: "退出成功",
icon:'sucess',
duration:2000
})
}
},
fail(err) {
console.error('请求失败', err);
}
});
}
})
try {
wx.clearStorageSync();
console.log("所有缓存清除成功");
} catch (e) {
console.error("清除缓存失败", e);
}
} else {
console.log('用户点击取消')
}
}
})
2025-05-15 01:40:36 +00:00
},
2025-04-28 07:59:21 +00:00
onHide() {
},
onUnload() {
},
onPullDownRefresh() {
},
onReachBottom() {
},
onShareAppMessage() {
}
})