optimize: ♻️ 修改http请求分类
This commit is contained in:
parent
f85acf9217
commit
f267e5e042
|
@ -8,9 +8,9 @@ import type {
|
|||
PureHttpRequestConfig,
|
||||
PureHttpResponse,
|
||||
RequestMethods
|
||||
} from "./types.d";
|
||||
} from "./types";
|
||||
import { stringify } from "qs";
|
||||
import NProgress from "../progress";
|
||||
import NProgress from "../../utils/progress";
|
||||
import { formatToken, getToken } from "@/utils/auth";
|
||||
import { useUserStoreHook } from "@/store/modules/user";
|
||||
|
|
@ -8,9 +8,9 @@ import type {
|
|||
PureHttpRequestConfig,
|
||||
PureHttpResponse,
|
||||
RequestMethods
|
||||
} from "./types.d";
|
||||
} from "./types";
|
||||
import { stringify } from "qs";
|
||||
import NProgress from "../progress";
|
||||
import NProgress from "../../utils/progress";
|
||||
import { formatToken, getToken } from "@/utils/auth";
|
||||
import { useUserStoreHook } from "@/store/modules/user";
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { http } from "@/utils/http/mockRequest";
|
||||
import { http } from "@/api/service/mockRequest";
|
||||
|
||||
type Result = {
|
||||
success: boolean;
|
|
@ -1,4 +1,4 @@
|
|||
import { http } from "@/utils/http/mockRequest";
|
||||
import { http } from "@/api/service/mockRequest";
|
||||
|
||||
export type UserResult = {
|
||||
success: boolean;
|
|
@ -1,34 +1,34 @@
|
|||
import {
|
||||
type RouterHistory,
|
||||
type RouteRecordRaw,
|
||||
type RouteComponent,
|
||||
createWebHashHistory,
|
||||
createWebHistory,
|
||||
createWebHashHistory
|
||||
type RouteComponent,
|
||||
type RouteRecordRaw,
|
||||
type RouterHistory
|
||||
} from "vue-router";
|
||||
import { router } from "./index";
|
||||
import { isProxy, toRaw } from "vue";
|
||||
import { useTimeoutFn } from "@vueuse/core";
|
||||
import {
|
||||
isString,
|
||||
cloneDeep,
|
||||
isAllEmpty,
|
||||
intersection,
|
||||
storageLocal,
|
||||
isIncludeAllChildren
|
||||
isAllEmpty,
|
||||
isIncludeAllChildren,
|
||||
isString,
|
||||
storageLocal
|
||||
} from "@pureadmin/utils";
|
||||
import { getConfig } from "@/config";
|
||||
import { buildHierarchyTree } from "@/utils/tree";
|
||||
import { userKey, type DataInfo } from "@/utils/auth";
|
||||
import { type DataInfo, userKey } from "@/utils/auth";
|
||||
import { type menuType, routerArrays } from "@/layout/types";
|
||||
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||
// 动态路由
|
||||
import { getAsyncRoutes } from "@/api/v1/routes";
|
||||
|
||||
const IFrame = () => import("@/layout/frame.vue");
|
||||
// https://cn.vitejs.dev/guide/features.html#glob-import
|
||||
const modulesRoutes = import.meta.glob("/src/views/**/*.{vue,tsx}");
|
||||
|
||||
// 动态路由
|
||||
import { getAsyncRoutes } from "@/api/routes";
|
||||
|
||||
function handRank(routeInfo: any) {
|
||||
const { name, path, parentId, meta } = routeInfo;
|
||||
return isAllEmpty(parentId)
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
import { defineStore } from "pinia";
|
||||
import {
|
||||
type userType,
|
||||
store,
|
||||
router,
|
||||
resetRouter,
|
||||
router,
|
||||
routerArrays,
|
||||
storageLocal
|
||||
storageLocal,
|
||||
store,
|
||||
type userType
|
||||
} from "../utils";
|
||||
import {
|
||||
type UserResult,
|
||||
type RefreshTokenResult,
|
||||
getLogin,
|
||||
refreshTokenApi
|
||||
} from "@/api/user";
|
||||
refreshTokenApi,
|
||||
type RefreshTokenResult,
|
||||
type UserResult
|
||||
} from "@/api/v1/user";
|
||||
import { useMultiTagsStoreHook } from "./multiTags";
|
||||
import { type DataInfo, setToken, removeToken, userKey } from "@/utils/auth";
|
||||
import { type DataInfo, removeToken, setToken, userKey } from "@/utils/auth";
|
||||
|
||||
export const useUserStore = defineStore({
|
||||
id: "pure-user",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import Cookies from "js-cookie";
|
||||
import { useUserStoreHook } from "@/store/modules/user";
|
||||
import { storageLocal, isString, isIncludeAllChildren } from "@pureadmin/utils";
|
||||
import { isIncludeAllChildren, isString, storageLocal } from "@pureadmin/utils";
|
||||
|
||||
export interface DataInfo<T> {
|
||||
/** token */
|
||||
|
|
Loading…
Reference in New Issue