yangan
2025-03-28 b0e249aa5d69791a5d9b9bec64d4e8897b4bae69
api/index.js
@@ -1,4 +1,4 @@
import { fetch } from '@/api/request.js'
import { fetch ,fetchId} from '@/api/request.js'
const typeObj = {
   headerGET: { 'Content-type': 'application/x-www-from-urlencoded' },
@@ -33,7 +33,12 @@
   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)
}
// post请求
// urlType是指定拼接路径还是传json格式参数
export const reqPost = (url, params, urlType, opt = {}) => {