提交 a193907d 编写于 作者: fxy060608's avatar fxy060608

build app-plus-nvue

上级 180dc642
......@@ -5893,8 +5893,9 @@ var serviceContext = (function () {
}
if (__uniConfig.crossDomain === true) {
headers['User-Agent'] = USER_AGENT;
}
if (__uniConfig.networkTimeout.request) {
}
const timeout = __uniConfig.networkTimeout.request;
if (timeout) {
abortTimeout = setTimeout(() => {
aborted = true;
publishStateChange$1({
......@@ -5903,14 +5904,16 @@ var serviceContext = (function () {
statusCode: 0,
errMsg: 'timeout'
});
}, __uniConfig.networkTimeout.request);
}, timeout);
}
const options = {
method,
url,
// weex 官方文档有误,headers 类型实际 object,用 string 类型会无响应
headers,
type: 'text'
type: 'text',
// weex 官方文档未说明实际支持 timeout,单位:ms
timeout: timeout || 6e5
};
if (method !== 'GET') {
options.body = data;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册