提交 1036d793 编写于 作者: D DCloud_UNI_BFC

feat: 调整promise 化代码

上级 baa0b11b
...@@ -179,6 +179,10 @@ uni.addInterceptor({ ...@@ -179,6 +179,10 @@ uni.addInterceptor({
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
res.then((res) => { res.then((res) => {
if (!res) {
resolve(res);
return;
}
if (res[0]) { if (res[0]) {
reject(res[0]); reject(res[0]);
} else { } else {
......
...@@ -341,6 +341,10 @@ uni.addInterceptor({ ...@@ -341,6 +341,10 @@ uni.addInterceptor({
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
res.then((res) => { res.then((res) => {
if (!res) {
resolve(res)
return;
}
if (res[0]) { if (res[0]) {
reject(res[0]); reject(res[0]);
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册