先提交

This commit is contained in:
2023-05-15 23:45:11 +08:00
parent 0d04dedde1
commit bf9e6f4cb8
3 changed files with 37 additions and 13 deletions

View File

@@ -1,5 +1,7 @@
import qs from "query-string"
const ins = {
post: (url, body, config) => fetch(url, {...config, method: "POST", body}),
get: (url, config) => fetch(url, {...config, method: "GET"}),
post: (url, body, config) => fetch(qs.stringifyUrl({url, query: config.params}), {...config, method: "POST", body}),
get: (url, config) => fetch(qs.stringifyUrl({url, query: config.params}), {...config, method: "GET"}),
}
export default ins