NewLife/cube-front

chore(core): 更新模块导入路径,统一使用 cube-front 前缀
何炳宏 authored at 2026-05-13 22:25:35
dad2879
Tree
1 Parent(s) a6f30d6
Summary: 10 changed files with 14 additions and 25 deletions.
Modified +4 -4
Modified +1 -1
Modified +1 -1
Modified +1 -1
Modified +1 -1
Modified +1 -1
Modified +3 -3
Modified +2 -2
Modified +0 -9
Modified +0 -2
Modified +4 -4
diff --git a/core/pages/DefaultEntity.vue b/core/pages/DefaultEntity.vue
index 5dbe2ea..c478768 100644
--- a/core/pages/DefaultEntity.vue
+++ b/core/pages/DefaultEntity.vue
@@ -9,14 +9,14 @@
 import { computed, defineAsyncComponent, inject, watchEffect } from 'vue';
 import type { Component } from 'vue';
 import { useRoute, useRouter } from 'vue-router';
-import { useMenuStore, type FlatMenuItem } from '@core/stores/menu';
+import { useMenuStore, type FlatMenuItem } from 'cube-front/core/stores/menu';
 import {
   DefaultListPageKey,
   PageNotFoundKey,
   PageSectionRegistryKey,
-} from '@core/composables/useSections';
-import { registerMenuRoutes } from '@core/utils/menuRoutes';
-import FrameworkDefaultListPage from '@core/views/index.vue';
+} from 'cube-front/core/composables/useSections';
+import { registerMenuRoutes } from 'cube-front/core/utils/menuRoutes';
+import FrameworkDefaultListPage from 'cube-front/core/views/index.vue';
 import FrameworkPageNotFound from './PageNotFound.vue';
 
 type SectionRegistry = Record<string, Record<string, () => Promise<{ default: unknown }>>>;
Modified +1 -1
diff --git a/core/routes/index.ts b/core/routes/index.ts
index bf8246e..951ed84 100644
--- a/core/routes/index.ts
+++ b/core/routes/index.ts
@@ -1,4 +1,4 @@
-import { type ConfigRoute } from '../typings.d';
+import type { ConfigRoute } from '../typings';
 
 const routes: ConfigRoute[] = [
   {
Modified +1 -1
diff --git a/core/stores/menu.ts b/core/stores/menu.ts
index 51efd90..df1be4b 100644
--- a/core/stores/menu.ts
+++ b/core/stores/menu.ts
@@ -1,5 +1,5 @@
 import { defineStore } from 'pinia';
-import { getConfig } from '@core/configure';
+import { getConfig } from 'cube-front/core/configure';
 import { getDataByKey } from '../utils/common';
 import { type AxiosRequestConfig } from 'axios';
 import request from '../utils/request';
Modified +1 -1
diff --git a/core/stores/user.ts b/core/stores/user.ts
index 472b067..6301e8d 100644
--- a/core/stores/user.ts
+++ b/core/stores/user.ts
@@ -1,5 +1,5 @@
 import { defineStore } from 'pinia';
-import { getConfig } from '@core/configure';
+import { getConfig } from 'cube-front/core/configure';
 import { type AxiosRequestConfig, type AxiosResponse } from 'axios';
 import request from '../utils/request';
 import { removeAccessToken } from '../utils/token';
Modified +1 -1
diff --git a/core/utils/api-helpers.ts b/core/utils/api-helpers.ts
index 2d1dc92..b99b032 100644
--- a/core/utils/api-helpers.ts
+++ b/core/utils/api-helpers.ts
@@ -3,7 +3,7 @@
  * 提供统一的数据处理方法,简化业务代码
  */
 
-import type { ListResponse, ApiPageInfo } from '@core/types/common';
+import type { ListResponse, ApiPageInfo } from 'cube-front/core/types/common';
 
 /**
  * 处理列表数据响应 - 兼容request.ts拦截器已处理的数据格式
Modified +1 -1
diff --git a/core/utils/menuHelpers.ts b/core/utils/menuHelpers.ts
index c0b9059..d81c358 100644
--- a/core/utils/menuHelpers.ts
+++ b/core/utils/menuHelpers.ts
@@ -1,4 +1,4 @@
-import { type TreeMenuItem } from '@core/stores/menu';
+import { type TreeMenuItem } from 'cube-front/core/stores/menu';
 
 /**
  * 判断 childMenu 的祖先是否是parentMenu
Modified +3 -3
diff --git a/core/utils/menuRoutes.ts b/core/utils/menuRoutes.ts
index 8eb57f2..c365e28 100644
--- a/core/utils/menuRoutes.ts
+++ b/core/utils/menuRoutes.ts
@@ -1,5 +1,5 @@
 import type { Router } from 'vue-router';
-import type { FlatMenuItem } from '@core/stores/menu';
+import type { FlatMenuItem } from 'cube-front/core/stores/menu';
 
 /**
  * 根据路径约定推断页面组件。
@@ -11,9 +11,9 @@ import type { FlatMenuItem } from '@core/stores/menu';
  */
 function resolvePageComponent(path: string) {
   if (/\/(create|new|add)$/.test(path) || /\/(edit|update)(\/|$)/.test(path)) {
-    return () => import('@core/views/form.vue');
+    return () => import('cube-front/core/views/form.vue');
   }
-  return () => import('@core/views/index.vue');
+  return () => import('cube-front/core/views/index.vue');
 }
 
 /**
Modified +2 -2
diff --git a/core/utils/pageSections.ts b/core/utils/pageSections.ts
index e356f1e..d19b879 100644
--- a/core/utils/pageSections.ts
+++ b/core/utils/pageSections.ts
@@ -1,6 +1,6 @@
 import type { App } from 'vue';
 import { defineAsyncComponent } from 'vue';
-import { PageSectionRegistryKey, SectionKeyMap } from '@core/composables/useSections';
+import { PageSectionRegistryKey, SectionKeyMap } from 'cube-front/core/composables/useSections';
 import type { Component } from 'vue';
 
 type GlobLoader = () => Promise<{ default: unknown }>;
@@ -32,7 +32,7 @@ function parseGlobKey(key: string): { routePath: string; sectionName: string } |
  * 在应用启动时(initApp 回调中)调用,一次性注册所有页面的覆盖组件:
  *
  * ```typescript
- * import { registerPageSections } from '@core/utils/pageSections';
+ * import { registerPageSections } from 'cube-front/core/utils/pageSections';
  * const viewModules = import.meta.glob('./views/**\/*.vue');
  * initApp((app) => {
  *   registerPageSections(app, viewModules);
Modified +0 -9
diff --git a/tsconfig.app.json b/tsconfig.app.json
index 6924686..a4a4bee 100644
--- a/tsconfig.app.json
+++ b/tsconfig.app.json
@@ -24,15 +24,6 @@
       "@/*": [
         "./src/*"
       ],
-      "@core/*": [
-        "./core/*"
-      ],
-      "cube-front/core": [
-        "./core"
-      ],
-      "cube-front/core/*": [
-        "./core/*"
-      ],
       "cube-front": [
         "./"
       ],
Modified +0 -2
diff --git a/vite.config.ts b/vite.config.ts
index 9486b35..cfab13a 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -76,8 +76,6 @@ export default defineConfig(({ command, mode }) => {
       resolve: {
         alias: {
           '@': fileURLToPath(new URL('./src', import.meta.url)),
-          '@core': fileURLToPath(new URL('./core', import.meta.url)),
-          // 'cube-front/core': fileURLToPath(new URL('./core', import.meta.url)),
           'cube-front': join(__dirname, './'),
         },
       },