Forráskód Böngészése

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

Xiao_123 4 hónapja
szülő
commit
04b453d53a
4 módosított fájl, 10 hozzáadás és 7 törlés
  1. 1 1
      .env.demo
  2. 0 1
      components.d.ts
  3. 1 0
      package.json
  4. 8 5
      src/config/axios/service.js

+ 1 - 1
.env.demo

@@ -1,4 +1,4 @@
-NODE_ENV = 'development'
+NODE_ENV = 'production'
 
 VITE_APP_TITLE = 门墩儿
 

+ 0 - 1
components.d.ts

@@ -29,7 +29,6 @@ declare module 'vue' {
     CtTextField: typeof import('./src/components/CtVuetify/CtTextField/index.vue')['default']
     DatePicker: typeof import('./src/components/DatePicker/index.vue')['default']
     Echarts: typeof import('./src/components/Echarts/index.vue')['default']
-    ElCascader: typeof import('element-plus/es')['ElCascader']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
     Empty: typeof import('./src/components/Empty/index.vue')['default']
     File: typeof import('./src/components/Upload/file.vue')['default']

+ 1 - 0
package.json

@@ -3,6 +3,7 @@
   "version": "0.0.0",
   "scripts": {
     "dev": "vite --mode localDev --host 0.0.0.0",
+    "demo": "vite --mode demo --host 0.0.0.0",
     "build:dev": "vite build --mode production",
     "build:demo": "vite build --mode demo",
     "preview": "vite preview",

+ 8 - 5
src/config/axios/service.js

@@ -119,7 +119,9 @@ service.interceptors.request.use(
        * params: { data, params, raw }
        * content
        */
-      if (import.meta.env.VITE_USER_NODE_ENV === 'production' && systemInfo.beijingTimestamp === 0) {
+      const env = import.meta.env.VITE_USER_NODE_ENV
+      console.log(env)
+      if (env === 'production' && systemInfo.beijingTimestamp === 0) {
         const _timestamp = await getBeijingTimestamp()
         setBeijingTimestamp(_timestamp)
       }
@@ -130,7 +132,7 @@ service.interceptors.request.use(
         appId: 'web_client',
         AppSecret: 'fa0fc0b5098b974b',
         // timestamp: 1735282548997,
-        timestamp: import.meta.env.VITE_USER_NODE_ENV === 'production' ? systemInfo.beijingTimestamp : new Date().getTime(),
+        timestamp: env === 'production' ? systemInfo.beijingTimestamp : new Date().getTime(),
       })
       const content = {
         data: config.data,
@@ -274,14 +276,15 @@ service.interceptors.response.use(
     }
     const _index = errorData.findIndex(e => e.url === config.url && e.time === +config.headers.timestamp)
     if (_index > -1) {
-      const _spliceItem = errorData.splice(_index, 1)
-      const _item = _spliceItem[0]
- 
+      const _d = errorData.splice(_index, 1)
+      // const _item = JSON.parse(JSON.stringify(errorData[_index]))
+      const _item = _d[0]
       // 保存错误信息
       if (code === 400) {
         sendError({ content: JSON.stringify(_item.content), mark: _item.time + '' })
       }
     }
+    // errorData.splice(_index, 1)
     if (code !== 200) {
       Snackbar.error(msg)
       return Promise.reject(msg)