Skip to content

Commit

Permalink
refine
Browse files Browse the repository at this point in the history
  • Loading branch information
PanJiaChen committed Jan 9, 2020
1 parent 3f38cde commit b89a052
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion mock/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}${url}`),
url: new RegExp(`${process.env.VUE_APP_BASE_API}/vue-element-admin${url}`),
type: type || 'get',
response(req, res) {
console.log('request invoke:' + req.path)
Expand Down
10 changes: 5 additions & 5 deletions src/api/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@ import request from '@/utils/request'

export function fetchList(query) {
return request({
url: '/article/list',
url: '/vue-element-admin/article/list',
method: 'get',
params: query
})
}

export function fetchArticle(id) {
return request({
url: '/article/detail',
url: '/vue-element-admin/article/detail',
method: 'get',
params: { id }
})
}

export function fetchPv(pv) {
return request({
url: '/article/pv',
url: '/vue-element-admin/article/pv',
method: 'get',
params: { pv }
})
}

export function createArticle(data) {
return request({
url: '/article/create',
url: '/vue-element-admin/article/create',
method: 'post',
data
})
}

export function updateArticle(data) {
return request({
url: '/article/update',
url: '/vue-element-admin/article/update',
method: 'post',
data
})
Expand Down
4 changes: 2 additions & 2 deletions src/api/remote-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import request from '@/utils/request'

export function searchUser(name) {
return request({
url: '/search/user',
url: '/vue-element-admin/search/user',
method: 'get',
params: { name }
})
}

export function transactionList(query) {
return request({
url: '/transaction/list',
url: '/vue-element-admin/transaction/list',
method: 'get',
params: query
})
Expand Down
10 changes: 5 additions & 5 deletions src/api/role.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@ import request from '@/utils/request'

export function getRoutes() {
return request({
url: '/routes',
url: '/vue-element-admin/routes',
method: 'get'
})
}

export function getRoles() {
return request({
url: '/roles',
url: '/vue-element-admin/roles',
method: 'get'
})
}

export function addRole(data) {
return request({
url: '/role',
url: '/vue-element-admin/role',
method: 'post',
data
})
}

export function updateRole(id, data) {
return request({
url: `/role/${id}`,
url: `/vue-element-admin/role/${id}`,
method: 'put',
data
})
}

export function deleteRole(id) {
return request({
url: `/role/${id}`,
url: `/vue-element-admin/role/${id}`,
method: 'delete'
})
}
6 changes: 3 additions & 3 deletions src/api/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ import request from '@/utils/request'

export function login(data) {
return request({
url: '/user/login',
url: '/vue-element-admin/user/login',
method: 'post',
data
})
}

export function getInfo(token) {
return request({
url: '/user/info',
url: '/vue-element-admin/user/info',
method: 'get',
params: { token }
})
}

export function logout() {
return request({
url: '/user/logout',
url: '/vue-element-admin/user/logout',
method: 'post'
})
}

0 comments on commit b89a052

Please sign in to comment.