rewrite axios && mock data
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { fetch } from 'utils/fetch';
|
||||
import fetch from 'utils/fetch';
|
||||
|
||||
export function getList() {
|
||||
return fetch({
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { fetch } from 'utils/fetch';
|
||||
import fetch from 'utils/fetch';
|
||||
|
||||
export function fetchList(query) {
|
||||
return fetch({
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { fetch } from 'utils/fetch';
|
||||
import fetch from 'utils/fetch';
|
||||
|
||||
export function loginByEmail(email, password) {
|
||||
const data = {
|
||||
@@ -19,7 +19,6 @@ export function logout() {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function getInfo(token) {
|
||||
return fetch({
|
||||
url: '/user/info',
|
||||
|
@@ -1,28 +1,28 @@
|
||||
import fetch, { tpFetch } from 'utils/fetch';
|
||||
// import fetch, { tpFetch } from 'utils/fetch';
|
||||
|
||||
export function getToken() {
|
||||
return fetch({
|
||||
url: '/qiniu/upload/token',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
export function upload(data) {
|
||||
return tpFetch({
|
||||
url: 'https://upload.qbox.me',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
// export function getToken() {
|
||||
// return fetch({
|
||||
// url: '/qiniu/upload/token',
|
||||
// method: 'get'
|
||||
// });
|
||||
// }
|
||||
// export function upload(data) {
|
||||
// return tpFetch({
|
||||
// url: 'https://upload.qbox.me',
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
/* 外部uri转七牛uri*/
|
||||
export function netUpload(token, net_url) {
|
||||
const imgData = {
|
||||
net_url
|
||||
};
|
||||
return fetch({
|
||||
url: '/qiniu/upload/net/async',
|
||||
method: 'post',
|
||||
data: imgData
|
||||
});
|
||||
}
|
||||
// /* 外部uri转七牛uri*/
|
||||
// export function netUpload(token, net_url) {
|
||||
// const imgData = {
|
||||
// net_url
|
||||
// };
|
||||
// return fetch({
|
||||
// url: '/qiniu/upload/net/async',
|
||||
// method: 'post',
|
||||
// data: imgData
|
||||
// });
|
||||
// }
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { fetch } from 'utils/fetch';
|
||||
import fetch from 'utils/fetch';
|
||||
|
||||
export function userSearch(name) {
|
||||
return fetch({
|
||||
|
Reference in New Issue
Block a user