From 479fcb72638b775a25c79a01a4f30b30748601e0 Mon Sep 17 00:00:00 2001 From: wayn <1669738430@qq.com> Date: Wed, 23 Mar 2022 00:10:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B7=AF=E5=BE=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.production | 3 ++- src/views/auth/login.vue | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.env.development b/.env.development index 8f5856d..9094caa 100644 --- a/.env.development +++ b/.env.development @@ -3,7 +3,7 @@ ENV = 'development' # base api VUE_APP_BASE_API = '/dev-api' - +VUE_APP_BASE_PATH = '/mall' # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, # to control whether the babel-plugin-dynamic-import-node plugin is enabled. # It only does one thing by converting all import() to require(). diff --git a/.env.production b/.env.production index 723b0f3..de907a4 100644 --- a/.env.production +++ b/.env.production @@ -2,4 +2,5 @@ ENV = 'production' # base api -VUE_APP_BASE_API = '/mobile-api' \ No newline at end of file +VUE_APP_BASE_API = '/mobile-api' +VUE_APP_BASE_PATH = '/mall' \ No newline at end of file diff --git a/src/views/auth/login.vue b/src/views/auth/login.vue index fdd3c5c..7b0f49e 100644 --- a/src/views/auth/login.vue +++ b/src/views/auth/login.vue @@ -74,7 +74,7 @@ export default { watch: { $route: { handler(route) { - this.redirect = (route.query && route.query.redirect) || '/' + this.redirect = (route.query && route.query.redirect) || process.env.VUE_APP_BASE_PATH }, immediate: true } @@ -92,6 +92,7 @@ export default { // 提交 onSubmit() { this.loading = true + console.log(process.env.VUE_APP_BASE_PATH) this.$store .dispatch('user/login', this.form) .then(() => {