no message
Showing
2 changed files
with
10 additions
and
1 deletions
| ... | @@ -181,6 +181,7 @@ function getNowOpenId() { | ... | @@ -181,6 +181,7 @@ function getNowOpenId() { |
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | function h5Login(userName) { | 183 | function h5Login(userName) { |
| 184 | uni.showLoading({}) | ||
| 184 | return request({ | 185 | return request({ |
| 185 | url: `/h5Login`, | 186 | url: `/h5Login`, |
| 186 | method: 'post', | 187 | method: 'post', |
| ... | @@ -189,11 +190,13 @@ function h5Login(userName) { | ... | @@ -189,11 +190,13 @@ function h5Login(userName) { |
| 189 | } | 190 | } |
| 190 | }).then((res) => { | 191 | }).then((res) => { |
| 191 | uni.setStorageSync('token', res.data.token); | 192 | uni.setStorageSync('token', res.data.token); |
| 193 | }).finally(() => { | ||
| 194 | uni.hideLoading() | ||
| 192 | }) | 195 | }) |
| 193 | } | 196 | } |
| 194 | 197 | ||
| 195 | function showLogin(callback) { | 198 | function showLogin(callback) { |
| 196 | uni.removeStorageSync("token") | 199 | uni.removeStorageSync("userName") |
| 197 | 200 | ||
| 198 | uni.showModal({ | 201 | uni.showModal({ |
| 199 | title: '请输入身份证,进行身份验证', | 202 | title: '请输入身份证,进行身份验证', | ... | ... |
| ... | @@ -62,7 +62,10 @@ let request = function(req) { | ... | @@ -62,7 +62,10 @@ let request = function(req) { |
| 62 | const baseUrl = config.localPort + '/jsintszxd/request' | 62 | const baseUrl = config.localPort + '/jsintszxd/request' |
| 63 | 63 | ||
| 64 | if (req.method === 'POST') { | 64 | if (req.method === 'POST') { |
| 65 | if (token) { | ||
| 65 | req.params.userNo = token | 66 | req.params.userNo = token |
| 67 | } | ||
| 68 | |||
| 66 | url = baseUrl | 69 | url = baseUrl |
| 67 | data = { | 70 | data = { |
| 68 | appSecretId: config.appSecretId, | 71 | appSecretId: config.appSecretId, |
| ... | @@ -90,7 +93,10 @@ let request = function(req) { | ... | @@ -90,7 +93,10 @@ let request = function(req) { |
| 90 | } | 93 | } |
| 91 | } else { | 94 | } else { |
| 92 | if (req.method === 'POST') { | 95 | if (req.method === 'POST') { |
| 96 | if (token) { | ||
| 93 | req.params.userNo = token | 97 | req.params.userNo = token |
| 98 | } | ||
| 99 | |||
| 94 | data = { | 100 | data = { |
| 95 | jsonBody: JSON.stringify(req.params) | 101 | jsonBody: JSON.stringify(req.params) |
| 96 | } | 102 | } | ... | ... |
-
Please register or sign in to post a comment