perf: 注册页面增加手机注册tab页签

This commit is contained in:
xiaojunnuo
2025-10-25 01:05:42 +08:00
parent 3bdc610249
commit 6b2f1fcd3e
7 changed files with 94 additions and 7 deletions

View File

@@ -28,10 +28,10 @@
未设置触发源不会自动执行
</span>
</a-tag>
<a-tag v-if="pipelineEntity.validTime > 0 && settingStore.sysPublic.pipelineValidTimeEnabled" v-plus="true" :color="pipelineEntity.validTime > Date.now() ? 'green' : 'red'">
<a-tag v-if="pipelineEntity.validTime > 0 && settingStore.sysPublic.pipelineValidTimeEnabled && settingStore.isPlus" :color="pipelineEntity.validTime > Date.now() ? 'green' : 'red'">
<span class="flex">
<fs-icon icon="ion:time-outline"></fs-icon>
<span v-if="pipelineEntity.validTime > Date.now()"> 有效期:<FsTimeHumanize :model-value="pipelineEntity.validTime" :options="{ units: ['d'] }"></FsTimeHumanize> </span>
<span v-if="pipelineEntity.validTime > Date.now()"> 有效期:<FsTimeHumanize :model-value="pipelineEntity.validTime" :options="{ units: ['d'] }" format="YYYY-MM-DD"></FsTimeHumanize> </span>
<span v-else> 已过期 </span>
</span>
</a-tag>

View File

@@ -95,11 +95,14 @@ import SmsCode from "/@/views/framework/login/sms-code.vue";
import { useI18n } from "/@/locales";
import { LanguageToggle } from "/@/vben/layouts";
import CaptchaInput from "/@/components/captcha/captcha-input.vue";
import { useRoute } from "vue-router";
export default defineComponent({
name: "LoginPage",
components: { LanguageToggle, SmsCode, CaptchaInput },
setup() {
const { t } = useI18n();
const route = useRoute();
const urlLoginType = route.query.loginType as string | undefined;
const verifyCodeInputRef = ref();
const loading = ref(false);
const userStore = useUserStore();
@@ -110,7 +113,7 @@ export default defineComponent({
phoneCode: "86",
mobile: "",
password: "",
loginType: "password", //password
loginType: urlLoginType || "password", //password
smsCode: "",
captcha: null,
smsCaptcha: null,

View File

@@ -1,7 +1,7 @@
<template>
<div class="main">
<a-form ref="formRef" class="user-layout-register" name="custom-validation" :model="formState" :rules="rules" v-bind="layout" :label-col="{ span: 6 }" @finish="handleFinish" @finish-failed="handleFinishFailed">
<a-tabs v-model:active-key="registerType">
<a-tabs v-model:active-key="registerType" @change="handleTabChange">
<a-tab-pane key="username" tab="用户名注册" :disabled="!settingsStore.sysPublic.usernameRegisterEnabled">
<template v-if="registerType === 'username'">
<a-form-item required has-feedback name="username" label="用户名" :rules="rules.username">
@@ -70,6 +70,8 @@
</a-form-item>
</template>
</a-tab-pane>
<a-tab-pane v-if="settingsStore.sysPublic.smsLoginEnabled" key="mobile" tab="手机号注册"> </a-tab-pane>
</a-tabs>
<a-form-item>
@@ -90,6 +92,7 @@ import EmailCode from "./email-code.vue";
import { useSettingStore } from "/@/store/settings";
import { notification } from "ant-design-vue";
import CaptchaInput from "/@/components/captcha/captcha-input.vue";
import { useRouter } from "vue-router";
export default defineComponent({
name: "RegisterPage",
components: { CaptchaInput, EmailCode },
@@ -171,6 +174,18 @@ export default defineComponent({
message: "请输入邮件验证码",
},
],
captcha: [
{
required: true,
message: "请通过验证码",
},
],
imgCode: [
{
required: true,
message: "请输入验证码",
},
],
};
const layout = {
labelCol: {
@@ -206,6 +221,13 @@ export default defineComponent({
formRef.value.resetFields();
};
const router = useRouter();
const handleTabChange = (key: string) => {
if (key === "mobile") {
router.push({ path: "/login", query: { loginType: "sms" } });
}
};
return {
formState,
formRef,
@@ -216,6 +238,7 @@ export default defineComponent({
resetForm,
registerType,
settingsStore,
handleTabChange,
};
},
});

View File

@@ -0,0 +1,17 @@
ALTER TABLE cd_site_info ADD COLUMN `remark` varchar(512);
CREATE TABLE `cd_group`
(
`id` bigint PRIMARY KEY AUTO_INCREMENT NOT NULL,
`user_id` bigint NOT NULL,
`name` varchar(100) NOT NULL,
`icon` varchar(100),
`favorite` boolean NOT NULL DEFAULT false,
`type` varchar(512),
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
);
ALTER TABLE cd_site_info ADD COLUMN `group_id` bigint;
ALTER TABLE pi_pipeline ADD COLUMN `valid_time` bigint;

View File

@@ -0,0 +1,17 @@
ALTER TABLE cd_site_info ADD COLUMN "remark" varchar(512);
CREATE TABLE "cd_group"
(
"id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL,
"user_id" bigint NOT NULL,
"name" varchar(100) NOT NULL,
"icon" varchar(100),
"favorite" boolean NOT NULL DEFAULT (false),
"type" varchar(512),
"create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP)
);
ALTER TABLE cd_site_info ADD COLUMN "group_id" bigint;
ALTER TABLE pi_pipeline ADD COLUMN "valid_time" bigint;

View File

@@ -12,9 +12,6 @@ CREATE TABLE "cd_group"
"update_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP)
);
--
ALTER TABLE cd_site_info ADD COLUMN "group_id" integer;
--线
ALTER TABLE pi_pipeline ADD COLUMN "valid_time" integer;