refactor: 重命名 API 文件并更新引用路径
- 重命名 13 个 API 文件,去掉 -api 后缀 * src/api/auth-api.ts auth.ts * src/api/codegen-api.ts codegen.ts * src/api/file-api.ts file.ts * src/api/system/*.ts (9个文件) - 批量更新 50+ 处 API 引用路径 - 修复 websocket 和枚举导入路径 - 确保零编码问题(使用 UTF-8 编码)
This commit is contained in:
1 parent
9fb1942619
commit
23b52872c5
48 files changed
+56
-53
No files matched your search
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -53,7 +53,7 @@ import {
|
||||
UploadRequestOptions,
|
||||
} from "element-plus";
|
||||
|
||||
import FileAPI, { FileInfo } from "@/api/file-api";
|
||||
import FileAPI, { FileInfo } from "@/api/file";
|
||||
|
||||
const props = defineProps({
|
||||
/**
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { UploadRawFile, UploadRequestOptions, UploadUserFile } from "element-plus";
|
||||
import FileAPI, { FileInfo } from "@/api/file-api";
|
||||
import FileAPI, { FileInfo } from "@/api/file";
|
||||
|
||||
const props = defineProps({
|
||||
/**
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { UploadRawFile, UploadRequestOptions } from "element-plus";
|
||||
import FileAPI, { FileInfo } from "@/api/file-api";
|
||||
import FileAPI, { FileInfo } from "@/api/file";
|
||||
|
||||
const props = defineProps({
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,7 @@ import { Toolbar, Editor } from "@wangeditor-next/editor-for-vue";
|
||||
import { IToolbarConfig, IEditorConfig } from "@wangeditor-next/editor";
|
||||
|
||||
// 文件上传 API
|
||||
import FileAPI from "@/api/file-api";
|
||||
import FileAPI from "@/api/file";
|
||||
|
||||
// 上传图片回调函数类型
|
||||
type InsertFnType = (_url: string, _alt: string, _href: string) => void;
|
||||
|
||||
@@ -3,7 +3,7 @@ import NoticeAPI, {
|
||||
type NoticePageVO,
|
||||
type NoticeDetailVO,
|
||||
type NoticePageQuery,
|
||||
} from "@/api/system/notice-api";
|
||||
} from "@/api/system/notice";
|
||||
import { useStomp } from "@/composables/websocket/useStomp";
|
||||
import router from "@/router";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { store } from "@/store";
|
||||
import DictAPI, { type DictItemOption } from "@/api/system/dict-api";
|
||||
import DictAPI, { type DictItemOption } from "@/api/system/dict";
|
||||
import { STORAGE_KEYS } from "@/constants";
|
||||
|
||||
export const useDictStore = defineStore("dict", () => {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { constantRoutes } from "@/router";
|
||||
import { store } from "@/store";
|
||||
import router from "@/router";
|
||||
|
||||
import MenuAPI, { type RouteVO } from "@/api/system/menu-api";
|
||||
import MenuAPI, { type RouteVO } from "@/api/system/menu";
|
||||
const modules = import.meta.glob("../../views/**/**.vue");
|
||||
const Layout = () => import("../../layouts/index.vue");
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { store } from "@/store";
|
||||
import TenantAPI, { type TenantInfo } from "@/api/system/tenant-api";
|
||||
import TenantAPI, { type TenantInfo } from "@/api/system/tenant";
|
||||
import { STORAGE_KEYS } from "@/constants";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import { store } from "@/store";
|
||||
|
||||
import AuthAPI, { type LoginRequest } from "@/api/auth-api";
|
||||
import UserAPI, { type UserInfo } from "@/api/system/user-api";
|
||||
import AuthAPI from "@/api/auth";
|
||||
import UserAPI from "@/api/system/user";
|
||||
import type { LoginRequest } from "@/types/api";
|
||||
|
||||
import { AuthStorage } from "@/utils/auth";
|
||||
import { usePermissionStoreHook } from "@/store/modules/permission-store";
|
||||
import { useDictStoreHook } from "@/store/modules/dict-store";
|
||||
import { useTagsViewStore } from "@/store";
|
||||
import { cleanupWebSocket } from "@/plugins/websocket";
|
||||
import { cleanupWebSocket } from "@/utils/websocket";
|
||||
|
||||
export const useUserStore = defineStore("user", () => {
|
||||
// 用户信息
|
||||
|
||||
@@ -530,11 +530,11 @@ import GeneratorAPI, {
|
||||
GenConfigForm,
|
||||
TablePageQuery,
|
||||
FieldConfig,
|
||||
} from "@/api/codegen-api";
|
||||
} from "@/api/codegen";
|
||||
import { ElLoading } from "element-plus";
|
||||
|
||||
import DictAPI from "@/api/system/dict-api";
|
||||
import MenuAPI from "@/api/system/menu-api";
|
||||
import DictAPI from "@/api/system/dict";
|
||||
import MenuAPI from "@/api/system/menu";
|
||||
|
||||
interface TreeNode {
|
||||
label: string;
|
||||
|
||||
@@ -357,7 +357,7 @@ defineOptions({
|
||||
});
|
||||
|
||||
import { dayjs } from "element-plus";
|
||||
import LogAPI, { VisitStatsVO, VisitTrendVO } from "@/api/system/log-api";
|
||||
import LogAPI, { VisitStatsVO, VisitTrendVO } from "@/api/system/log";
|
||||
import { useUserStore } from "@/store/modules/user-store";
|
||||
import { formatGrowthRate } from "@/utils";
|
||||
import { useTransition, useDateFormat } from "@vueuse/core";
|
||||
|
||||
@@ -68,10 +68,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import UserAPI from "@/api/system/user-api";
|
||||
import DeptAPI from "@/api/system/dept-api";
|
||||
import RoleAPI from "@/api/system/role-api";
|
||||
import type { UserForm, UserPageQuery } from "@/api/system/user-api";
|
||||
import UserAPI from "@/api/system/user";
|
||||
import DeptAPI from "@/api/system/dept";
|
||||
import RoleAPI from "@/api/system/role";
|
||||
import type { UserForm, UserPageQuery } from "@/api/system/user";
|
||||
import type { IObject, IModalConfig, IContentConfig, ISearchConfig } from "@/components/CURD/types";
|
||||
import { DeviceEnum } from "@/enums/settings/device-enum";
|
||||
import { useAppStore } from "@/store";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import UserAPI, { type UserForm } from "@/api/system/user-api";
|
||||
import UserAPI, { type UserForm } from "@/api/system/user";
|
||||
import type { IModalConfig } from "@/components/CURD/types";
|
||||
import { deptArr, roleArr } from "./options";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import UserAPI from "@/api/system/user-api";
|
||||
import RoleAPI from "@/api/system/role-api";
|
||||
import type { UserPageQuery } from "@/api/system/user-api";
|
||||
import UserAPI from "@/api/system/user";
|
||||
import RoleAPI from "@/api/system/role";
|
||||
import type { UserPageQuery } from "@/api/system/user";
|
||||
import type { IContentConfig } from "@/components/CURD/types";
|
||||
|
||||
const contentConfig: IContentConfig<UserPageQuery> = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import UserAPI, { type UserForm } from "@/api/system/user-api";
|
||||
import UserAPI, { type UserForm } from "@/api/system/user";
|
||||
import type { IModalConfig } from "@/components/CURD/types";
|
||||
import { DeviceEnum } from "@/enums/settings/device-enum";
|
||||
import { useAppStore } from "@/store";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** 公共下载数据,减少重复请求次数 */
|
||||
import DeptAPI from "@/api/system/dept-api";
|
||||
import RoleAPI from "@/api/system/role-api";
|
||||
import DeptAPI from "@/api/system/dept";
|
||||
import RoleAPI from "@/api/system/role";
|
||||
|
||||
interface OptionType {
|
||||
label: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { UserForm } from "@/api/system/user-api";
|
||||
import type { UserForm } from "@/api/system/user";
|
||||
import type { IModalConfig } from "@/components/CURD/types";
|
||||
import { deptArr } from "../config/options";
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import UserAPI from "@/api/system/user-api";
|
||||
import UserAPI from "@/api/system/user";
|
||||
import type { IObject, IOperateData, PageModalInstance } from "@/components/CURD/types";
|
||||
import usePage from "@/components/CURD/usePage";
|
||||
import addModalConfig from "./config/add";
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
<script setup lang="ts">
|
||||
import { useDictStoreHook } from "@/store/modules/dict-store";
|
||||
import { useDateFormat } from "@vueuse/core";
|
||||
import DictAPI, { DictItemForm } from "@/api/system/dict-api";
|
||||
import DictAPI, { DictItemForm } from "@/api/system/dict";
|
||||
import { useDictSync, DictMessage } from "@/composables";
|
||||
|
||||
// 性别字典编码
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import FileAPI from "@/api/file-api";
|
||||
import FileAPI from "@/api/file";
|
||||
|
||||
const imgUrl = ref("");
|
||||
const canvas = ref();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import UserAPI from "@/api/system/user-api";
|
||||
import UserAPI from "@/api/system/user";
|
||||
import type { ISelectConfig } from "@/components/TableSelect/index.vue";
|
||||
|
||||
const selectConfig: ISelectConfig = {
|
||||
|
||||
@@ -142,12 +142,13 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { FormInstance } from "element-plus";
|
||||
import AuthAPI, { type LoginRequest } from "@/api/auth-api";
|
||||
import AuthAPI from "@/api/auth";
|
||||
import type { LoginRequest } from "@/types/api";
|
||||
import router from "@/router";
|
||||
import { useUserStore } from "@/store";
|
||||
import CommonWrapper from "@/components/CommonWrapper/index.vue";
|
||||
import { AuthStorage } from "@/utils/auth";
|
||||
import { ApiCodeEnum } from "@/enums/api/code-enum";
|
||||
import { ApiCodeEnum } from "@/enums";
|
||||
|
||||
const { t } = useI18n();
|
||||
const userStore = useUserStore();
|
||||
|
||||
@@ -98,7 +98,8 @@
|
||||
import type { FormInstance } from "element-plus";
|
||||
import { Lock } from "@element-plus/icons-vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import AuthAPI, { type LoginRequest } from "@/api/auth-api";
|
||||
import AuthAPI from "@/api/auth";
|
||||
import type { LoginRequest } from "@/types/api";
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
|
||||
@@ -230,9 +230,9 @@ import UserAPI, {
|
||||
MobileUpdateForm,
|
||||
EmailUpdateForm,
|
||||
UserProfileForm,
|
||||
} from "@/api/system/user-api";
|
||||
} from "@/api/system/user";
|
||||
|
||||
import FileAPI from "@/api/file-api";
|
||||
import FileAPI from "@/api/file";
|
||||
import { useUserStoreHook } from "@/store";
|
||||
|
||||
import { Camera } from "@element-plus/icons-vue";
|
||||
|
||||
@@ -119,7 +119,7 @@ import NoticeAPI, {
|
||||
type NoticePageVO,
|
||||
type NoticePageQuery,
|
||||
type NoticeDetailVO,
|
||||
} from "@/api/system/notice-api";
|
||||
} from "@/api/system/notice";
|
||||
|
||||
const queryFormRef = ref();
|
||||
const pageData = ref<NoticePageVO[]>([]);
|
||||
|
||||
@@ -141,7 +141,7 @@ defineOptions({
|
||||
inheritAttrs: false,
|
||||
});
|
||||
|
||||
import ConfigAPI, { ConfigPageVO, ConfigForm, ConfigPageQuery } from "@/api/system/config-api";
|
||||
import ConfigAPI, { ConfigPageVO, ConfigForm, ConfigPageQuery } from "@/api/system/config";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { useDebounceFn } from "@vueuse/core";
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ defineOptions({
|
||||
inheritAttrs: false,
|
||||
});
|
||||
|
||||
import DeptAPI, { DeptVO, DeptForm, DeptQuery } from "@/api/system/dept-api";
|
||||
import DeptAPI, { DeptVO, DeptForm, DeptQuery } from "@/api/system/dept";
|
||||
|
||||
const queryFormRef = ref();
|
||||
const deptFormRef = ref();
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { TagProps } from "element-plus";
|
||||
import DictAPI, { DictItemPageQuery, DictItemPageVO, DictItemForm } from "@/api/system/dict-api";
|
||||
import DictAPI, { DictItemPageQuery, DictItemPageVO, DictItemForm } from "@/api/system/dict";
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ defineOptions({
|
||||
inherititems: false,
|
||||
});
|
||||
|
||||
import DictAPI, { DictPageQuery, DictPageVO, DictForm } from "@/api/system/dict-api";
|
||||
import DictAPI, { DictPageQuery, DictPageVO, DictForm } from "@/api/system/dict";
|
||||
|
||||
import router from "@/router";
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ defineOptions({
|
||||
inheritAttrs: false,
|
||||
});
|
||||
|
||||
import LogAPI, { LogPageVO, LogPageQuery } from "@/api/system/log-api";
|
||||
import LogAPI, { LogPageVO, LogPageQuery } from "@/api/system/log";
|
||||
|
||||
const queryFormRef = ref();
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@
|
||||
import { useAppStore } from "@/store/modules/app-store";
|
||||
import { DeviceEnum } from "@/enums/settings/device-enum";
|
||||
|
||||
import MenuAPI, { MenuQuery, MenuForm, MenuVO } from "@/api/system/menu-api";
|
||||
import MenuAPI, { MenuQuery, MenuForm, MenuVO } from "@/api/system/menu";
|
||||
import { MenuTypeEnum } from "@/enums/system/menu-enum";
|
||||
|
||||
defineOptions({
|
||||
|
||||
@@ -265,8 +265,8 @@ import NoticeAPI, {
|
||||
NoticeForm,
|
||||
NoticePageQuery,
|
||||
NoticeDetailVO,
|
||||
} from "@/api/system/notice-api";
|
||||
import UserAPI from "@/api/system/user-api";
|
||||
} from "@/api/system/notice";
|
||||
import UserAPI from "@/api/system/user";
|
||||
|
||||
const queryFormRef = ref();
|
||||
const dataFormRef = ref();
|
||||
|
||||
@@ -215,8 +215,8 @@
|
||||
import { useAppStore } from "@/store/modules/app-store";
|
||||
import { DeviceEnum } from "@/enums/settings/device-enum";
|
||||
|
||||
import RoleAPI, { RolePageVO, RoleForm, RolePageQuery } from "@/api/system/role-api";
|
||||
import MenuAPI from "@/api/system/menu-api";
|
||||
import RoleAPI, { RolePageVO, RoleForm, RolePageQuery } from "@/api/system/role";
|
||||
import MenuAPI from "@/api/system/menu";
|
||||
|
||||
defineOptions({
|
||||
name: "Role",
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import DeptAPI from "@/api/system/dept-api";
|
||||
import DeptAPI from "@/api/system/dept";
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: [String, Number],
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage, type UploadUserFile } from "element-plus";
|
||||
import UserAPI from "@/api/system/user-api";
|
||||
import UserAPI from "@/api/system/user";
|
||||
import { ApiCodeEnum } from "@/enums/api/code-enum";
|
||||
|
||||
const emit = defineEmits(["import-success"]);
|
||||
|
||||
@@ -253,15 +253,15 @@ import { useDebounceFn } from "@vueuse/core";
|
||||
import { ElMessage, ElMessageBox, type FormInstance } from "element-plus";
|
||||
|
||||
// ==================== 3. 类型定义 ====================
|
||||
import type { UserForm, UserPageQuery, UserPageVO } from "@/api/system/user-api";
|
||||
import type { UserForm, UserPageQuery, UserPageVO } from "@/api/system/user";
|
||||
|
||||
// ==================== 3.5 工具函数 ====================
|
||||
import { downloadFile } from "@/utils";
|
||||
import { VALIDATORS } from "@/constants";
|
||||
// ==================== 4. API 服务 ====================
|
||||
import UserAPI from "@/api/system/user-api";
|
||||
import DeptAPI from "@/api/system/dept-api";
|
||||
import RoleAPI from "@/api/system/role-api";
|
||||
import UserAPI from "@/api/system/user";
|
||||
import DeptAPI from "@/api/system/dept";
|
||||
import RoleAPI from "@/api/system/role";
|
||||
|
||||
// ==================== 5. Store ====================
|
||||
import { useUserStore, useAppStore } from "@/store";
|
||||
|
||||
Reference in new issue
Block a user