1
0
forked from dyf/APP

移植6155、650、670

This commit is contained in:
liub
2025-08-27 11:06:49 +08:00
parent 057858a132
commit c2aa8bfa2f
47 changed files with 20333 additions and 1355 deletions

View File

@ -60,7 +60,7 @@
data() {
return {
showView: false,
phone: '13800138002', //手机号码
phone: '17671332251', //手机号码
code: "123456", //验证码
agreed: false,
isCounting: false,
@ -69,6 +69,29 @@
showAgreement: false, // 控制弹窗显示
}
},
onLoad(){
if(uni.getStorageSync("token") && uni.getStorageSync("clientID")){//免登陆
let time=uni.getStorageSync("tokenTime");
if(!time){
time=0;
}
let currTime=new Date().getTime();
if(currTime<time){
console.log("登陆过并且没过期自动进入设备页");
uni.switchTab({
url: '/pages/common/index/index'
});
return;
}else{
//token过期了
uni.removeStorageSync("token")
uni.removeStorageSync("clientID")
uni.removeStorageSync("tokenTime")
}
}
},
methods: {
// 获取验证码
async getPhoneCode() {
@ -158,6 +181,7 @@
uni.hideLoading()
uni.setStorageSync('token', res.data.access_token) // 缓存token
uni.setStorageSync('clientID', res.data.client_id) // 缓存token
uni.setStorageSync('tokenTime',new Date().getTime()+86400000);//过期时间
uni.showToast({
title: '登录成功',
icon: 'success'