create-web-kit 25.728.2311 → 25.728.2313
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* HTTP 请求类封装(强类型,无 any)
|
|
3
3
|
* 配合 React Query 使用,简化超时和重试逻辑
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
import { toast } from "sonner";
|
|
7
6
|
|
|
8
7
|
interface RequestConfig {
|
|
@@ -102,19 +101,6 @@ export class HttpClient {
|
|
|
102
101
|
if (jsonResponse.code == 401) {
|
|
103
102
|
// 清除本地存储
|
|
104
103
|
localStorage.clear();
|
|
105
|
-
|
|
106
|
-
// 退出用户状态
|
|
107
|
-
if (typeof window !== "undefined") {
|
|
108
|
-
// 动态导入store避免循环依赖
|
|
109
|
-
import("@/store")
|
|
110
|
-
.then(({ useStore }) => {
|
|
111
|
-
const { logout, openLoginDialog } = useStore.getState();
|
|
112
|
-
logout();
|
|
113
|
-
openLoginDialog();
|
|
114
|
-
})
|
|
115
|
-
.catch(console.error);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
104
|
toast.error("登录信息已过期,请重新登录");
|
|
119
105
|
}
|
|
120
106
|
return jsonResponse;
|
package/package.json
CHANGED