|
@@ -2,7 +2,7 @@
|
|
|
import { reactive, ref, watch } from 'vue'
|
|
|
import { Form, FormSchema } from '@/components/Form'
|
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
|
-import { ElButton, ElCheckbox, ElLink } from 'element-plus'
|
|
|
+import { ElButton } from 'element-plus'
|
|
|
import { useForm } from '@/hooks/web/useForm'
|
|
|
import { loginApi, getUserInfo } from '@/api/login'
|
|
|
import { useStorage } from '@/hooks/web/useStorage'
|
|
@@ -12,8 +12,6 @@ import { useRouter } from 'vue-router'
|
|
|
import type { RouteLocationNormalizedLoaded, RouteRecordRaw } from 'vue-router'
|
|
|
import { UserLoginType } from '@/api/login/types'
|
|
|
import { useValidator } from '@/hooks/web/useValidator'
|
|
|
-import { Icon } from '@/components/Icon'
|
|
|
-import { treeToList } from '@/utils/tree'
|
|
|
|
|
|
const { required } = useValidator()
|
|
|
|
|
@@ -75,28 +73,6 @@ const schema = reactive<FormSchema[]>([
|
|
|
placeholder: t('login.passwordPlaceholder')
|
|
|
}
|
|
|
},
|
|
|
- {
|
|
|
- field: 'tool',
|
|
|
- colProps: {
|
|
|
- span: 24
|
|
|
- },
|
|
|
- formItemProps: {
|
|
|
- slots: {
|
|
|
- default: () => {
|
|
|
- return (
|
|
|
- <>
|
|
|
- <div class="flex justify-between items-center w-[100%]">
|
|
|
- <ElCheckbox v-model={remember.value} label={t('login.remember')} size="small" />
|
|
|
- <ElLink type="primary" underline={false}>
|
|
|
- {t('login.forgetPassword')}
|
|
|
- </ElLink>
|
|
|
- </div>
|
|
|
- </>
|
|
|
- )
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
{
|
|
|
field: 'login',
|
|
|
colProps: {
|
|
@@ -112,65 +88,6 @@ const schema = reactive<FormSchema[]>([
|
|
|
{t('login.login')}
|
|
|
</ElButton>
|
|
|
</div>
|
|
|
- <div class="w-[100%] mt-15px">
|
|
|
- <ElButton class="w-[100%]" onClick={toRegister}>
|
|
|
- {t('login.register')}
|
|
|
- </ElButton>
|
|
|
- </div>
|
|
|
- </>
|
|
|
- )
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'other',
|
|
|
- component: 'Divider',
|
|
|
- label: t('login.otherLogin'),
|
|
|
- componentProps: {
|
|
|
- contentPosition: 'center'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'otherIcon',
|
|
|
- colProps: {
|
|
|
- span: 24
|
|
|
- },
|
|
|
- formItemProps: {
|
|
|
- slots: {
|
|
|
- default: () => {
|
|
|
- return (
|
|
|
- <>
|
|
|
- <div class="flex justify-between w-[100%]">
|
|
|
- <Icon
|
|
|
- icon="ant-design:github-filled"
|
|
|
- size={iconSize}
|
|
|
- class="cursor-pointer ant-icon"
|
|
|
- color={iconColor}
|
|
|
- hoverColor={hoverColor}
|
|
|
- />
|
|
|
- <Icon
|
|
|
- icon="ant-design:wechat-filled"
|
|
|
- size={iconSize}
|
|
|
- class="cursor-pointer ant-icon"
|
|
|
- color={iconColor}
|
|
|
- hoverColor={hoverColor}
|
|
|
- />
|
|
|
- <Icon
|
|
|
- icon="ant-design:alipay-circle-filled"
|
|
|
- size={iconSize}
|
|
|
- color={iconColor}
|
|
|
- hoverColor={hoverColor}
|
|
|
- class="cursor-pointer ant-icon"
|
|
|
- />
|
|
|
- <Icon
|
|
|
- icon="ant-design:weibo-circle-filled"
|
|
|
- size={iconSize}
|
|
|
- color={iconColor}
|
|
|
- hoverColor={hoverColor}
|
|
|
- class="cursor-pointer ant-icon"
|
|
|
- />
|
|
|
- </div>
|
|
|
</>
|
|
|
)
|
|
|
}
|
|
@@ -179,19 +96,11 @@ const schema = reactive<FormSchema[]>([
|
|
|
}
|
|
|
])
|
|
|
|
|
|
-const iconSize = 30
|
|
|
-
|
|
|
-const remember = ref(false)
|
|
|
-
|
|
|
const { formRegister, formMethods } = useForm()
|
|
|
const { getFormData, getElFormExpose } = formMethods
|
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
|
-const iconColor = '#999'
|
|
|
-
|
|
|
-const hoverColor = 'var(--el-color-primary)'
|
|
|
-
|
|
|
const redirect = ref<string>('')
|
|
|
|
|
|
watch(
|
|
@@ -277,11 +186,6 @@ const getRole = async () => {
|
|
|
push({ path: redirect.value || permissionStore.addRouters[0].path })
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-// 去注册页面
|
|
|
-const toRegister = () => {
|
|
|
- emit('to-register')
|
|
|
-}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -291,7 +195,7 @@ const toRegister = () => {
|
|
|
label-position="top"
|
|
|
hide-required-asterisk
|
|
|
size="large"
|
|
|
- class="dark:(border-1 border-[var(--el-border-color)] border-solid)"
|
|
|
+ class="dark:(border-1 border-[var(--el-border-color)] border-solid) bg-white"
|
|
|
@register="formRegister"
|
|
|
/>
|
|
|
</template>
|