feat: complate deploy feature

This commit is contained in:
2020-05-08 00:50:30 +08:00
parent 1931391cba
commit 7d63a57991
3 changed files with 28 additions and 12 deletions

View File

@ -27,7 +27,7 @@ function request(config: RequestConfig) {
for (const header in config.headers) {
xhr.setRequestHeader(header, config.headers[header]);
}
xhr.send(config.data);
xhr.send(typeof config.data === "string" ? config.data : JSON.stringify(config.data));
if ((xhr.getResponseHeader("Content-Type") + '').indexOf('application/json') != -1) {
xhr.responseType = "json"
}