feat(mobile): 区分移动端token存储键名并添加Playwright测试

修改mobile端token存储键名为'mobile_token'以区分不同客户端
添加Playwright测试套件用于知识库管理功能测试
更新.gitignore忽略node_modules和test-results目录
This commit is contained in:
yourname
2025-05-06 06:24:04 +00:00
parent fb00382b8d
commit f158ff6ff5
6 changed files with 147 additions and 1 deletions

View File

@@ -27,7 +27,7 @@ const ThemeContext = createContext<ThemeContextType | null>(null);
// 认证提供者组件
export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
const [user, setUser] = useState<User | null>(null);
const [token, setToken] = useState<string | null>(getLocalStorageWithExpiry('token'));
const [token, setToken] = useState<string | null>(getLocalStorageWithExpiry('mobile_token'));
const [isAuthenticated, setIsAuthenticated] = useState(false);
const queryClient = useQueryClient();