Browse Source

发布测试环境

lifanagju_citu 5 tháng trước cách đây
mục cha
commit
92d37613f0
6 tập tin đã thay đổi với 50 bổ sung15 xóa
  1. 6 9
      .env.development
  2. 36 0
      .env.production
  3. 0 1
      components.d.ts
  4. 1 0
      package.json
  5. 5 5
      src/App.vue
  6. 2 0
      src/version.js

+ 6 - 9
.env.development

@@ -1,21 +1,18 @@
 NODE_ENV = 'development'
 
-# 版本号 v 0954
-VITE_VERSION = 'v24.11.22.1818'
-
 VITE_APP_TITLE = 门墩儿
 
 # 访问路径
-# VITE_ACCESS_BASE_URL = 'http://menduner.citupro.com:7878' # 发布测试环境 
-VITE_ACCESS_BASE_URL = 'https://www.menduner.com' # 发布生产环境 
+VITE_ACCESS_BASE_URL = 'http://menduner.citupro.com:7878' # 发布测试环境 
+# VITE_ACCESS_BASE_URL = 'https://www.menduner.com' # 发布生产环境 
 # 
 # 请求路径
-# VITE_BASE_URL = 'http://menduner.citupro.com:7878' # 发布测试环境 
-VITE_BASE_URL = 'https://www.menduner.com' # 发布生产环境 
+VITE_BASE_URL = 'http://menduner.citupro.com:7878' # 发布测试环境 
+# VITE_BASE_URL = 'https://www.menduner.com' # 发布生产环境 
 
 # 预览路径
-# VITE_PREVIEW_URL = 'http://192.168.3.91:8012' # 发布测试环境 
-VITE_PREVIEW_URL = 'https://kkfileview.menduner.com/' # 发布生产环境 
+VITE_PREVIEW_URL = 'http://192.168.3.91:8012' # 发布测试环境 
+# VITE_PREVIEW_URL = 'https://kkfileview.menduner.com/' # 发布生产环境 
 
 # 租户id
 VITE_TENANTCODE = '155'

+ 36 - 0
.env.production

@@ -0,0 +1,36 @@
+NODE_ENV = 'production'
+
+VITE_APP_TITLE = 门墩儿
+
+# 访问路径
+VITE_ACCESS_BASE_URL = 'https://www.menduner.com' # 发布生产环境 
+# 
+# 请求路径
+VITE_BASE_URL = 'https://www.menduner.com' # 发布生产环境 
+
+# 预览路径
+VITE_PREVIEW_URL = 'https://kkfileview.menduner.com/' # 发布生产环境 
+
+# 租户id
+VITE_TENANTCODE = '155'
+
+# 是否删除debugger
+VITE_DROP_DEBUGGER = false
+
+# 是否删除console.log
+VITE_DROP_CONSOLE = false
+
+# 是否sourcemap
+VITE_SOURCEMAP = true
+
+# 打包路径
+VITE_BASE_PATH = '/'
+
+# 输出路径
+VITE_OUT_DIR = 'dist'
+
+# 验证码的开关
+VITE_APP_CAPTCHA_ENABLE = false
+
+#租户开关
+VITE_APP_TENANT_ENABLE = true

+ 0 - 1
components.d.ts

@@ -17,7 +17,6 @@ declare module 'vue' {
     Combobox: typeof import('./src/components/FormUI/combobox/index.vue')['default']
     ComboboxZhAndEn: typeof import('./src/components/FormUI/comboboxZhAndEn/index.vue')['default']
     ConfirmPaymentDialog: typeof import('./src/components/pay/confirmPaymentDialog.vue')['default']
-    copy: typeof import('./src/components/CtForm/index copy.vue')['default']
     CtBtn: typeof import('./src/components/CtVuetify/CtBtn/index.vue')['default']
     CtDialog: typeof import('./src/components/CtDialog/index.vue')['default']
     CtForm: typeof import('./src/components/CtForm/index.vue')['default']

+ 1 - 0
package.json

@@ -4,6 +4,7 @@
   "scripts": {
     "dev": "vite --mode localDev --host 0.0.0.0",
     "build:dev": "vite build --mode development",
+    "build:pro": "vite build --mode production",
     "preview": "vite preview",
     "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore",
     "format": "prettier --write src/"

+ 5 - 5
src/App.vue

@@ -2,8 +2,8 @@
 import { RouterView } from 'vue-router'
 import { ref, onMounted, onUnmounted, nextTick } from 'vue'
 import Confirm from '@/plugins/confirm'
-// import { testVersionFun } from './utils/testVersionFun'
 import axios from 'axios'
+import { vue_version } from './version.js'
 
 const timer = ref(null)
 const setIntervalTime = 3000 // 接口调用间隔时间
@@ -15,7 +15,7 @@ function open () {
 onMounted(() => {
   nextTick(() => {
     // testVersionFun()
-    console.log('baseurl:', import.meta.env?.VITE_BASE_URL, 'version:', import.meta.env?.VITE_VERSION) // 打印
+    console.log('baseurl:', import.meta.env?.VITE_BASE_URL, 'vue_version:', vue_version) // 打印
     const process_ENV = process?.env?.NODE_ENV || ''
     if (process_ENV === 'production' || process_ENV === 'development') {
       open()
@@ -30,17 +30,17 @@ let ConfirmDone = false
 // 检查版本号
 const checkVersion = () => {
   const baseUrl = import.meta.env.VITE_BASE_URL || ''
-  const env_v = import.meta.env?.VITE_VERSION || ''
+  // const env_v = import.meta.env?.VITE_VERSION || ''
   const tenantId = import.meta.env?.VITE_TENANTCODE || ''
   const get_v = localStorage.getItem('RES_VERSION') || ''
   // 
-  if (!baseUrl || !env_v || !tenantId) return
+  if (!baseUrl || !vue_version || !tenantId) return
   axios.get(`${baseUrl}/app-api/menduner/system/get/version`, {
     headers: { ['tenant-id']: tenantId },
     cache: 'no-store' // 禁用缓存
   }).then((res) => {
     const res_v = res?.data?.data || ''
-    if (!res_v || res_v === env_v ) { // 接口报错和版本一致不弹Confirm
+    if (!res_v || res_v === vue_version ) { // 接口报错和版本一致不弹Confirm
       return
     }
     if (ConfirmDone) {

+ 2 - 0
src/version.js

@@ -0,0 +1,2 @@
+// 版本号
+export const vue_version = 'v24.11.22.1818'