first commit

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:27:25 +08:00
commit 85b89ccea7
1694 changed files with 168292 additions and 0 deletions

34
com/storage/auth.js Normal file
View File

@@ -0,0 +1,34 @@
const token = 'token';
const user = 'user';
export function getAuth() {
return {
token: uni.getStorageSync(token),
user: uni.getStorageSync(user),
};
}
export function getToken() {
return uni.getStorageSync(token);
}
export function getUser() {
return uni.getStorageSync(user);
}
// 设置value
export function setAuth(value) {
uni.setStorageSync(token, value.token);
uni.setStorageSync(user, value.user);
}
// 设置value
export function setUser(value) {
uni.setStorageSync(user, value);
}
export function setToken(value) {
uni.setStorageSync(token, value);
}
// 清除WxUserInfo
export function removeAuth() {
uni.removeStorageSync(token);
uni.removeStorageSync(user);
}