mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
perf: 邮箱设置改为系统设置,普通用户无需配置发件邮箱
This commit is contained in:
@@ -15,9 +15,9 @@
|
||||
<div class="fs-bootstrap__loading"></div>
|
||||
</div>
|
||||
<div class="fs-bootstrap__footer">
|
||||
<a href="https://github.com/certd/certd" target="_blank">
|
||||
https://github.com/certd/certd
|
||||
</a>
|
||||
<!-- <a href="https://github.com/certd/certd" target="_blank">-->
|
||||
<!-- https://github.com/certd/certd-->
|
||||
<!-- </a>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="layout-vip isPlus" @click="openUpgrade">
|
||||
<div v-if="!settingStore.isComm" class="layout-vip isPlus" @click="openUpgrade">
|
||||
<contextHolder />
|
||||
<fs-icon icon="mingcute:vip-1-line" :title="text.title" />
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<!-- Button-->
|
||||
<!-- </button>-->
|
||||
<fs-menu
|
||||
v-if="settingStore?.siteEnv?.agent?.enabled === false"
|
||||
v-if="settingStore?.siteEnv?.agent?.enabled === false || !settingStore.isComm"
|
||||
class="header-menu"
|
||||
mode="horizontal"
|
||||
:expand-selected="false"
|
||||
@@ -67,19 +67,22 @@
|
||||
</a-layout-content>
|
||||
<a-layout-footer class="fs-framework-footer">
|
||||
<div>
|
||||
<span>Powered by</span>
|
||||
<a> handsfree.work </a>
|
||||
<span v-if="!settingStore.isComm">
|
||||
<span>Powered by</span>
|
||||
<a> handsfree.work </a>
|
||||
</span>
|
||||
|
||||
<template v-if="siteInfo.licenseTo">
|
||||
<a-divider type="vertical" />
|
||||
<a :href="siteInfo.licenseToUrl || ''">{{ siteInfo.licenseTo }}</a>
|
||||
</template>
|
||||
|
||||
<template v-if="siteInfo.icpNo">
|
||||
<a-divider type="vertical" />
|
||||
<span>
|
||||
<a href="https://beian.miit.gov.cn/" target="_blank">{{ siteInfo.icpNo }}</a>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template v-if="siteInfo.licenseTo">
|
||||
<a-divider type="vertical" />
|
||||
<a :href="siteInfo.licenseToUrl || ''">{{ siteInfo.licenseTo }}</a>
|
||||
</template>
|
||||
</div>
|
||||
<div>v{{ version }}</div>
|
||||
|
||||
|
||||
@@ -13,26 +13,24 @@
|
||||
<router-view />
|
||||
|
||||
<div class="footer">
|
||||
<!-- <div class="links">-->
|
||||
<!-- <a href="_self">帮助</a>-->
|
||||
<!-- <a href="_self">隐私</a>-->
|
||||
<!-- <a href="_self">条款</a>-->
|
||||
<!-- </div>-->
|
||||
<div class="copyright">
|
||||
<span>Copyright</span>
|
||||
<span>©</span>
|
||||
<span>{{ envRef.COPYRIGHT_YEAR }}</span>
|
||||
<span>
|
||||
<a :href="envRef.COPYRIGHT_URL" target="_blank">{{ envRef.COPYRIGHT_NAME }}</a>
|
||||
<span v-if="!settingStore.isComm">
|
||||
<span>Copyright</span>
|
||||
<span>©</span>
|
||||
<span>{{ envRef.COPYRIGHT_YEAR }}</span>
|
||||
<span>
|
||||
<a :href="envRef.COPYRIGHT_URL" target="_blank">{{ envRef.COPYRIGHT_NAME }}</a>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span v-if="siteInfo.licenseTo">
|
||||
<a-divider type="vertical" />
|
||||
<a :href="siteInfo.licenseToUrl" target="_blank">{{ siteInfo.licenseTo }}</a>
|
||||
</span>
|
||||
<span v-if="siteInfo.icpNo">
|
||||
<a-divider type="vertical" />
|
||||
<a href="https://beian.miit.gov.cn/" target="_blank">{{ siteInfo.icpNo }}</a>
|
||||
</span>
|
||||
<span v-if="siteInfo.licenseTo">
|
||||
<a-divider type="vertical" />
|
||||
<a :href="siteInfo.licenseToUrl" target="_blank">{{ siteInfo.licenseTo }}</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -56,16 +56,16 @@ export const certdResources = [
|
||||
auth: true
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "邮箱设置",
|
||||
name: "EmailSetting",
|
||||
path: "/certd/settings/email",
|
||||
component: "/certd/settings/email-setting.vue",
|
||||
meta: {
|
||||
icon: "ion:mail-outline",
|
||||
auth: true
|
||||
}
|
||||
},
|
||||
// {
|
||||
// title: "邮箱设置",
|
||||
// name: "EmailSetting",
|
||||
// path: "/certd/settings/email",
|
||||
// component: "/certd/settings/email-setting.vue",
|
||||
// meta: {
|
||||
// icon: "ion:mail-outline",
|
||||
// auth: true
|
||||
// }
|
||||
// },
|
||||
{
|
||||
title: "账号信息",
|
||||
name: "UserProfile",
|
||||
|
||||
@@ -77,6 +77,16 @@ export const sysResources = [
|
||||
permission: "sys:settings:view"
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "邮箱设置",
|
||||
name: "EmailSetting",
|
||||
path: "/sys/settings/email",
|
||||
component: "/sys/settings/email-setting.vue",
|
||||
meta: {
|
||||
icon: "ion:mail-outline",
|
||||
auth: true
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "站点个性化",
|
||||
name: "SiteSetting",
|
||||
@@ -91,6 +101,7 @@ export const sysResources = [
|
||||
permission: "sys:settings:view"
|
||||
}
|
||||
},
|
||||
|
||||
// {
|
||||
// title: "商业版设置",
|
||||
// name: "SysCommercial",
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import { request } from "/@/api/service";
|
||||
const apiPrefix = "/user/settings";
|
||||
|
||||
export const SettingKeys = {
|
||||
Email: "email"
|
||||
};
|
||||
export async function SettingsGet(key: string) {
|
||||
return await request({
|
||||
url: apiPrefix + "/get",
|
||||
method: "post",
|
||||
params: {
|
||||
key
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export async function SettingsSave(key: string, setting: any) {
|
||||
await request({
|
||||
url: apiPrefix + "/save",
|
||||
method: "post",
|
||||
data: {
|
||||
key,
|
||||
setting: JSON.stringify(setting)
|
||||
}
|
||||
});
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { request } from "/@/api/service";
|
||||
import { request } from "/src/api/service";
|
||||
const apiPrefix = "/basic/email";
|
||||
|
||||
export async function TestSend(receiver: string) {
|
||||
@@ -4,7 +4,8 @@ const apiPrefix = "/sys/settings";
|
||||
|
||||
export const SettingKeys = {
|
||||
SysPublic: "sys.public",
|
||||
SysPrivate: "sys.private"
|
||||
SysPrivate: "sys.private",
|
||||
SysEmail: "sys.email"
|
||||
};
|
||||
export async function SettingsGet(key: string) {
|
||||
return await request({
|
||||
@@ -27,6 +28,13 @@ export async function SettingsSave(key: string, setting: any) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function EmailSettingsGet() {
|
||||
await request({
|
||||
url: apiPrefix + "/getEmailSettings",
|
||||
method: "post"
|
||||
});
|
||||
}
|
||||
|
||||
export async function PublicSettingsSave(setting: any) {
|
||||
await request({
|
||||
url: apiPrefix + "/savePublicSettings",
|
||||
|
||||
+5
-9
@@ -82,7 +82,7 @@ import * as api from "./api";
|
||||
import { SettingKeys } from "./api";
|
||||
import * as emailApi from "./api.email";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
import { useSettingStore } from "/src/store/modules/settings";
|
||||
|
||||
defineOptions({
|
||||
name: "EmailSetting"
|
||||
@@ -114,19 +114,15 @@ const formState = reactive<Partial<FormState>>({
|
||||
});
|
||||
|
||||
async function load() {
|
||||
const data: any = await api.SettingsGet(SettingKeys.Email);
|
||||
if (!data?.setting) {
|
||||
return;
|
||||
}
|
||||
const setting = JSON.parse(data.setting);
|
||||
Object.assign(formState, setting);
|
||||
const data: any = await api.EmailSettingsGet();
|
||||
_.merge(formState, data);
|
||||
}
|
||||
|
||||
load();
|
||||
|
||||
const onFinish = async (form: any) => {
|
||||
console.log("Success:", form);
|
||||
await api.SettingsSave(SettingKeys.Email, form);
|
||||
await api.SettingsSave(SettingKeys.SysEmail, form);
|
||||
notification.success({
|
||||
message: "保存成功"
|
||||
});
|
||||
@@ -137,7 +133,7 @@ const onFinishFailed = (errorInfo: any) => {
|
||||
};
|
||||
|
||||
async function onUsePlusChanged() {
|
||||
await api.SettingsSave(SettingKeys.Email, formState);
|
||||
await api.SettingsSave(SettingKeys.SysEmail, formState);
|
||||
}
|
||||
|
||||
interface TestFormState {
|
||||
Reference in New Issue
Block a user