renmy 8 months ago
parent
commit
d8a5b79454
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/utils/auth.js

+ 4 - 4
src/utils/auth.js

@@ -3,13 +3,13 @@ import Cookies from 'js-cookie'
 const TokenKey = 'Admin-Token'
 
 export function getToken() {
-  return Cookies.get(TokenKey)
+    return sessionStorage.getItem(TokenKey) //Cookies.get(TokenKey)
 }
 
 export function setToken(token) {
-  return Cookies.set(TokenKey, token)
+    return sessionStorage.setItem(TokenKey, token) //Cookies.set(TokenKey, token)
 }
 
 export function removeToken() {
-  return Cookies.remove(TokenKey)
-}
+    return sessionStorage.setItem(TokenKey, null) //Cookies.remove(TokenKey)
+}