2022年5月29日 从svn移到git

This commit is contained in:
daihh
2022-05-29 18:59:24 +08:00
parent 9580ff8c9b
commit faa7afb65f
897 changed files with 171836 additions and 0 deletions

33
utils/token.js Normal file
View File

@@ -0,0 +1,33 @@
//const TOKEN_KEY = 'XBOE-Access-Token'
const TOKEN_KEY = 'token'
export function getToken() {
let token=uni.getStorageSync(TOKEN_KEY);
if(!token){
token=uni.getStorageSync('userInfo');
if(token){
token=JSON.parse(token).token;
}
}
return token;
//return uni.getStorageSync(TOKEN_KEY);
}
export function setToken(token) {
return uni.setStorageSync(TOKEN_KEY,token);
}
export function removeToken() {
uni.removeStorageSync(TOKEN_KEY);
uni.removeStorageSync('returnUrl');
uni.setStorageSync('oh','quit');
uni.removeStorageSync('userInfo');
uni.removeStorageSync('inner');
// #ifdef H5
document.cookie = "token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
document.cookie = "userInfo=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
document.cookie = "inner=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
// #endif
}
export const tokenName='token';