From 9655b129a296b4a5cc5e39d60fc022cf5ac06879 Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期五, 04 八月 2023 13:43:55 +0800 Subject: [PATCH] 提交样式 --- common/request.js | 32 ++++++++++++++++++++++++-------- 1 files changed, 24 insertions(+), 8 deletions(-) diff --git a/common/request.js b/common/request.js index c243a1d..ae6e571 100644 --- a/common/request.js +++ b/common/request.js @@ -21,20 +21,36 @@ return new Promise((resolved, rejected) => { //成功 options.success = (res) => { - if (Number(res.data.code) == 100) { - resolved(res.data); - } else { + // if (Number(res.data.code) == 100) { + if(Number(res.data.code) == 405){ uni.showToast({ icon: 'none', - duration: 3000, + duration: 2000, position: 'top', title: `${res.data.msg}` }); - rejected(res.data.msg); - uni.navigateTo({ - url: '/pages/index/index' - }) + rejected(res.data.msg); + setTimeout(()=>{ + uni.navigateTo({ + url: '/pages/index/index' + }) + },2000) } + resolved(res.data); + // } else { + // uni.showToast({ + // icon: 'none', + // duration: 3000, + // position: 'top', + // title: `${res.data.msg}` + // }); + // rejected(res.data.msg); + // setTimeout(()=>{ + // uni.navigateTo({ + // url: '/pages/index/index' + // }) + // },2000) + // } } options.fail = (err) => { uni.showToast({ -- Gitblit v1.9.2