优化代码
This commit is contained in:
@@ -270,8 +270,18 @@ export default {
|
||||
const lastCleanTime = uni.getStorageSync("last_clean_time") || 0;
|
||||
const now = Date.now();
|
||||
if (now - lastCleanTime < 7 * 24 * 3600 * 1000) return; // 7 days
|
||||
uni.clearStorage();
|
||||
uni.setStorageSync("last_clean_time", now);
|
||||
request({
|
||||
url: "user/logout",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: this.info.id,
|
||||
},
|
||||
userInfo: false,
|
||||
})
|
||||
.then((res) => {
|
||||
uni.clearStorage();
|
||||
uni.setStorageSync("last_clean_time", now);
|
||||
})
|
||||
},
|
||||
//关闭弹窗(取消)
|
||||
closePopup() {
|
||||
|
||||
Reference in New Issue
Block a user