子仓库提交

This commit is contained in:
2025-11-10 09:19:56 +08:00
parent 62f92213f7
commit 5feb24e4e2
733 changed files with 141413 additions and 0 deletions

11
src/utils/token.ts Normal file
View File

@@ -0,0 +1,11 @@
export const getAuthToken = (): string | null => {
try {
const storedUser = localStorage.getItem('user');
const user = storedUser ? JSON.parse(storedUser) : null;
return user?.token || null;
} catch (error) {
console.error('获取token失败:', error);
return null;
}
};