diff --git a/.env.development b/.env.development index 1270be4..548b16b 100644 --- a/.env.development +++ b/.env.development @@ -4,6 +4,8 @@ VUE_APP_TITLE = 可视化管控平台 # 开发环境配置 ENV = 'development' +VUE_APP_ENV = 'development' + # 博诺思管理系统/开发环境 VUE_APP_BASE_API = '/dev-api' diff --git a/.env.production b/.env.production index 9f37c9b..e4f935b 100644 --- a/.env.production +++ b/.env.production @@ -4,5 +4,7 @@ VUE_APP_TITLE = 可视化管控平台 # 生产环境配置 ENV = 'production' +VUE_APP_ENV = 'production' + # 博诺思管理系统/生产环境 VUE_APP_BASE_API = '/nxdt-api' diff --git a/.env.testing b/.env.testing index 52745d8..4f71557 100644 --- a/.env.testing +++ b/.env.testing @@ -6,5 +6,7 @@ NODE_ENV = production # 生产环境配置 ENV = 'testing' +VUE_APP_ENV = 'testing' + # 博诺思管理系统/生产环境 VUE_APP_BASE_API = '/nxdt-api' diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 570ec9a..573836c 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -214,7 +214,7 @@ export default { }) }, openPage(type) { - if (type === 1) window.open(process.env.ENV === 'testing' ? '/nxdt/screen' : '/screen', '_blank') + if (type === 1) window.open(process.env.VUE_APP_ENV === 'testing' ? '/nxdt/screen' : '/screen', '_blank') if (type === 2) this.$router.push({ path: '/notice/noticeAnnouncement' }) if (type === 3) this.$router.push({ path: '/myToDoList/myToDoList' }) if (type === 4) this.$router.push({ path: '/takePhoto/takePhoto' }) @@ -231,7 +231,7 @@ export default { .then(() => { this.$store.dispatch('LogOut').then(() => { // location.href = '/index' - location.href = process.env.ENV === 'testing' ? '/nxdt/index' : 'index' + location.href = process.env.VUE_APP_ENV === 'testing' ? '/nxdt/index' : 'index' }) }) .catch(() => {}) diff --git a/src/router/index.js b/src/router/index.js index bfbdf19..9acb2cb 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -787,7 +787,7 @@ const createRouter = () => mode: 'history', // 去掉url中的# scrollBehavior: () => ({ y: 0 }), routes: constantRoutes, - base: process.env.ENV === 'testing' ? '/nxdt' : '', + base: process.env.VUE_APP_ENV === 'testing' ? '/nxdt' : '', }) const router = createRouter() diff --git a/src/views/login.vue b/src/views/login.vue index 4baeed9..2d250b6 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -112,14 +112,19 @@ export default { trigger: 'blur', }, ], - code: [{ required: true, trigger: "change", message: "请输入验证码" }, - { validator: (rule, value, callback) => { + code: [ + { required: true, trigger: 'change', message: '请输入验证码' }, + { + validator: (rule, value, callback) => { if (/\s/.test(value)) { - callback(new Error("验证码中不允许包含空格")); + callback(new Error('验证码中不允许包含空格')) } else { - callback(); + callback() } - }, trigger: "blur" }] + }, + trigger: 'blur', + }, + ], }, loading: false, // 验证码开关 diff --git a/vue.config.js b/vue.config.js index 81bc674..41c9d26 100644 --- a/vue.config.js +++ b/vue.config.js @@ -38,9 +38,9 @@ module.exports = { // target: `http://localhost:18080`, // target: 'http://192.168.0.176:18080', // target: 'http://192.168.0.58:19090', // 杰 - //target: 'http://192.168.0.38:18080', // 测试环境 + target: 'http://192.168.0.38:18080', // 测试环境 // target: 'http://218.21.27.6:1999/prod-api', // 生产环境 - target: 'http://192.168.0.14:38080', // 郝志权 + // target: 'http://192.168.0.14:38080', // 郝志权 // target: 'http://192.168.2.122:18080', // 梁超 changeOrigin: true, pathRewrite: {