File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
src/views/Login/components Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,7 @@ const getCookie = () => {
230
230
}
231
231
}
232
232
}
233
+ const loading = ref () // ElLoading.service 返回的实例
233
234
// 登录
234
235
const handleLogin = async (params ) => {
235
236
loginLoading .value = true
@@ -244,7 +245,7 @@ const handleLogin = async (params) => {
244
245
if (! res ) {
245
246
return
246
247
}
247
- ElLoading .service ({
248
+ loading . value = ElLoading .service ({
248
249
lock: true ,
249
250
text: ' 正在加载系统中...' ,
250
251
background: ' rgba(0, 0, 0, 0.7)'
@@ -264,13 +265,9 @@ const handleLogin = async (params) => {
264
265
} else {
265
266
push ({ path: redirect .value || permissionStore .addRouters [0 ].path })
266
267
}
267
- } catch {
268
- loginLoading .value = false
269
268
} finally {
270
- setTimeout (() => {
271
- const loadingInstance = ElLoading .service ()
272
- loadingInstance .close ()
273
- }, 400 )
269
+ loginLoading .value = false
270
+ loading .value .close ()
274
271
}
275
272
}
276
273
You can’t perform that action at this time.
0 commit comments