|
|
@@ -146,10 +146,17 @@ const login = async () => {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- const res: any = await loginEtssmsApi(formData)
|
|
|
- if (res?.access_token) {
|
|
|
- userStore.setAccessToken(res.access_token)
|
|
|
- router.replace({ path: '/invoice-information' })
|
|
|
+ try {
|
|
|
+ const res: any = await loginEtssmsApi(formData)
|
|
|
+ if (res?.access_token) {
|
|
|
+ userStore.setAccessToken(res.access_token)
|
|
|
+ router.replace({ path: '/invoice-information' })
|
|
|
+ }
|
|
|
+ } catch (err: any) {
|
|
|
+ const { code, message } = err
|
|
|
+ if (code && message) {
|
|
|
+ showFailToast(message)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|