1
Showing
2 changed files
with
10 additions
and
0 deletions
| ... | @@ -141,6 +141,7 @@ export default { | ... | @@ -141,6 +141,7 @@ export default { | 
| 141 | } | 141 | } | 
| 142 | }, | 142 | }, | 
| 143 | logoutHandler() { | 143 | logoutHandler() { | 
| 144 | this.clearCache(); | ||
| 144 | httpPost({ | 145 | httpPost({ | 
| 145 | url: api.logout | 146 | url: api.logout | 
| 146 | }).then(() => { | 147 | }).then(() => { | 
| ... | @@ -148,6 +149,13 @@ export default { | ... | @@ -148,6 +149,13 @@ export default { | 
| 148 | this.showLogoutTip(); | 149 | this.showLogoutTip(); | 
| 149 | }); | 150 | }); | 
| 150 | }, | 151 | }, | 
| 152 | clearCache() { | ||
| 153 | for (let index = 0; index < sessionStorage.length; index++) { | ||
| 154 | let key = sessionStorage.key(index); | ||
| 155 | console.log(key); | ||
| 156 | sessionStorage.removeItem(key); | ||
| 157 | } | ||
| 158 | }, | ||
| 151 | showLogoutTip() { | 159 | showLogoutTip() { | 
| 152 | // 登出后的提示 | 160 | // 登出后的提示 | 
| 153 | // alert("登出成功"); | 161 | // alert("登出成功"); | ... | ... | 
| ... | @@ -95,6 +95,7 @@ export default { | ... | @@ -95,6 +95,7 @@ export default { | 
| 95 | } | 95 | } | 
| 96 | }, | 96 | }, | 
| 97 | logoutHandler() { | 97 | logoutHandler() { | 
| 98 | console.log("logoutHandler"); | ||
| 98 | this.clearCache(); | 99 | this.clearCache(); | 
| 99 | httpPost({ | 100 | httpPost({ | 
| 100 | url: api.logout | 101 | url: api.logout | 
| ... | @@ -106,6 +107,7 @@ export default { | ... | @@ -106,6 +107,7 @@ export default { | 
| 106 | clearCache() { | 107 | clearCache() { | 
| 107 | for (let index = 0; index < sessionStorage.length; index++) { | 108 | for (let index = 0; index < sessionStorage.length; index++) { | 
| 108 | let key = sessionStorage.key(index); | 109 | let key = sessionStorage.key(index); | 
| 110 | console.log(key); | ||
| 109 | sessionStorage.removeItem(key); | 111 | sessionStorage.removeItem(key); | 
| 110 | } | 112 | } | 
| 111 | }, | 113 | }, | ... | ... | 
- 
Please register or sign in to post a comment