linlu 2 years ago
commit 98203fe1b6

@ -39,10 +39,13 @@ export function getRequest(url: string, params: object) {
* @returns {Promise} - Promise response error
*/
export function postRequest(url: string, data: object) {
return fetch('http://localhost:8088' + url, {
return fetch('http://127.0.0.1:8088' + url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'sec-ch-ua-mobile': '',
'User-Agent': '',
'sec-ch-ua': ''
},
body: JSON.stringify(data),
})
@ -154,6 +157,7 @@ export function uploadFile(url: string, formData: any) {
return fetch(url, {
method: 'POST',
body: formData,
mode:"cors"
})
.then(response => {
if (!response.ok) { throw new Error('上传失败'); }

Loading…
Cancel
Save