auth.js 601 B

1234567891011121314151617181920212223242526
  1. const TokenKey = 'App-Token'
  2. const AdminTypeKey = 'App-AdminType'
  3. export function getToken() {
  4. return uni.getStorageSync(TokenKey)
  5. }
  6. export function setToken(token) {
  7. return uni.setStorageSync(TokenKey, token)
  8. }
  9. export function removeToken() {
  10. return uni.removeStorageSync(TokenKey)
  11. }
  12. export function getAdminType() {
  13. return uni.getStorageSync(AdminTypeKey)
  14. }
  15. export function setAdminType(adminType) {
  16. console.log(adminType)
  17. return uni.setStorageSync(AdminTypeKey, adminType)
  18. }
  19. export function removeAdminType() {
  20. return uni.removeStorageSync(AdminTypeKey)
  21. }