chore: plus

This commit is contained in:
xiaojunnuo
2025-04-17 13:41:08 +08:00
parent d5d54d4d3b
commit 8e50e5dee3
6 changed files with 55 additions and 29 deletions
@@ -7,11 +7,13 @@
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off">
<a-form-item label="OTP多重验证登录" :name="['authenticator', 'enabled']">
<div class="flex mt-5">
<a-switch v-model:checked="formState.authenticator.enabled" @change="onAuthenticatorEnabledChanged" />
<a-switch v-model:checked="formState.authenticator.enabled" :disabled="!settingsStore.isPlus" @change="onAuthenticatorEnabledChanged" />
<a-button v-if="formState.authenticator.enabled && formState.authenticator.verified" :disabled="authenticatorOpenRef" size="small" class="ml-2" type="primary" @click="authenticatorForm.open = true">
<a-button v-if="formState.authenticator.enabled && formState.authenticator.verified" :disabled="authenticatorOpenRef" size="small" class="ml-5" type="primary" @click="authenticatorForm.open = true">
重新绑定
</a-button>
<vip-button class="ml-5" mode="button"></vip-button>
</div>
<div class="helper">是否开启多重验证登录</div>
@@ -45,7 +47,8 @@ import * as api from "./api";
import { UserTwoFactorSetting } from "./api";
import { Modal, notification } from "ant-design-vue";
import { merge } from "lodash-es";
import { useSettingStore } from "/@/store/settings";
const settingsStore = useSettingStore();
defineOptions({
name: "UserSecurity",
});
@@ -92,7 +95,7 @@ const doAuthenticatorSave = async (form: any) => {
authenticatorForm.open = false;
};
function onAuthenticatorEnabledChanged(value) {
function onAuthenticatorEnabledChanged(value: any) {
if (!value) {
//要关闭
if (formState.authenticator.verified) {
@@ -66,34 +66,34 @@ import { useSettingStore } from "/@/store/settings";
import { notification } from "ant-design-vue";
defineOptions({
name: "SettingRegister"
name: "SettingRegister",
});
const testMobile = ref("");
async function testSendSms() {
if (!testMobile.value) {
notification.error({
message: "请输入测试手机号"
message: "请输入测试手机号",
});
return;
}
await api.TestSms({
mobile: testMobile.value
mobile: testMobile.value,
});
notification.success({
message: "发送成功"
message: "发送成功",
});
}
const formState = reactive<Partial<SysSettings>>({
public: {
registerEnabled: false
registerEnabled: false,
},
private: {
sms: {
type: "aliyun",
config: {}
}
}
config: {},
},
},
});
const rules = {
@@ -103,13 +103,13 @@ const rules = {
return Promise.reject("密码登录和手机号登录至少开启一个");
}
return Promise.resolve();
}
},
},
required: {
required: true,
trigger: "change",
message: "此项必填"
}
message: "此项必填",
},
};
async function smsTypeChange(value: string) {
@@ -124,13 +124,13 @@ async function loadTypeDefine(type: string) {
const define: any = await api.GetSmsTypeDefine(type);
const keys = Object.keys(define.input);
const inputs: any = {};
keys.forEach((key) => {
keys.forEach(key => {
const value = define.input[key];
value.simpleKey = key;
value.key = "private.sms.config." + key;
if (!value.component) {
value.component = {
name: "a-input"
name: "a-input",
};
}
if (!value.component.name) {
@@ -165,7 +165,7 @@ const onFinish = async (form: any) => {
await api.SysSettingsSave(form);
await settingsStore.loadSysSettings();
notification.success({
message: "保存成功"
message: "保存成功",
});
} finally {
saveLoading.value = false;
@@ -3,7 +3,11 @@
<a-form ref="formRef" :model="formState" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off">
<h2>站点隐藏</h2>
<a-form-item label="启用站点隐藏" :name="['hidden', 'enabled']" :required="true">
<a-switch v-model:checked="formState.hidden.enabled" />
<div class="flex">
<a-switch v-model:checked="formState.hidden.enabled" :disabled="!settingsStore.isPlus" />
<vip-button class="ml-5" mode="button"></vip-button>
</div>
<div class="helper">
可以在平时关闭站点的可访问性需要时再打开增强站点安全性
<a href="https://certd.docmirror.cn/guide/feature/safe/hidden" class="flex items-center" target="_blank">
@@ -52,10 +56,11 @@ import { merge } from "lodash-es";
import { Modal, notification } from "ant-design-vue";
import { request } from "/@/api/service";
import { util, utils } from "/@/utils";
import { useSettingStore } from "/@/store/settings";
defineOptions({
name: "SettingSafe",
});
const settingsStore = useSettingStore();
const api = {
async SettingGet() {
return await request({