一点小优化

This commit is contained in:
liub
2025-09-26 16:31:56 +08:00
parent fd3a046ab3
commit d9e45becff
4 changed files with 28 additions and 9 deletions

View File

@ -20,7 +20,7 @@
// uni.removeStorageSync("clientID"); // uni.removeStorageSync("clientID");
// } // }
// } // }
// else if(val=="token" || val=="clientID"){ // else if(val=="token" || val=="clientID" || val=='phone'){
// console.log("忽略登陆信息"); // console.log("忽略登陆信息");
// }else{ // }else{
// uni.removeStorageSync(val); // uni.removeStorageSync(val);

View File

@ -561,10 +561,7 @@
} }
50% {
opacity: 0.5;
/* 增加中间过渡 */
}
100% { 100% {
width: 18.75rem; width: 18.75rem;

View File

@ -101,9 +101,11 @@
uni.removeStorageSync("token") uni.removeStorageSync("token")
uni.removeStorageSync("clientID") uni.removeStorageSync("clientID")
uni.removeStorageSync("tokenTime") uni.removeStorageSync("tokenTime")
this.phone= uni.getStorageInfoSync('phone');
} }
} }
}, },
methods: { methods: {
// 验证码密码切换 // 验证码密码切换
@ -237,6 +239,7 @@
uni.setStorageSync('token', res.data.access_token) // 缓存token uni.setStorageSync('token', res.data.access_token) // 缓存token
uni.setStorageSync('clientID', res.data.client_id) // 缓存token uni.setStorageSync('clientID', res.data.client_id) // 缓存token
uni.setStorageSync('tokenTime', new Date().getTime() + 86400000); //过期时间 uni.setStorageSync('tokenTime', new Date().getTime() + 86400000); //过期时间
uni.setStorageSync('phone',this.phone);
uni.showToast({ uni.showToast({
title: '登录成功', title: '登录成功',
icon: 'success' icon: 'success'

View File

@ -7,7 +7,7 @@
</view> </view>
<view class="user-right"> <view class="user-right">
<view class="user-title">武汉星汉</view> <view class="user-title">武汉星汉</view>
<view class="ID">ID:123456</view> <view class="ID">ID:{{phone?phone:'123456'}}</view>
</view> </view>
</view> </view>
<view class="content"> <view class="content">
@ -24,7 +24,7 @@
</view> </view>
<view class="menu-item" @click="aboutUs"> <view class="menu-item" @click="aboutUs">
<image src="/static/images/common/wm.png" class="icon"></image> <image src="/static/images/common/wm.png" class="icon"></image>
<text class="title">关于我们</text> <text class="title">关于我们 ({{appVersion}})</text>
<uni-icons type="right" size="25" color="rgba(255, 255, 255, 0.4)" class="uniIcon"></uni-icons> <uni-icons type="right" size="25" color="rgba(255, 255, 255, 0.4)" class="uniIcon"></uni-icons>
</view> </view>
<view class="menu-item" @click="account"> <view class="menu-item" @click="account">
@ -65,8 +65,27 @@
export default { export default {
data() { data() {
return { return {
showAgreement: false // 控制弹窗显示 showAgreement: false, // 控制弹窗显示
appVersion:'',
phone:''
} }
},
onLoad() {
var these=this;
uni.getSystemInfo({
success(res) {
if(res.uniPlatform=='app'){
plus.runtime.getProperty(plus.runtime.appid, (widgetInfo) => {
const currentVersion = widgetInfo.version;
these.appVersion=currentVersion;
});
}
}
});
this.phone= uni.getStorageSync('phone')
}, },
methods: { methods: {
// 取消 // 取消