|
@@ -9,13 +9,13 @@
|
|
|
label-width="120px"
|
|
label-width="120px"
|
|
|
size="large"
|
|
size="large"
|
|
|
>
|
|
>
|
|
|
- <el-row style="maring-left: -10px; maring-right: -10px">
|
|
|
|
|
- <el-col :span="24" style="padding-left: 10px; padding-right: 10px">
|
|
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
- <LoginFormTitle style="width: 100%" />
|
|
|
|
|
|
|
+ <LoginFormTitle />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col v-if="locale" :span="24" style="padding-left: 10px; padding-right: 10px">
|
|
|
|
|
|
|
+ <el-col v-if="locale" :span="24">
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<LocaleSelect />
|
|
<LocaleSelect />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -77,7 +77,7 @@ import { useAppStore } from '@/store/modules/app'
|
|
|
const { t } = useI18n()
|
|
const { t } = useI18n()
|
|
|
//const message = useMessage()
|
|
//const message = useMessage()
|
|
|
const iconAvatar = useIcon({ icon: 'ep:avatar' })
|
|
const iconAvatar = useIcon({ icon: 'ep:avatar' })
|
|
|
-const iconLock = useIcon({ icon: 'ep:lock' })
|
|
|
|
|
|
|
+// const iconLock = useIcon({ icon: 'ep:lock' })
|
|
|
const formLogin = ref()
|
|
const formLogin = ref()
|
|
|
const { validForm } = useFormValid(formLogin)
|
|
const { validForm } = useFormValid(formLogin)
|
|
|
const { getLoginState, setLoginState } = useLoginState()
|
|
const { getLoginState, setLoginState } = useLoginState()
|
|
@@ -85,8 +85,8 @@ const { currentRoute, push } = useRouter()
|
|
|
const permissionStore = usePermissionStore()
|
|
const permissionStore = usePermissionStore()
|
|
|
const redirect = ref<string>('')
|
|
const redirect = ref<string>('')
|
|
|
const loginLoading = ref(false)
|
|
const loginLoading = ref(false)
|
|
|
-const verify = ref()
|
|
|
|
|
-const captchaType = ref('blockPuzzle') // blockPuzzle 滑块 clickWord 点击文字
|
|
|
|
|
|
|
+// const verify = ref()
|
|
|
|
|
+// const captchaType = ref('blockPuzzle') // blockPuzzle 滑块 clickWord 点击文字
|
|
|
const appStore = useAppStore()
|
|
const appStore = useAppStore()
|
|
|
const locale = computed(() => appStore.getLocale)
|
|
const locale = computed(() => appStore.getLocale)
|
|
|
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN)
|
|
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN)
|
|
@@ -106,19 +106,18 @@ const registerData = reactive({
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 获取验证码
|
|
// 获取验证码
|
|
|
-const getCode = async () => {
|
|
|
|
|
- // 情况一,未开启:则直接登录
|
|
|
|
|
- console.log('oginData.captchaEnable:', registerData.captchaEnable)
|
|
|
|
|
- if (registerData.captchaEnable === 'false') {
|
|
|
|
|
- // await register({
|
|
|
|
|
-
|
|
|
|
|
- // })
|
|
|
|
|
- } else {
|
|
|
|
|
- // 情况二,已开启:则展示验证码;只有完成验证码的情况,才进行登录
|
|
|
|
|
- // 弹出验证码
|
|
|
|
|
- // verify.value.show()
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
|
|
+// const getCode = async () => {
|
|
|
|
|
+// // 情况一,未开启:则直接登录
|
|
|
|
|
+// console.log('oginData.captchaEnable:', registerData.captchaEnable)
|
|
|
|
|
+// if (registerData.captchaEnable === 'false') {
|
|
|
|
|
+// // await register({
|
|
|
|
|
+// // })
|
|
|
|
|
+// } else {
|
|
|
|
|
+// // 情况二,已开启:则展示验证码;只有完成验证码的情况,才进行登录
|
|
|
|
|
+// // 弹出验证码
|
|
|
|
|
+// // verify.value.show()
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
//获取租户ID
|
|
//获取租户ID
|
|
|
const getTenantId = async () => {
|
|
const getTenantId = async () => {
|
|
|
// if (registerData.tenantEnable === 'true') {
|
|
// if (registerData.tenantEnable === 'true') {
|
|
@@ -145,8 +144,8 @@ const register = async () => {
|
|
|
if (!data) {
|
|
if (!data) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- registerData.registerForm.captchaVerification = params.captchaVerification
|
|
|
|
|
- const res = await LoginApi.login(registerData.registerForm)
|
|
|
|
|
|
|
+ // registerData.registerForm.captchaVerification = params.captchaVerification
|
|
|
|
|
+ const res = await LoginApi.register(registerData.registerForm)
|
|
|
if (!res) {
|
|
if (!res) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
@@ -155,11 +154,11 @@ const register = async () => {
|
|
|
text: t('login.loadingSystem'),
|
|
text: t('login.loadingSystem'),
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
|
})
|
|
})
|
|
|
- if (registerData.registerForm.rememberMe) {
|
|
|
|
|
- authUtil.setLoginForm(registerData.registerForm)
|
|
|
|
|
- } else {
|
|
|
|
|
- authUtil.removeLoginForm()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (registerData.registerForm) {
|
|
|
|
|
+ // authUtil.setLoginForm(registerData.registerForm)
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // authUtil.removeLoginForm()
|
|
|
|
|
+ // }
|
|
|
authUtil.setToken(res)
|
|
authUtil.setToken(res)
|
|
|
if (!redirect.value) {
|
|
if (!redirect.value) {
|
|
|
redirect.value = '/'
|
|
redirect.value = '/'
|
|
@@ -195,6 +194,4 @@ onMounted(() => {
|
|
|
})
|
|
})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
|
|
-
|
|
|
|
|
-</style>
|
|
|
|
|
|
|
+<style lang="scss" scoped></style>
|