import { access_token, token_type, refresh_token, expires_in, license, scope, SuccessRedirect, FailRedirect } from '@/config/status.config.js'; const SetStorage = (key) => (value) => uni.setStorageSync(key, value); export const setAccessToken = SetStorage(access_token); export const setTokenType = SetStorage(token_type); export const setRefreshToken = SetStorage(refresh_token); export const setScope = SetStorage(scope) export const redirectHome = (path) => { uni.switchTab({ url: path || SuccessRedirect }) } export const redirectLogin = (path) => { uni.clearStorageSync(); uni.reLaunch({ url: path || FailRedirect }) } // 获取用户状态 // export const getStates = (key) => uni.getStorageSync(key);