Commit e77faf9e by hank

优化流程

parent 15b01415
......@@ -2,5 +2,5 @@
ENV = 'production'
# base api
VUE_APP_BASE_API = '/prod-api'
VUE_APP_BASE_API = 'https://manager.bdideal.com'
......@@ -26,7 +26,7 @@ const users = {
export default [
// user login
{
url: '/user/login',
url: '/publics/login',
type: 'post',
response: config => {
const { username } = config.body
......@@ -49,7 +49,7 @@ export default [
// get user info
{
url: '/user/info\.*',
url: '/publics/get/info\.*',
type: 'get',
response: config => {
const { token } = config.query
......@@ -72,7 +72,7 @@ export default [
// user logout
{
url: '/user/logout',
url: '/publics/logout',
type: 'post',
response: _ => {
return {
......
import request from '@/utils/requestMock.js'
import request from '@/utils/request'
export function login(data) {
return request({
url: '/user/login',
url: '/publics/login',
method: 'post',
data
})
......@@ -10,7 +10,7 @@ export function login(data) {
export function getInfo(token) {
return request({
url: '/user/info',
url: '/publics/get/info',
method: 'get',
params: { token }
})
......@@ -18,7 +18,7 @@ export function getInfo(token) {
export function logout() {
return request({
url: '/user/logout',
url: '/publics/logout',
method: 'post'
})
}
......@@ -5,7 +5,7 @@ import { getToken } from '@/utils/auth'
// create an axios instance
const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API_MOCK, // url = base url + request url
baseURL: process.env.VUE_APP_BASE_API_MOCK || '', // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests
timeout: 10000 // request timeout
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment