From 3cda5411807ca01c0667756cb06697412433c9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= Date: Thu, 9 Jan 2020 17:20:09 +0800 Subject: [PATCH] update --- mock/article.js | 10 +++++----- mock/index.js | 2 +- mock/remote-search.js | 4 ++-- mock/role/index.js | 10 +++++----- mock/user.js | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/mock/article.js b/mock/article.js index 7980ac1b..50218ae4 100644 --- a/mock/article.js +++ b/mock/article.js @@ -29,7 +29,7 @@ for (let i = 0; i < count; i++) { export default [ { - url: '/article/list', + url: '/vue-element-admin/article/list', type: 'get', response: config => { const { importance, type, title, page = 1, limit = 20, sort } = config.query @@ -58,7 +58,7 @@ export default [ }, { - url: '/article/detail', + url: '/vue-element-admin/article/detail', type: 'get', response: config => { const { id } = config.query @@ -74,7 +74,7 @@ export default [ }, { - url: '/article/pv', + url: '/vue-element-admin/article/pv', type: 'get', response: _ => { return { @@ -92,7 +92,7 @@ export default [ }, { - url: '/article/create', + url: '/vue-element-admin/article/create', type: 'post', response: _ => { return { @@ -103,7 +103,7 @@ export default [ }, { - url: '/article/update', + url: '/vue-element-admin/article/update', type: 'post', response: _ => { return { diff --git a/mock/index.js b/mock/index.js index cedb357b..217ee3d5 100644 --- a/mock/index.js +++ b/mock/index.js @@ -57,7 +57,7 @@ export function mockXHR() { // for mock server const responseFake = (url, type, respond) => { return { - url: new RegExp(`${process.env.VUE_APP_BASE_API}/vue-element-admin${url}`), + url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`), type: type || 'get', response(req, res) { console.log('request invoke:' + req.path) diff --git a/mock/remote-search.js b/mock/remote-search.js index bb33c2f4..60809cb8 100644 --- a/mock/remote-search.js +++ b/mock/remote-search.js @@ -13,7 +13,7 @@ NameList.push({ name: 'mock-Pan' }) export default [ // username search { - url: '/search/user', + url: '/vue-element-admin/search/user', type: 'get', response: config => { const { name } = config.query @@ -30,7 +30,7 @@ export default [ // transaction list { - url: '/transaction/list', + url: '/vue-element-admin/transaction/list', type: 'get', response: _ => { return { diff --git a/mock/role/index.js b/mock/role/index.js index 39148076..d957493b 100644 --- a/mock/role/index.js +++ b/mock/role/index.js @@ -38,7 +38,7 @@ const roles = [ export default [ // mock get all routes form server { - url: '/routes', + url: '/vue-element-admin/routes', type: 'get', response: _ => { return { @@ -50,7 +50,7 @@ export default [ // mock get all roles form server { - url: '/roles', + url: '/vue-element-admin/roles', type: 'get', response: _ => { return { @@ -62,7 +62,7 @@ export default [ // add role { - url: '/role', + url: '/vue-element-admin/role', type: 'post', response: { code: 20000, @@ -74,7 +74,7 @@ export default [ // update role { - url: '/role/[A-Za-z0-9]', + url: '/vue-element-admin/role/[A-Za-z0-9]', type: 'put', response: { code: 20000, @@ -86,7 +86,7 @@ export default [ // delete role { - url: '/role/[A-Za-z0-9]', + url: '/vue-element-admin/role/[A-Za-z0-9]', type: 'delete', response: { code: 20000, diff --git a/mock/user.js b/mock/user.js index 43f93a04..859bd6f3 100644 --- a/mock/user.js +++ b/mock/user.js @@ -26,7 +26,7 @@ const users = { export default [ // user login { - url: '/user/login', + url: '/vue-element-admin/user/login', type: 'post', response: config => { const { username } = config.body @@ -49,7 +49,7 @@ export default [ // get user info { - url: '/user/info\.*', + url: '/vue-element-admin/user/info\.*', type: 'get', response: config => { const { token } = config.query @@ -72,7 +72,7 @@ export default [ // user logout { - url: '/user/logout', + url: '/vue-element-admin/user/logout', type: 'post', response: _ => { return {