生产管理系统 - 企业管理页面联调

This commit is contained in:
2025-11-03 17:23:49 +08:00
parent 45c2309662
commit 0305bd64a7
7 changed files with 773 additions and 495 deletions

11
crop-x/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;
}
};