ahjung hace 2 años
padre
commit
56963a0b05
Se han modificado 9 ficheros con 1448 adiciones y 1378 borrados
  1. 0 3
      .env.development
  2. 0 3
      .env.production
  3. 7 0
      CHANGELOG.md
  4. 4 4
      mock/_util.ts
  5. 38 38
      package.json
  6. 1371 1329
      pnpm-lock.yaml
  7. 4 0
      tsconfig.json
  8. 17 1
      types/config.d.ts
  9. 7 0
      types/global.d.ts

+ 0 - 3
.env.development

@@ -7,9 +7,6 @@ VITE_PUBLIC_PATH = /
 # 是否开启mock
 VITE_USE_MOCK = true
 
-# 网站前缀
-VITE_BASE_URL = /
-
 # 是否删除console
 VITE_DROP_CONSOLE = true
 

+ 0 - 3
.env.production

@@ -4,9 +4,6 @@ VITE_USE_MOCK = true
 # 网站根目录
 VITE_PUBLIC_PATH = /
 
-# 网站前缀
-VITE_BASE_URL = /
-
 # 是否删除console
 VITE_DROP_CONSOLE = true
 

+ 7 - 0
CHANGELOG.md

@@ -2,6 +2,13 @@
 
 ## Pending
 
+## 1.3.9 (2023-07-26)
+
+- 🐞 修复 `mock` 配置异常
+- 🐞 修复 `GlobConfig` 类型缺失
+- 💎 优化 `ImportMeta` 类型定义
+- `依赖升级`
+
 ## 1.3.8 (2023-06-12)
 
 - 🐞 修复 `修改密码异常`

+ 4 - 4
mock/_util.ts

@@ -1,9 +1,9 @@
 import Mock from 'mockjs';
 
-export function resultSuccess(result, { message = 'ok' } = {}) {
+export function resultSuccess(data, { message = 'ok' } = {}) {
   return Mock.mock({
     code: 200,
-    result,
+    data,
     message,
     type: 'success',
   });
@@ -28,10 +28,10 @@ export function resultPageSuccess<T = any>(
   };
 }
 
-export function resultError(message = 'Request failed', { code = -1, result = null } = {}) {
+export function resultError(message = 'Request failed', { code = -1, data = null } = {}) {
   return {
     code,
-    result,
+    data,
     message,
     type: 'error',
   };

+ 38 - 38
package.json

@@ -1,6 +1,6 @@
 {
   "name": "naive-admin-element-tenant",
-  "version": "1.3.8",
+  "version": "1.3.9",
   "author": {
     "name": "Ahjung",
     "email": "735878602@qq.com",
@@ -31,7 +31,7 @@
     "deploy": "gh-pages -d dist"
   },
   "dependencies": {
-    "@element-plus/icons-vue": "^2.0.9",
+    "@element-plus/icons-vue": "^2.1.0",
     "@vicons/antd": "^0.12.0",
     "@vicons/ionicons5": "^0.12.0",
     "@vueup/vue-quill": "1.0.0-beta.8",
@@ -40,76 +40,76 @@
     "@wangeditor/editor-for-vue": "^5.1.12",
     "axios": "^0.27.2",
     "blueimp-md5": "^2.19.0",
-    "cropperjs": "^1.5.12",
-    "dayjs": "^1.11.4",
-    "echarts": "^5.3.3",
-    "element-plus": "^2.3.6",
+    "cropperjs": "^1.5.13",
+    "dayjs": "^1.11.9",
+    "echarts": "^5.4.3",
+    "element-plus": "^2.3.8",
     "element-resize-detector": "^1.2.4",
     "lodash-es": "^4.17.21",
     "mockjs": "^1.1.0",
     "nprogress": "^0.2.0",
     "perfect-scrollbar": "^1.5.5",
-    "pinia": "^2.0.16",
+    "pinia": "^2.1.4",
     "print-js": "^1.6.0",
-    "qrcode": "^1.5.1",
-    "qs": "^6.11.0",
+    "qrcode": "^1.5.3",
+    "qs": "^6.11.2",
     "vue": "^3.3.4",
-    "vue-router": "^4.1.2",
-    "vue-types": "^4.1.1",
+    "vue-router": "^4.2.4",
+    "vue-types": "^4.2.1",
     "vuedraggable": "^4.1.0",
     "xlsx": "^0.18.5"
   },
   "devDependencies": {
-    "@commitlint/cli": "^17.0.3",
-    "@commitlint/config-conventional": "^17.0.3",
+    "@commitlint/cli": "^17.6.7",
+    "@commitlint/config-conventional": "^17.6.7",
     "@types/element-resize-detector": "^1.1.3",
     "@types/intro.js": "^3.0.2",
-    "@types/lodash-es": "^4.17.6",
+    "@types/lodash-es": "^4.17.8",
     "@types/node": "^17.0.45",
-    "@types/qrcode": "^1.4.2",
-    "@typescript-eslint/eslint-plugin": "^5.30.7",
-    "@typescript-eslint/parser": "^5.30.7",
-    "@vitejs/plugin-vue": "^2.3.3",
+    "@types/qrcode": "^1.5.1",
+    "@typescript-eslint/eslint-plugin": "^5.62.0",
+    "@typescript-eslint/parser": "^5.62.0",
+    "@vitejs/plugin-vue": "^2.3.4",
     "@vitejs/plugin-vue-jsx": "^1.3.10",
     "@vue/compiler-sfc": "^3.3.4",
-    "autoprefixer": "^10.4.7",
+    "autoprefixer": "^10.4.14",
     "colors": "^1.4.0",
-    "commitizen": "^4.2.5",
-    "core-js": "^3.23.5",
+    "commitizen": "^4.3.0",
+    "core-js": "^3.31.1",
     "cross-env": "^7.0.3",
-    "dotenv": "^16.0.1",
-    "eslint": "^8.20.0",
-    "eslint-config-prettier": "^8.5.0",
-    "eslint-define-config": "^1.5.1",
+    "dotenv": "^16.3.1",
+    "eslint": "^8.45.0",
+    "eslint-config-prettier": "^8.8.0",
+    "eslint-define-config": "^1.21.0",
     "eslint-plugin-prettier": "^4.2.1",
     "eslint-plugin-vue": "^8.7.1",
     "esno": "^0.16.3",
     "fs-extra": "^10.1.0",
     "gh-pages": "^4.0.0",
-    "husky": "^8.0.1",
-    "lint-staged": "^13.0.3",
+    "husky": "^8.0.3",
+    "lint-staged": "^13.2.3",
     "picocolors": "^1.0.0",
-    "postcss": "^8.4.14",
-    "prettier": "^2.7.1",
+    "postcss": "^8.4.27",
+    "prettier": "^2.8.8",
     "pretty-quick": "^3.1.3",
     "rimraf": "^3.0.2",
-    "rollup-plugin-visualizer": "^5.8.3",
-    "sass": "^1.53.0",
-    "stylelint": "^14.9.1",
-    "stylelint-config-prettier": "^9.0.3",
+    "rollup-plugin-visualizer": "^5.9.2",
+    "sass": "^1.64.1",
+    "stylelint": "^14.16.1",
+    "stylelint-config-prettier": "^9.0.5",
     "stylelint-config-standard": "^25.0.0",
     "stylelint-order": "^5.0.0",
-    "stylelint-scss": "^4.3.0",
-    "tailwindcss": "^3.3.2",
+    "stylelint-scss": "^4.7.0",
+    "tailwindcss": "^3.3.3",
     "ts-node": "^10.9.1",
-    "typescript": "^4.7.4",
+    "typescript": "^4.9.5",
     "vite": "^3.2.7",
     "vite-plugin-compression": "^0.5.1",
     "vite-plugin-html": "^3.2.0",
-    "vite-plugin-mock": "^2.9.6",
+    "vite-plugin-mock": "^2.9.8",
     "vite-plugin-style-import": "^2.0.0",
     "vite-plugin-vue-setup-extend": "^0.4.0",
-    "vue-eslint-parser": "^9.0.3",
+    "vue-eslint-parser": "^9.3.1",
     "vue-tsc": "^0.35.2"
   },
   "lint-staged": {

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1371 - 1329
pnpm-lock.yaml


+ 4 - 0
tsconfig.json

@@ -43,6 +43,10 @@
     "src/**/*.ts",
     "src/**/*.d.ts",
     "src/**/*.tsx",
+    "src/**/*.svg",
+    "src/**/*.png",
+    "src/**/*.jpg",
+    "src/**/*.gif",
     "src/**/*.vue",
     "types/**/*.d.ts",
     "types/**/*.ts",

+ 17 - 1
types/config.d.ts

@@ -63,7 +63,7 @@ export interface GlobEnvConfig {
   VITE_GLOB_API_URL: string;
   // 接口前缀
   VITE_GLOB_API_URL_PREFIX?: string;
-  // Project abbreviation
+  // 项目简称
   VITE_GLOB_APP_SHORT_NAME: string;
   // 图片上传地址
   VITE_GLOB_UPLOAD_URL?: string;
@@ -72,3 +72,19 @@ export interface GlobEnvConfig {
   //生产环境开启mock
   VITE_GLOB_PROD_MOCK: boolean;
 }
+export interface GlobConfig {
+  // 标题
+  title: string;
+  // 接口地址
+  apiUrl: string;
+  // 图片上传地址
+  uploadUrl?: string;
+  // api 接口前缀
+  urlPrefix?: string;
+  // 项目简称
+  shortName: string;
+  // 生产环境开启 mock
+  prodMock: boolean;
+  // 图片访问地址
+  imgUrl: string | undefined;
+}

+ 7 - 0
types/global.d.ts

@@ -22,6 +22,13 @@ declare global {
   //   __APP__: App<Element>;
   // }
 
+  // 此处 重新定义 ImportMeta 避免 ts 类型报错
+  // 目前框架只用到 env 和 glob
+  interface ImportMeta {
+    env: Record<string, string>;
+    glob: Record<function>;
+  }
+
   // vue
   declare type PropType<T> = VuePropType<T>;
   declare type VueNode = VNodeChild | JSX.Element;