From ad1bc2e7be8ae5b130dc90b4192eba994d34fbc3 Mon Sep 17 00:00:00 2001 From: wen Date: Wed, 26 Oct 2022 19:42:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=E7=94=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/views/login/index.vue | 46 +++++++++++++++++++-------------------- vue.config.js | 2 +- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.env.development b/.env.development index de583d0..128fbf0 100644 --- a/.env.development +++ b/.env.development @@ -2,4 +2,4 @@ ENV = 'development' # base api -VUE_APP_BASE_API = '/dev-api' +VUE_APP_BASE_API = '/api' diff --git a/src/views/login/index.vue b/src/views/login/index.vue index a477551..eab9cd3 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -223,29 +223,29 @@ export default { if (valid) { this.loading = true let thiss = this; - // axios.post('/api/mkdir', { - // firstName: 'Fred', - // lastName: 'Flintstone' - // }) - // .then(function (response) { - // console.log(thiss.$router) - // thiss.$router.push({ path: '/usermange'}) - // console.log(response + 'ffef'); - // }) - // .catch(function (error) { - // console.log(error); - // }); - // this.$message({ - // showClose: true, - // message: '错了哦,这是一条错误消息', - // type: 'error' - // }); - this.$store.dispatch('user/login', this.loginForm).then(() => { - this.$router.push({ path: this.redirect || '/' }) - this.loading = false - }).catch(() => { - this.loading = false - }) + axios.post('/api/mkdir', { + firstName: 'Fred', + lastName: 'Flintstone' + }) + .then(function (response) { + console.log(thiss.$router) + thiss.$router.push({ path: '/usermange'}) + console.log(response + 'ffef'); + }) + .catch(function (error) { + console.log(error); + }); + this.$message({ + showClose: true, + message: '错了哦,这是一条错误消息', + type: 'error' + }); + // this.$store.dispatch('user/login', this.loginForm).then(() => { + // this.$router.push({ path: this.redirect || '/' }) + // this.loading = false + // }).catch(() => { + // this.loading = false + // }) } else { console.log('error submit!!') diff --git a/vue.config.js b/vue.config.js index 9e9afa9..d47a5e9 100644 --- a/vue.config.js +++ b/vue.config.js @@ -41,7 +41,7 @@ module.exports = { //before: require('./mock/mock-server.js'), proxy: { '/api': { - target: 'http://192.168.1.8:1080',// 你要请求的后端接口ip+port + target: 'http://192.168.0.100:1080',// 你要请求的后端接口ip+port changeOrigin: true,// 允许跨域,在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题 ws: true,// 开启webSocket pathRewrite: {