mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-09 02:33:42 +08:00
fixed bug for register page code verification
This commit is contained in:
@@ -384,7 +384,7 @@ const submitRegister = () => {
|
||||
if ((activeName.value === 'mobile' || activeName.value === 'email') && data.value.code === '') {
|
||||
return ElMessage.error('请输入验证码');
|
||||
}
|
||||
if (enableVerify.value) {
|
||||
if (enableVerify.value && activeName.value === 'username') {
|
||||
captchaRef.value.loadCaptcha()
|
||||
action.value = "register"
|
||||
} else {
|
||||
|
||||
@@ -90,12 +90,22 @@ const items = [
|
||||
index: '/admin/user',
|
||||
title: '用户管理',
|
||||
},
|
||||
|
||||
{
|
||||
icon: 'menu',
|
||||
index: '/admin/app',
|
||||
index: '1',
|
||||
title: '应用管理',
|
||||
subs: [
|
||||
{
|
||||
index: '/admin/app',
|
||||
title: '应用列表',
|
||||
},
|
||||
{
|
||||
index: '/admin/app/type',
|
||||
title: '应用分类',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
icon: 'api-key',
|
||||
index: '/admin/apikey',
|
||||
|
||||
@@ -173,6 +173,12 @@ const routes = [
|
||||
meta: {title: '应用管理'},
|
||||
component: () => import('@/views/admin/Apps.vue'),
|
||||
},
|
||||
{
|
||||
path: '/admin/app/type',
|
||||
name: 'admin-app-type',
|
||||
meta: {title: '应用管理'},
|
||||
component: () => import('@/views/admin/AppType.vue'),
|
||||
},
|
||||
{
|
||||
path: '/admin/apikey',
|
||||
name: 'admin-apikey',
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<div class="block">
|
||||
<el-input placeholder="手机号码"
|
||||
size="large"
|
||||
v-model="data.username"
|
||||
v-model="data.mobile"
|
||||
maxlength="11"
|
||||
autocomplete="off">
|
||||
<template #prefix>
|
||||
@@ -41,7 +41,7 @@
|
||||
</el-input>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<send-msg size="large" :receiver="data.username" type="mobile"/>
|
||||
<send-msg size="large" :receiver="data.mobile" type="mobile"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
@@ -195,6 +195,8 @@ const title = ref('');
|
||||
const logo = ref("")
|
||||
const data = ref({
|
||||
username: '',
|
||||
mobile: '',
|
||||
email: '',
|
||||
password: '',
|
||||
code: '',
|
||||
repass: '',
|
||||
@@ -250,15 +252,15 @@ getLicenseInfo().then(res => {
|
||||
|
||||
// 注册操作
|
||||
const submitRegister = () => {
|
||||
if (data.value.username === '') {
|
||||
if (activeName.value === 'username' && data.value.username === '') {
|
||||
return showMessageError('请输入用户名');
|
||||
}
|
||||
|
||||
if (activeName.value === 'mobile' && !validateMobile(data.value.username)) {
|
||||
if (activeName.value === 'mobile' && !validateMobile(data.value.mobile)) {
|
||||
return showMessageError('请输入合法的手机号');
|
||||
}
|
||||
|
||||
if (activeName.value === 'email' && !validateEmail(data.value.username)) {
|
||||
if (activeName.value === 'email' && !validateEmail(data.value.email)) {
|
||||
return showMessageError('请输入合法的邮箱地址');
|
||||
}
|
||||
|
||||
@@ -273,7 +275,8 @@ const submitRegister = () => {
|
||||
return showMessageError('请输入验证码');
|
||||
}
|
||||
|
||||
if (enableVerify.value) {
|
||||
// 如果是用户名和密码登录,那么需要加载验证码
|
||||
if (enableVerify.value && activeName.value === 'username') {
|
||||
captchaRef.value.loadCaptcha()
|
||||
} else {
|
||||
doSubmitRegister({})
|
||||
|
||||
13
web/src/views/admin/AppType.vue
Normal file
13
web/src/views/admin/AppType.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<div class="container app-type" >
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
||||
</style>
|
||||
@@ -18,6 +18,8 @@
|
||||
<el-image v-if="scope.row.vip" :src="vipImg" style="height: 20px;position: relative; top:5px; left: 5px"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="mobile" label="手机"/>
|
||||
<el-table-column prop="email" label="邮箱"/>
|
||||
<el-table-column prop="nickname" label="昵称"/>
|
||||
<el-table-column prop="power" label="剩余算力"/>
|
||||
<el-table-column label="状态" width="80">
|
||||
@@ -73,6 +75,12 @@
|
||||
<el-form-item label="账号:" prop="username">
|
||||
<el-input v-model="user.username" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机:" prop="mobile">
|
||||
<el-input v-model="user.mobile" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="邮箱:" prop="email">
|
||||
<el-input v-model="user.email" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="add" label="密码:" prop="password">
|
||||
<el-input v-model="user.password" autocomplete="off" placeholder="8-16位"/>
|
||||
</el-form-item>
|
||||
|
||||
Reference in New Issue
Block a user