renmy 8 月之前
父節點
當前提交
d8a5b79454
共有 1 個文件被更改,包括 4 次插入4 次删除
  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)
+}