| | |
| | | import { fetch } from '@/api/request.js' |
| | | import { fetch,fetchId } from '@/api/request.js' |
| | | |
| | | const typeObj = { |
| | | headerGET: { 'Content-type': 'application/x-www-from-urlencoded' }, |
| | |
| | | opt.data = params |
| | | return fetch(url, opt) |
| | | } |
| | | export const reqGetId = (url, params, opt = {}) => { |
| | | opt.header = typeObj['headerGET'] |
| | | opt.method = 'GET' |
| | | opt.data = params |
| | | return fetchId(url, opt) |
| | | } |
| | | |
| | | // urlParam是拼接路径的参数 |
| | | export const reqGet2 = (url, params, opt = {}) => { |
| | | // opt.header = typeObj['headerGET'] |
| | | // opt.method = 'GET' |
| | | // let newUrl = `${url}/${params}` |
| | | // return fetch(newUrl, opt) |
| | | } |
| | | |
| | | // post请求 |
| | | // urlType是指定拼接路径还是传json格式参数 |