Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cb6e716c
authored
Sep 10, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码优化】注册的逻辑实现
parent
b1e3337c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
src/views/Login/components/RegisterForm.vue
+5
-8
No files found.
src/views/Login/components/RegisterForm.vue
View file @
cb6e716c
...
@@ -105,7 +105,7 @@ import { usePermissionStore } from '@/store/modules/permission'
...
@@ -105,7 +105,7 @@ 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
}
from
'./useLogin'
defineOptions
({
name
:
'
Login
Form'
})
defineOptions
({
name
:
'
Register
Form'
})
const
{
t
}
=
useI18n
()
const
{
t
}
=
useI18n
()
const
iconHouse
=
useIcon
({
icon
:
'ep:house'
})
const
iconHouse
=
useIcon
({
icon
:
'ep:house'
})
...
@@ -159,7 +159,7 @@ const registerData = reactive({
...
@@ -159,7 +159,7 @@ const registerData = reactive({
captchaEnable
:
import
.
meta
.
env
.
VITE_APP_CAPTCHA_ENABLE
,
captchaEnable
:
import
.
meta
.
env
.
VITE_APP_CAPTCHA_ENABLE
,
tenantEnable
:
import
.
meta
.
env
.
VITE_APP_TENANT_ENABLE
,
tenantEnable
:
import
.
meta
.
env
.
VITE_APP_TENANT_ENABLE
,
registerForm
:
{
registerForm
:
{
tenantName
:
''
,
tenantName
:
import
.
meta
.
env
.
VITE_APP_DEFAULT_LOGIN_TENANT
||
''
,
nickname
:
''
,
nickname
:
''
,
tenantId
:
0
,
tenantId
:
0
,
username
:
''
,
username
:
''
,
...
@@ -169,7 +169,8 @@ const registerData = reactive({
...
@@ -169,7 +169,8 @@ const registerData = reactive({
}
}
})
})
async
function
handleRegister
(
params
)
{
// 提交注册
const
handleRegister
=
async
(
params
:
any
)
=>
{
loading
.
value
=
true
loading
.
value
=
true
try
{
try
{
if
(
registerData
.
tenantEnable
)
{
if
(
registerData
.
tenantEnable
)
{
...
@@ -181,11 +182,6 @@ async function handleRegister(params) {
...
@@ -181,11 +182,6 @@ async function handleRegister(params) {
registerData
.
registerForm
.
captchaVerification
=
params
.
captchaVerification
registerData
.
registerForm
.
captchaVerification
=
params
.
captchaVerification
}
}
console
.
log
(
'registerData.registerForm.captchaVerification===='
,
registerData
.
registerForm
.
captchaVerification
)
const
res
=
await
LoginApi
.
register
(
registerData
.
registerForm
)
const
res
=
await
LoginApi
.
register
(
registerData
.
registerForm
)
if
(
!
res
)
{
if
(
!
res
)
{
return
return
...
@@ -225,6 +221,7 @@ const getCode = async () => {
...
@@ -225,6 +221,7 @@ const getCode = async () => {
verify
.
value
.
show
()
verify
.
value
.
show
()
}
}
}
}
// 获取租户 ID
// 获取租户 ID
const
getTenantId
=
async
()
=>
{
const
getTenantId
=
async
()
=>
{
if
(
registerData
.
tenantEnable
===
'true'
)
{
if
(
registerData
.
tenantEnable
===
'true'
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment