Skip to content

Commit cb6e716

Browse files
committed
【代码优化】注册的逻辑实现
1 parent b1e3337 commit cb6e716

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/views/Login/components/RegisterForm.vue

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ import { usePermissionStore } from '@/store/modules/permission'
105105
import * as LoginApi from '@/api/login'
106106
import { LoginStateEnum, useLoginState } from './useLogin'
107107
108-
defineOptions({ name: 'LoginForm' })
108+
defineOptions({ name: 'RegisterForm' })
109109
110110
const { t } = useI18n()
111111
const iconHouse = useIcon({ icon: 'ep:house' })
@@ -159,7 +159,7 @@ const registerData = reactive({
159159
captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE,
160160
tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE,
161161
registerForm: {
162-
tenantName: '',
162+
tenantName: import.meta.env.VITE_APP_DEFAULT_LOGIN_TENANT || '',
163163
nickname: '',
164164
tenantId: 0,
165165
username: '',
@@ -169,7 +169,8 @@ const registerData = reactive({
169169
}
170170
})
171171
172-
async function handleRegister(params) {
172+
// 提交注册
173+
const handleRegister = async (params: any) => {
173174
loading.value = true
174175
try {
175176
if (registerData.tenantEnable) {
@@ -181,11 +182,6 @@ async function handleRegister(params) {
181182
registerData.registerForm.captchaVerification = params.captchaVerification
182183
}
183184
184-
console.log(
185-
'registerData.registerForm.captchaVerification====',
186-
registerData.registerForm.captchaVerification
187-
)
188-
189185
const res = await LoginApi.register(registerData.registerForm)
190186
if (!res) {
191187
return
@@ -225,6 +221,7 @@ const getCode = async () => {
225221
verify.value.show()
226222
}
227223
}
224+
228225
// 获取租户 ID
229226
const getTenantId = async () => {
230227
if (registerData.tenantEnable === 'true') {

0 commit comments

Comments
 (0)