refactor: ♻️ 用户API和类型导入合并

This commit is contained in:
ray
2024-07-10 07:57:16 +08:00
parent 2f9953d6bc
commit e5ff1e8c2b

View File

@@ -1,10 +1,8 @@
import AuthAPI from "@/api/auth";
import UserAPI from "@/api/user";
import AuthAPI, { LoginData } from "@/api/auth";
import UserAPI, { UserInfo } from "@/api/user";
import { resetRouter } from "@/router";
import { store } from "@/store";
import { LoginData } from "@/api/auth";
import { UserInfo } from "@/api/user";
import { TOKEN_KEY } from "@/enums/CacheEnum";
export const useUserStore = defineStore("user", () => {
@@ -89,7 +87,11 @@ export const useUserStore = defineStore("user", () => {
};
});
// 非setup
/**
* 用于在组件外部如在Pinia Store 中)使用 Pinia 提供的 store 实例。
* 官方文档解释了如何在组件外部使用 Pinia Store
* https://pinia.vuejs.org/core-concepts/outside-component-usage.html#using-a-store-outside-of-a-component
*/
export function useUserStoreHook() {
return useUserStore(store);
}