| | |
| | | |
| | | return new Promise(function(resolve, reject) { |
| | | |
| | | let token = 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE2MTc3LCJ0eXBlIjoxLCJleHAiOjE3NDE2NjExMDYsImNyZWF0ZWQiOjE3NDAzNjUxMDY1MTh9.XRkMgKjEhRo6_BQK5fEVQ_Pv5bM-xeT36s4ju4Oh1F7ZmkIQOJUrdDnefub13JO6rZs3GT6dKnHZgCSyyQpsjg' |
| | | let token = uni.getStorageSync('token') || |
| | | 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE4OTI0ODk0OTc5Nzk5NDA4NjUsInR5cGUiOjEsImV4cCI6MTc0MTY3MTI5OSwiY3JlYXRlZCI6MTc0MDM3NTI5OTQwNn0.39bIG5k-yClEWnUXvA63rjS631pj6fykU-J6vrC5u3HczL8NSwT_3pdVkj3hr4qikCrE7i9hmNkU_aLch1sw8A' |
| | | let header = { |
| | | 'content-type': type ? 'application/x-www-form-urlencoded;charset=UTF-8' : 'application/json', |
| | | 'Authorization': token, |
| | | 'Authorization': 'Bearer ' + token, |
| | | 'lang': uni.getStorageSync('locale') === 'zh-Hans' ? 'zh_CN' : 'zh-tw', |
| | | } |
| | | const requestTask = uni.request({ |
| | |
| | | showCancel: false, |
| | | success: function(res) { |
| | | if (res.confirm) { |
| | | if (routeStr == 'pages/login/index') { |
| | | uni.reLaunch({ |
| | | url: '/pages/login/index' |
| | | }) |
| | | return |
| | | } |
| | | uni.reLaunch({ |
| | | url: '/pages/login/index' |
| | | }) |
| | | // if (routeStr == 'pages/login/index') { |
| | | // uni.reLaunch({ |
| | | // url: '/pages/login/index' |
| | | // }) |
| | | // return |
| | | // } |
| | | // uni.reLaunch({ |
| | | // url: '/pages/login/index' |
| | | // }) |
| | | } |
| | | } |
| | | }); |