12345678910111213141516171819202122 |
- import request from './request'
- // 调用的时候第一个参数换成接口地址即可
- export function httpGet(url, params) {
- return new Promise((resolve, reject)=>{
- request.get(url, params).then((result)=>{
- resolve(result)
- }).catch(err=>{
- reject(err)
- });
- });
- }
- export function httpPost(url, params) {
- return new Promise((resolve, reject)=>{
- request.post(url, params).then((result)=>{
- resolve(result)
- }).catch(err=>{
- reject(err)
- });
- });
- }
|