diff --git a/src/api/article.js b/src/api/article.js index 2583f0d0..2243c66e 100644 --- a/src/api/article.js +++ b/src/api/article.js @@ -1,7 +1,7 @@ -import fetch from '@/utils/fetch' +import request from '@/utils/request' export function fetchList(query) { - return fetch({ + return request({ url: '/article/list', method: 'get', params: query @@ -9,14 +9,14 @@ export function fetchList(query) { } export function fetchArticle() { - return fetch({ + return request({ url: '/article/detail', method: 'get' }) } export function fetchPv(pv) { - return fetch({ + return request({ url: '/article/pv', method: 'get', params: { pv } diff --git a/src/api/login.js b/src/api/login.js index 16775960..a64935c3 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -1,11 +1,11 @@ -import fetch from '@/utils/fetch' +import request from '@/utils/request' export function loginByUsername(username, password) { const data = { username, password } - return fetch({ + return request({ url: '/login/login', method: 'post', data @@ -13,14 +13,14 @@ export function loginByUsername(username, password) { } export function logout() { - return fetch({ + return request({ url: '/login/logout', method: 'post' }) } export function getUserInfo(token) { - return fetch({ + return request({ url: '/user/info', method: 'get', params: { token } diff --git a/src/api/qiniu.js b/src/api/qiniu.js index a5facdc0..a0375844 100644 --- a/src/api/qiniu.js +++ b/src/api/qiniu.js @@ -1,7 +1,7 @@ -import fetch from '@/utils/fetch' +import request from '@/utils/request' export function getToken() { - return fetch({ + return request({ url: '/qiniu/upload/token', // 假地址 自行替换 method: 'get' }) diff --git a/src/api/remoteSearch.js b/src/api/remoteSearch.js index 01ca9109..f2792789 100644 --- a/src/api/remoteSearch.js +++ b/src/api/remoteSearch.js @@ -1,7 +1,7 @@ -import fetch from '@/utils/fetch' +import request from '@/utils/request' export function userSearch(name) { - return fetch({ + return request({ url: '/search/user', method: 'get', params: { name } diff --git a/src/components/ImageCropper/index.vue b/src/components/ImageCropper/index.vue index 1e5c28b2..3e09d0a9 100644 --- a/src/components/ImageCropper/index.vue +++ b/src/components/ImageCropper/index.vue @@ -105,7 +105,7 @@