Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(projects): new storage system [新的本地数据存储系统]
- Loading branch information
1 parent
7a58035
commit 9719159
Showing
23 changed files
with
165 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { localStg } from '@/utils'; | ||
|
||
/** 获取token */ | ||
export function getToken() { | ||
return localStg.get('token') || ''; | ||
} | ||
|
||
/** 获取用户信息 */ | ||
export function getUserInfo() { | ||
const emptyInfo: Auth.UserInfo = { | ||
userId: '', | ||
userName: '', | ||
userRole: 'user' | ||
}; | ||
const userInfo: Auth.UserInfo = localStg.get('userInfo') || emptyInfo; | ||
|
||
return userInfo; | ||
} | ||
|
||
/** 去除用户相关缓存 */ | ||
export function clearAuthStorage() { | ||
localStg.remove('token'); | ||
localStg.remove('refreshToken'); | ||
localStg.remove('userInfo'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
declare namespace StorageInterface { | ||
/** localStorage的存储数据的类型 */ | ||
interface Session { | ||
demoKey: string; | ||
} | ||
|
||
/** localStorage的存储数据的类型 */ | ||
interface Local { | ||
/** 主题颜色 */ | ||
themeColor: string; | ||
/** 用户token */ | ||
token: string; | ||
/** 用户刷新token */ | ||
refreshToken: string; | ||
/** 用户信息 */ | ||
userInfo: Auth.UserInfo; | ||
/** 主题配置 */ | ||
themeSettings: Theme.Setting; | ||
/** 多页签路由信息 */ | ||
multiTabRoutes: App.GlobalTabRoute[]; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
9719159
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
soybean-admin – ./
soybean-admin-honghuangdc.vercel.app
www.soybean.pro
soybean-admin-git-main-honghuangdc.vercel.app
soybean-admin.vercel.app
soybean.pro