Browse Source

无用修改

master
wen 2 years ago
parent
commit
ad1bc2e7be
  1. 2
      .env.development
  2. 46
      src/views/login/index.vue
  3. 2
      vue.config.js

2
.env.development

@ -2,4 +2,4 @@
ENV = 'development' ENV = 'development'
# base api # base api
VUE_APP_BASE_API = '/dev-api' VUE_APP_BASE_API = '/api'

46
src/views/login/index.vue

@ -223,29 +223,29 @@ export default {
if (valid) { if (valid) {
this.loading = true this.loading = true
let thiss = this; let thiss = this;
// axios.post('/api/mkdir', { axios.post('/api/mkdir', {
// firstName: 'Fred', firstName: 'Fred',
// lastName: 'Flintstone' lastName: 'Flintstone'
// }) })
// .then(function (response) { .then(function (response) {
// console.log(thiss.$router) console.log(thiss.$router)
// thiss.$router.push({ path: '/usermange'}) thiss.$router.push({ path: '/usermange'})
// console.log(response + 'ffef'); console.log(response + 'ffef');
// }) })
// .catch(function (error) { .catch(function (error) {
// console.log(error); console.log(error);
// }); });
// this.$message({ this.$message({
// showClose: true, showClose: true,
// message: '', message: '错了哦,这是一条错误消息',
// type: 'error' type: 'error'
// }); });
this.$store.dispatch('user/login', this.loginForm).then(() => { // this.$store.dispatch('user/login', this.loginForm).then(() => {
this.$router.push({ path: this.redirect || '/' }) // this.$router.push({ path: this.redirect || '/' })
this.loading = false // this.loading = false
}).catch(() => { // }).catch(() => {
this.loading = false // this.loading = false
}) // })
} else { } else {
console.log('error submit!!') console.log('error submit!!')

2
vue.config.js

@ -41,7 +41,7 @@ module.exports = {
//before: require('./mock/mock-server.js'), //before: require('./mock/mock-server.js'),
proxy: { proxy: {
'/api': { '/api': {
target: 'http://192.168.1.8:1080',// 你要请求的后端接口ip+port target: 'http://192.168.0.100:1080',// 你要请求的后端接口ip+port
changeOrigin: true,// 允许跨域,在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题 changeOrigin: true,// 允许跨域,在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题
ws: true,// 开启webSocket ws: true,// 开启webSocket
pathRewrite: { pathRewrite: {

Loading…
Cancel
Save