@@ -123,34 +123,19 @@ const user = {
123123 } ,
124124 // 删除客户端和服务端Token
125125 async clearToken ( { commit } ) {
126- // 如果配置了“不请求后端接口”
127- if ( process . env . VUE_APP_REQUEST_API === 'false' ) {
128- const promise = new Promise ( ( resolve ) => {
129- commit ( 'SET_TOKEN' , null ) ;
130- window . location . reload ( ) ;
131- resolve ( ) ;
132- } ) ;
133- return promise ;
134- }
135- const promise = await logout ( ) . then ( ( ) => {
136- commit ( 'SET_TOKEN' , null ) ;
137- window . location . reload ( ) ;
138- } ) ;
139- return promise ;
126+ commit ( 'SET_TOKEN' , null ) ;
127+ window . location . reload ( ) ;
140128 } ,
141129 // 客户端timeOut
142130 async clientTimeOut ( { commit } ) {
143- const promise = await logout ( ) . then ( ( ) => {
144- commit ( 'SET_TOKEN' , null ) ;
145- MessageBox . alert ( '长时间未操作,登录超时,请重新登录' , {
146- confirmButtonText : '重新登录' ,
147- showClose : false ,
148- callback : ( ) => {
149- window . location . reload ( ) ;
150- } ,
151- } ) ;
131+ commit ( 'SET_TOKEN' , null ) ;
132+ MessageBox . alert ( '长时间未操作,登录超时,请重新登录' , {
133+ confirmButtonText : '重新登录' ,
134+ showClose : false ,
135+ callback : ( ) => {
136+ window . location . reload ( ) ;
137+ } ,
152138 } ) ;
153- return promise ;
154139 } ,
155140 // 修改密码
156141 async changePassword ( { commit } , {
0 commit comments