feat: 重构用户认证逻辑,添加导航重定向功能,更新相关组件和路由
This commit is contained in:
@@ -8,6 +8,13 @@ const client = treaty<App>(window.location.origin, {
|
||||
fetch: {
|
||||
credentials: "include",
|
||||
},
|
||||
headers() {
|
||||
const token = localStorage.getItem("user-token") || "";
|
||||
return {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": token ? `Bearer ${token}` : "",
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
export interface SafeClientOptions {
|
||||
|
||||
Reference in New Issue
Block a user