parent
							
								
									7aa9107cb4
								
							
						
					
					
						commit
						dd5bfbc859
					
				|  | @ -38,7 +38,7 @@ | ||||||
|         </el-form-item> |         </el-form-item> | ||||||
|       </el-col> |       </el-col> | ||||||
|       <el-col :span="24" class="px-10px"> |       <el-col :span="24" class="px-10px"> | ||||||
|         <el-form-item prop="username"> |         <el-form-item prop="nickname"> | ||||||
|           <el-input |           <el-input | ||||||
|             v-model="registerData.registerForm.nickname" |             v-model="registerData.registerForm.nickname" | ||||||
|             placeholder="昵称" |             placeholder="昵称" | ||||||
|  | @ -104,7 +104,7 @@ import { useIcon } from '@/hooks/web/useIcon' | ||||||
| import * as authUtil from '@/utils/auth' | import * as authUtil from '@/utils/auth' | ||||||
| import { usePermissionStore } from '@/store/modules/permission' | import { usePermissionStore } from '@/store/modules/permission' | ||||||
| import * as LoginApi from '@/api/login' | import * as LoginApi from '@/api/login' | ||||||
| import { LoginStateEnum, useLoginState } from './useLogin' | import { LoginStateEnum, useLoginState, useFormValid } from './useLogin' | ||||||
| 
 | 
 | ||||||
| defineOptions({ name: 'RegisterForm' }) | defineOptions({ name: 'RegisterForm' }) | ||||||
| 
 | 
 | ||||||
|  | @ -113,6 +113,7 @@ const iconHouse = useIcon({ icon: 'ep:house' }) | ||||||
| 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 { handleBackLogin, getLoginState } = useLoginState() | const { handleBackLogin, getLoginState } = useLoginState() | ||||||
| const { currentRoute, push } = useRouter() | const { currentRoute, push } = useRouter() | ||||||
| const permissionStore = usePermissionStore() | const permissionStore = usePermissionStore() | ||||||
|  | @ -170,6 +171,7 @@ const registerData = reactive({ | ||||||
|   } |   } | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
|  | const loading = ref() // ElLoading.service 返回的实例 | ||||||
| // 提交注册 | // 提交注册 | ||||||
| const handleRegister = async (params: any) => { | const handleRegister = async (params: any) => { | ||||||
|   loading.value = true |   loading.value = true | ||||||
|  | @ -183,6 +185,11 @@ const handleRegister = async (params: any) => { | ||||||
|       registerData.registerForm.captchaVerification = params.captchaVerification |       registerData.registerForm.captchaVerification = params.captchaVerification | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     const data = await validForm() | ||||||
|  |     if (!data) { | ||||||
|  |       return | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     const res = await LoginApi.register(registerData.registerForm) |     const res = await LoginApi.register(registerData.registerForm) | ||||||
|     if (!res) { |     if (!res) { | ||||||
|       return |       return | ||||||
|  | @ -242,7 +249,6 @@ const getTenantByWebsite = async () => { | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
| const loading = ref() // ElLoading.service 返回的实例 |  | ||||||
| 
 | 
 | ||||||
| watch( | watch( | ||||||
|   () => currentRoute.value, |   () => currentRoute.value, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 山野羡民
						山野羡民