【代码优化】注册的逻辑实现

pull/547/MERGE
YunaiV 2024-09-10 21:04:46 +08:00
parent b1e3337cb4
commit cb6e716ce2
1 changed files with 5 additions and 8 deletions

View File

@ -105,7 +105,7 @@ import { usePermissionStore } from '@/store/modules/permission'
import * as LoginApi from '@/api/login'
import { LoginStateEnum, useLoginState } from './useLogin'
defineOptions({ name: 'LoginForm' })
defineOptions({ name: 'RegisterForm' })
const { t } = useI18n()
const iconHouse = useIcon({ icon: 'ep:house' })
@ -159,7 +159,7 @@ const registerData = reactive({
captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE,
tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE,
registerForm: {
tenantName: '',
tenantName: import.meta.env.VITE_APP_DEFAULT_LOGIN_TENANT || '',
nickname: '',
tenantId: 0,
username: '',
@ -169,7 +169,8 @@ const registerData = reactive({
}
})
async function handleRegister(params) {
//
const handleRegister = async (params: any) => {
loading.value = true
try {
if (registerData.tenantEnable) {
@ -181,11 +182,6 @@ async function handleRegister(params) {
registerData.registerForm.captchaVerification = params.captchaVerification
}
console.log(
'registerData.registerForm.captchaVerification====',
registerData.registerForm.captchaVerification
)
const res = await LoginApi.register(registerData.registerForm)
if (!res) {
return
@ -225,6 +221,7 @@ const getCode = async () => {
verify.value.show()
}
}
// ID
const getTenantId = async () => {
if (registerData.tenantEnable === 'true') {