From 92a1ca8cd6105a993f8fdb4a082d120e8ceda88a Mon Sep 17 00:00:00 2001 From: chenwenlong Date: Tue, 20 Nov 2018 08:34:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=88=E4=BA=8E=E5=8F=AF=E4=BB=A5=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/dev.env.js | 2 +- config/index.js | 5 +++-- src/api/login.js | 12 ++++++------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/config/dev.env.js b/config/dev.env.js index eef0d651..9430afb7 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -1,5 +1,5 @@ module.exports = { NODE_ENV: '"development"', ENV_CONFIG: '"dev"', - BASE_API: '"http://localhost:3000/api"' + BASE_API: '"http://localhost:3000"' } diff --git a/config/index.js b/config/index.js index 34027f45..0b7e21f2 100644 --- a/config/index.js +++ b/config/index.js @@ -10,11 +10,12 @@ module.exports = { assetsSubDirectory: 'static', assetsPublicPath: '/', proxyTable: { - '/api':{ + '/public':{ target: 'http://chenwenlong.site:8088', // 接口域名 + // target: 'http://localhost', // 接口域名 changeOrigin: true, //是否跨域 pathRewrite: { - '^/api': '' //需要rewrite重写的, + '^/public': '' //需要rewrite重写的, } } }, diff --git a/src/api/login.js b/src/api/login.js index c22e6f82..4bc3dd2c 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -1,14 +1,14 @@ import request from '@/utils/request' export function loginByUsername(username, password) { - const data = { - username, - password - } return request({ - url: 'user/login', + url: 'public/user/login', method: 'post', - data + params: { + username: username, + password: password + } + // params: data, }) }