瀏覽代碼

decodeJWT 函数判断条件修改

fogwind 4 月之前
父節點
當前提交
afc0b86f77
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/utils/jwt-cookie.ts

+ 1 - 1
src/utils/jwt-cookie.ts

@@ -27,7 +27,7 @@ export const decodeJWT = <T = any>(token: string, isGuest: boolean = true): T |
     const decodedToken = decodeURIComponent(token);
     const parts = decodedToken.split(".");
 
-    if (parts.length !== 3) {
+    if (parts.length !== 2) {
       return null;
     }