This commit is contained in:
花裤衩 2020-01-09 17:13:52 +08:00
parent 3f38cde71d
commit b89a0526a1
5 changed files with 16 additions and 16 deletions

View File

@ -57,7 +57,7 @@ export function mockXHR() {
// for mock server // for mock server
const responseFake = (url, type, respond) => { const responseFake = (url, type, respond) => {
return { 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', type: type || 'get',
response(req, res) { response(req, res) {
console.log('request invoke:' + req.path) console.log('request invoke:' + req.path)

View File

@ -2,7 +2,7 @@ import request from '@/utils/request'
export function fetchList(query) { export function fetchList(query) {
return request({ return request({
url: '/article/list', url: '/vue-element-admin/article/list',
method: 'get', method: 'get',
params: query params: query
}) })
@ -10,7 +10,7 @@ export function fetchList(query) {
export function fetchArticle(id) { export function fetchArticle(id) {
return request({ return request({
url: '/article/detail', url: '/vue-element-admin/article/detail',
method: 'get', method: 'get',
params: { id } params: { id }
}) })
@ -18,7 +18,7 @@ export function fetchArticle(id) {
export function fetchPv(pv) { export function fetchPv(pv) {
return request({ return request({
url: '/article/pv', url: '/vue-element-admin/article/pv',
method: 'get', method: 'get',
params: { pv } params: { pv }
}) })
@ -26,7 +26,7 @@ export function fetchPv(pv) {
export function createArticle(data) { export function createArticle(data) {
return request({ return request({
url: '/article/create', url: '/vue-element-admin/article/create',
method: 'post', method: 'post',
data data
}) })
@ -34,7 +34,7 @@ export function createArticle(data) {
export function updateArticle(data) { export function updateArticle(data) {
return request({ return request({
url: '/article/update', url: '/vue-element-admin/article/update',
method: 'post', method: 'post',
data data
}) })

View File

@ -2,7 +2,7 @@ import request from '@/utils/request'
export function searchUser(name) { export function searchUser(name) {
return request({ return request({
url: '/search/user', url: '/vue-element-admin/search/user',
method: 'get', method: 'get',
params: { name } params: { name }
}) })
@ -10,7 +10,7 @@ export function searchUser(name) {
export function transactionList(query) { export function transactionList(query) {
return request({ return request({
url: '/transaction/list', url: '/vue-element-admin/transaction/list',
method: 'get', method: 'get',
params: query params: query
}) })

View File

@ -2,21 +2,21 @@ import request from '@/utils/request'
export function getRoutes() { export function getRoutes() {
return request({ return request({
url: '/routes', url: '/vue-element-admin/routes',
method: 'get' method: 'get'
}) })
} }
export function getRoles() { export function getRoles() {
return request({ return request({
url: '/roles', url: '/vue-element-admin/roles',
method: 'get' method: 'get'
}) })
} }
export function addRole(data) { export function addRole(data) {
return request({ return request({
url: '/role', url: '/vue-element-admin/role',
method: 'post', method: 'post',
data data
}) })
@ -24,7 +24,7 @@ export function addRole(data) {
export function updateRole(id, data) { export function updateRole(id, data) {
return request({ return request({
url: `/role/${id}`, url: `/vue-element-admin/role/${id}`,
method: 'put', method: 'put',
data data
}) })
@ -32,7 +32,7 @@ export function updateRole(id, data) {
export function deleteRole(id) { export function deleteRole(id) {
return request({ return request({
url: `/role/${id}`, url: `/vue-element-admin/role/${id}`,
method: 'delete' method: 'delete'
}) })
} }

View File

@ -2,7 +2,7 @@ import request from '@/utils/request'
export function login(data) { export function login(data) {
return request({ return request({
url: '/user/login', url: '/vue-element-admin/user/login',
method: 'post', method: 'post',
data data
}) })
@ -10,7 +10,7 @@ export function login(data) {
export function getInfo(token) { export function getInfo(token) {
return request({ return request({
url: '/user/info', url: '/vue-element-admin/user/info',
method: 'get', method: 'get',
params: { token } params: { token }
}) })
@ -18,7 +18,7 @@ export function getInfo(token) {
export function logout() { export function logout() {
return request({ return request({
url: '/user/logout', url: '/vue-element-admin/user/logout',
method: 'post' method: 'post'
}) })
} }