增加isPhoneRegisterOn clientId

This commit is contained in:
cuijiawang
2025-09-18 18:03:58 +08:00
parent 68a6aad622
commit 96d2ebd341
3 changed files with 20 additions and 3 deletions

View File

@@ -11,6 +11,9 @@ export type CaptchaDTO = {
export type ConfigDTO = {
/** 验证码开关 */
isCaptchaOn: boolean;
/** 手机号注册开关 */
isPhoneRegisterOn: boolean;
clientId: string;
/** 系统字典配置(下拉选项之类的) */
dictionary: Map<String, Array<DictionaryData>>;
};

View File

@@ -14,6 +14,14 @@ defineProps({
currentPage: {
type: Number,
default: 3
},
isPhoneRegisterOn: {
type: Boolean,
default: false
},
clientId: {
type: String,
default: ""
}
});
@@ -103,7 +111,7 @@ function onBack() {
</Motion>
<Motion :delay="100">
<el-form-item prop="phone">
<el-form-item v-if="isPhoneRegisterOn" prop="phone">
<el-input
clearable
v-model="ruleForm.phone"
@@ -114,7 +122,7 @@ function onBack() {
</Motion>
<Motion :delay="150">
<el-form-item prop="verifyCode">
<el-form-item v-if="isPhoneRegisterOn" prop="verifyCode">
<div class="flex justify-between w-full">
<el-input
clearable

View File

@@ -50,6 +50,8 @@ defineOptions({
const captchaCodeBase64 = ref("");
const isCaptchaOn = ref(false);
const isPhoneRegisterOn = ref(false);
const clientId = ref("");
const router = useRouter();
const loading = ref(false);
@@ -83,7 +85,7 @@ const onLogin = async (formEl: FormInstance | undefined) => {
captchaCode: ruleForm.captchaCode,
captchaCodeKey: ruleForm.captchaCodeKey,
grantType: "password",
clientId: "1"
clientId: clientId.value
})
.then(({ data }) => {
// 登录成功后 将token存储到sessionStorage中
@@ -135,6 +137,8 @@ watch(isRememberMe, newVal => {
onBeforeMount(async () => {
await CommonAPI.getConfig().then(res => {
isCaptchaOn.value = res.data.isCaptchaOn;
isPhoneRegisterOn.value = res.data.isPhoneRegisterOn;
clientId.value = res.data.clientId;
useUserStoreHook().SET_DICTIONARY(res.data.dictionary);
});
@@ -314,6 +318,8 @@ onBeforeUnmount(() => {
<register
v-if="currentPage === 3"
v-model:current-page="currentPage"
:is-phone-register-on="isPhoneRegisterOn"
:client-id="clientId"
/>
<!-- 忘记密码 -->
<resetPassword