Browse Source

只能取development

lifanagju_citu 6 months ago
parent
commit
d16ed5261b
3 changed files with 5 additions and 2 deletions
  1. 1 1
      .env.demo
  2. 1 1
      package.json
  3. 3 0
      src/store/modules/dict.ts

+ 1 - 1
.env.demo

@@ -1,5 +1,5 @@
 # 本地开发环境:本地启动所有项目(前端、后端、APP)时使用,不依赖外部环境
-NODE_ENV=demo
+NODE_ENV=development
 
 VITE_DEV=true
 

+ 1 - 1
package.json

@@ -6,7 +6,7 @@
   "private": false,
   "scripts": {
     "i": "pnpm install",
-    "dev": "vite --mode local-dev",
+    "dev": "vite --mode dev",
     "dev-server": "vite --mode dev",
     "ts:check": "vue-tsc --noEmit",
     "build:demo": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode demo",

+ 3 - 0
src/store/modules/dict.ts

@@ -46,6 +46,9 @@ export const useDictStore = defineStore('dict', {
         this.isSetDict = true
       } else {
         const res = await getSimpleDictDataList()
+        if (!res) {
+          return
+        }
         // 设置数据
         const dictDataMap = new Map<string, any>()
         res.forEach((dictData: DictDataVO) => {