|
|
@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
import { message } from "antd";
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* GET 请求
|
|
|
|
* GET 请求
|
|
|
|
* @param {string} url - 请求的 URL 地址
|
|
|
|
* @param {string} url - 请求的 URL 地址
|
|
|
@ -45,6 +47,7 @@ export function postRequest(url: string, data: object) {
|
|
|
|
body: JSON.stringify(data),
|
|
|
|
body: JSON.stringify(data),
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.then(response => {
|
|
|
|
.then(response => {
|
|
|
|
|
|
|
|
message.info('response',response)
|
|
|
|
if (!response.ok) { throw new Error('请求失败'); }
|
|
|
|
if (!response.ok) { throw new Error('请求失败'); }
|
|
|
|
return response.json();
|
|
|
|
return response.json();
|
|
|
|
})
|
|
|
|
})
|
|
|
|