File tree Expand file tree Collapse file tree 4 files changed +6
-4
lines changed
Expand file tree Collapse file tree 4 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import router from './router'
77import store from './store'
88import i18n from './i18n'
99
10- localStorage . clear ( )
10+ store . dispatch ( 'Logout' )
1111
1212Vue . config . productionTip = false
1313
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ export default new Vuex.Store({
4646 state . transmission_key = data . transmission_key . substr ( 0 , 32 )
4747 state . user = data
4848
49+ localStorage . email = payload . email
4950 localStorage . access_token = state . access_token
5051 localStorage . refresh_token = state . refresh_token
5152 if ( process . env . NODE_ENV !== 'production' ) {
@@ -65,7 +66,8 @@ export default new Vuex.Store({
6566 state . transmission_key = null
6667 state . master_hash = null
6768 state . user = null
68- localStorage . clear ( )
69+ const lsKeys = Object . keys ( localStorage ) . filter ( key => [ 'email' ] . includes ( key ) === false )
70+ lsKeys . forEach ( key => localStorage . removeItem ( key ) )
6971 } ,
7072
7173 async Import ( _ , data ) {
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export default {
4747 data () {
4848 return {
4949 LoginForm: {
50- email: ' ' ,
50+ email: localStorage . email || ' ' ,
5151 master_password: ' '
5252 }
5353 }
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ export default {
145145 async checkUpdate () {
146146 const { version } = require (' ../../../../../package.json' )
147147 try {
148- const { data } = await HTTPClient .get (' /web/check-update/1' )
148+ const { data } = await HTTPClient .get (' /web/check-update/1' , {}, { Authorization : null } )
149149
150150 this .hasUpdate = data .latest_version != version
151151 this .updateLink = data .download_url
You can’t perform that action at this time.
0 commit comments