refactor:change name=> fetch.js to request.js

This commit is contained in:
Pan 2017-11-07 13:55:57 +08:00
parent 5eda0685ed
commit 61deec548c
6 changed files with 14 additions and 14 deletions

View file

@ -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 }

View file

@ -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 }

View file

@ -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'
})

View file

@ -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 }

View file

@ -105,7 +105,7 @@
<script>
/* eslint-disable */
import {effectRipple, data2blob} from './utils';
import fetch from 'utils/fetch';
import request from 'utils/request';
import langBag from './lang';
const mimes = {
'jpg': 'image/jpeg',
@ -672,7 +672,7 @@
that.loading = 1;
that.setStep(3);
that.$emit('crop-success', createImgUrl, field, ki);
fetch({
request({
url,
method: 'post',
data: fmData