| | |
| | | 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({ |