|
@@ -34,7 +34,7 @@
|
|
|
import { nextTick, onMounted, ref } from 'vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
-import { userLogin } from "~api/user";
|
|
|
+import { userLogin } from '~api/user'
|
|
|
import { deepClone, formValidate } from 'js-fast-way'
|
|
|
import { getStore, setStore } from '~src/utils/storage'
|
|
|
import { setRefreshToken, setToken } from 'hc-vue3-ui'
|
|
@@ -87,7 +87,12 @@ const formValidateClick = async () => {
|
|
|
//登录请求
|
|
|
loading.value = true
|
|
|
const { error, code, res } = await userLogin(formValue.value)
|
|
|
- if (!error && code === 200) {
|
|
|
+ const { error_code, error_description } = res
|
|
|
+ if (error_code === 2004) {
|
|
|
+ window?.$message?.error(error_description)
|
|
|
+ loading.value = false
|
|
|
+ return false
|
|
|
+ } else if (!error && code === 200) {
|
|
|
setToken(res['access_token'])
|
|
|
setRefreshToken(res['refresh_token'])
|
|
|
store.setUserInfo(res)
|