logout
Showing
3 changed files
with
14 additions
and
6 deletions
| ... | @@ -34,9 +34,15 @@ function h5LoginAuto() { | ... | @@ -34,9 +34,15 @@ function h5LoginAuto() { |
| 34 | } | 34 | } |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | 37 | function logout() { | |
| 38 | 38 | return request({ | |
| 39 | 39 | url: '/logout', | |
| 40 | method: 'post' | ||
| 41 | }).then(() => { | ||
| 42 | uni.removeStorageSync('token') | ||
| 43 | uni.removeStorageSync('userName') | ||
| 44 | }) | ||
| 45 | } | ||
| 40 | 46 | ||
| 41 | function getCodeImg() { | 47 | function getCodeImg() { |
| 42 | return request({ | 48 | return request({ |
| ... | @@ -126,5 +132,6 @@ export { | ... | @@ -126,5 +132,6 @@ export { |
| 126 | h5LoginAuto, | 132 | h5LoginAuto, |
| 127 | loginByPhone, | 133 | loginByPhone, |
| 128 | groupMemberRegister, | 134 | groupMemberRegister, |
| 129 | getMyOwnMemberInfo | 135 | getMyOwnMemberInfo, |
| 136 | logout | ||
| 130 | } | 137 | } | ... | ... |
| ... | @@ -5,6 +5,7 @@ | ... | @@ -5,6 +5,7 @@ |
| 5 | // staging | 5 | // staging |
| 6 | // const baseUrl_api = "http://22yidpjzjifv.ngrok.xiaomiqiu123.top/stage-api/"; | 6 | // const baseUrl_api = "http://22yidpjzjifv.ngrok.xiaomiqiu123.top/stage-api/"; |
| 7 | const baseUrl_api = "http://182.92.233.247/stage-api/"; | 7 | const baseUrl_api = "http://182.92.233.247/stage-api/"; |
| 8 | // const baseUrl_api = 'http://192.168.1.97:8787' | ||
| 8 | 9 | ||
| 9 | export default { | 10 | export default { |
| 10 | baseUrl_api | 11 | baseUrl_api | ... | ... |
| ... | @@ -177,15 +177,15 @@ | ... | @@ -177,15 +177,15 @@ |
| 177 | content: `确认退出吗?`, | 177 | content: `确认退出吗?`, |
| 178 | success: function(res) { | 178 | success: function(res) { |
| 179 | if (res.confirm) { | 179 | if (res.confirm) { |
| 180 | loginServer.logout().then(()=>{ | ||
| 180 | let path = '/pages/index/login'; | 181 | let path = '/pages/index/login'; |
| 181 | uni.reLaunch({ | 182 | uni.reLaunch({ |
| 182 | url: path | 183 | url: path |
| 183 | }); | 184 | }); |
| 185 | }) | ||
| 184 | } | 186 | } |
| 185 | } | 187 | } |
| 186 | }) | 188 | }) |
| 187 | |||
| 188 | |||
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | function goPath(path) { | 191 | function goPath(path) { | ... | ... |
-
Please register or sign in to post a comment