mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
chore: lib-server
This commit is contained in:
@@ -55,7 +55,7 @@ export function errorLog(error: any) {
|
||||
if (error.response?.data?.message) {
|
||||
message = error.response.data.message;
|
||||
}
|
||||
if (message.indexOf("ssl3_get_record:wrong version number" > -1)) {
|
||||
if (message.indexOf("ssl3_get_record:wrong version number") >= 0) {
|
||||
message = "http协议错误,服务端要求http协议,请检查是否使用了https请求";
|
||||
}
|
||||
// 显示提示
|
||||
|
||||
@@ -150,35 +150,69 @@ function openUpgrade() {
|
||||
content: () => {
|
||||
const vipLabel = userStore.vipLabel;
|
||||
return (
|
||||
<div class="mt-10 mb-10">
|
||||
<div>
|
||||
<div class="mt-10 mb-10 vip-active-modal">
|
||||
<div class="vip-type-vs">
|
||||
<a-row gutter={20}>
|
||||
<a-col span={8}>
|
||||
<h3 class="block-header">免费版</h3>
|
||||
<ul>
|
||||
<li>证书申请功能无限制</li>
|
||||
<li>证书流水线数量限制10条</li>
|
||||
<li>部分部署插件不可用</li>
|
||||
<li>
|
||||
<fs-icon class="color-green" icon="ion:checkmark-sharp"></fs-icon>证书申请功能无限制
|
||||
</li>
|
||||
<li>
|
||||
<fs-icon class="color-green" icon="ion:checkmark-sharp"></fs-icon>
|
||||
证书流水线数量10条
|
||||
</li>
|
||||
<li>
|
||||
<fs-icon class="color-green" icon="ion:checkmark-sharp"></fs-icon>
|
||||
常用的部署插件
|
||||
</li>
|
||||
</ul>
|
||||
</a-col>
|
||||
<a-col span={8}>
|
||||
<h3 class="block-header">专业版</h3>
|
||||
<ul>
|
||||
<li>可加VIP群,需求优先实现</li>
|
||||
<li>证书流水线数量无限制</li>
|
||||
<li>免配置发邮件功能</li>
|
||||
<li>宝塔、易盾、群晖、cdnfly、1Panel等部署插件</li>
|
||||
<li>多用户有限制</li>
|
||||
<li>
|
||||
<fs-icon class="color-green" icon="ion:checkmark-sharp"></fs-icon>
|
||||
可加VIP群,需求优先实现
|
||||
</li>
|
||||
<li>
|
||||
<fs-icon class="color-green" icon="ion:checkmark-sharp"></fs-icon>
|
||||
证书流水线数量无限制
|
||||
</li>
|
||||
<li>
|
||||
<fs-icon class="color-green" icon="ion:checkmark-sharp"></fs-icon>
|
||||
免配置发邮件功能
|
||||
</li>
|
||||
<li>
|
||||
<fs-icon class="color-green" icon="ion:checkmark-sharp"></fs-icon>
|
||||
支持宝塔、易盾、群晖、cdnfly、1Panel等部署插件
|
||||
</li>
|
||||
</ul>
|
||||
</a-col>
|
||||
<a-col span={8}>
|
||||
<h3 class="block-header">商业版</h3>
|
||||
<ul>
|
||||
<li>拥有专业版所有特权</li>
|
||||
<li>修改logo、标题</li>
|
||||
<li>多用户无限制</li>
|
||||
<li>支持用户支付</li>
|
||||
<li>允许商用</li>
|
||||
<li>
|
||||
<fs-icon class="color-green" icon="ion:checkmark-sharp"></fs-icon>
|
||||
拥有专业版所有特权
|
||||
</li>
|
||||
<li>
|
||||
<fs-icon class="color-green" icon="ion:checkmark-sharp"></fs-icon>
|
||||
修改logo、标题
|
||||
</li>
|
||||
<li>
|
||||
<fs-icon class="color-green" icon="ion:checkmark-sharp"></fs-icon>
|
||||
多用户无限制
|
||||
</li>
|
||||
<li>
|
||||
<fs-icon class="color-green" icon="ion:checkmark-sharp"></fs-icon>
|
||||
支持用户支付
|
||||
</li>
|
||||
<li>
|
||||
<fs-icon class="color-green" icon="ion:checkmark-sharp"></fs-icon>
|
||||
允许商用
|
||||
</li>
|
||||
</ul>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -224,4 +258,18 @@ function openUpgrade() {
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.vip-active-modal {
|
||||
ul {
|
||||
list-style-type: unset;
|
||||
margin-left: 0px;
|
||||
padding: 0;
|
||||
}
|
||||
.vip-type-vs {
|
||||
.fs-icon {
|
||||
margin-right: 5px;
|
||||
color: green;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -86,6 +86,7 @@ import { env } from "../utils/util.env";
|
||||
import FsThemeModeSet from "./components/theme/mode-set.vue";
|
||||
import VipButton from "/@/components/vip-button/index.vue";
|
||||
import TutorialButton from "/@/components/tutorial/index.vue";
|
||||
import { useUserStore } from "/@/store/modules/user";
|
||||
export default {
|
||||
name: "LayoutFramework",
|
||||
// eslint-disable-next-line vue/no-unused-components
|
||||
@@ -130,7 +131,10 @@ export default {
|
||||
const version = ref(import.meta.env.VITE_APP_VERSION);
|
||||
|
||||
const envRef = ref(env);
|
||||
|
||||
const userStore = useUserStore();
|
||||
return {
|
||||
userStore,
|
||||
version,
|
||||
frameworkMenus,
|
||||
headerMenus,
|
||||
|
||||
@@ -75,6 +75,33 @@ export const sysResources = [
|
||||
},
|
||||
path: "/sys/account",
|
||||
component: "/sys/account/index.vue"
|
||||
},
|
||||
{
|
||||
title: "站点个性化",
|
||||
name: "site",
|
||||
meta: {
|
||||
icon: "ion:document-text-outline",
|
||||
permission: "sys:settings:view"
|
||||
},
|
||||
component: "/sys/site/index.vue"
|
||||
},
|
||||
{
|
||||
title: "商业版设置",
|
||||
name: "/sys/commercial",
|
||||
meta: {
|
||||
icon: "ion:document-text-outline",
|
||||
permission: "sys:settings:view"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
title: "套餐设置",
|
||||
name: "suite",
|
||||
meta: {
|
||||
icon: "ion:document-text-outline",
|
||||
permission: "sys:settings:view"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
// @ts-ignore
|
||||
import { request } from "/src/api/service";
|
||||
const apiPrefix = "/sys/settings";
|
||||
|
||||
export const SettingKeys = {
|
||||
SysPublic: "sys.public",
|
||||
SysPrivate: "sys.private"
|
||||
};
|
||||
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)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export async function PublicSettingsSave(setting: any) {
|
||||
await request({
|
||||
url: apiPrefix + "/savePublicSettings",
|
||||
method: "post",
|
||||
data: setting
|
||||
});
|
||||
}
|
||||
|
||||
export async function stopOtherUserTimer() {
|
||||
await request({
|
||||
url: apiPrefix + "/stopOtherUserTimer",
|
||||
method: "post"
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<fs-page class="page-sys-settings">
|
||||
<template #header>
|
||||
<div class="title">站点个性化设置</div>
|
||||
</template>
|
||||
<div class="sys-settings-form">
|
||||
<a-form
|
||||
:model="formState"
|
||||
name="basic"
|
||||
:label-col="{ span: 8 }"
|
||||
:wrapper-col="{ span: 16 }"
|
||||
autocomplete="off"
|
||||
@finish="onFinish"
|
||||
@finish-failed="onFinishFailed"
|
||||
>
|
||||
<a-form-item label="开启自助注册" name="registerEnabled">
|
||||
<a-switch v-model:checked="formState.registerEnabled" />
|
||||
</a-form-item>
|
||||
<a-form-item label="管理其他用户流水线" name="managerOtherUserPipeline">
|
||||
<a-switch v-model:checked="formState.managerOtherUserPipeline" />
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="启动后触发流水线" name="triggerOnStartup">-->
|
||||
<!-- <a-switch v-model:checked="formState.triggerOnStartup" />-->
|
||||
<!-- <div class="helper">启动后自动触发一次所有已启用的流水线</div>-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item :wrapper-col="{ offset: 8, span: 16 }">
|
||||
<a-button type="primary" html-type="submit">保存</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
|
||||
<!-- <a-descriptions label="系统维护操作">-->
|
||||
<!-- <a-descriptions-item label="自动化任务">-->
|
||||
<!-- <a-button @click="stopOtherUserTimer">停止所有其他用户的定时任务</a-button>-->
|
||||
<!-- </a-descriptions-item>-->
|
||||
<!-- </a-descriptions>-->
|
||||
</div>
|
||||
</fs-page>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive } from "vue";
|
||||
import * as api from "./api";
|
||||
import { PublicSettingsSave, SettingKeys } from "./api";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { useSettingStore } from "/src/store/modules/settings";
|
||||
|
||||
interface FormState {
|
||||
title: string;
|
||||
logo: string;
|
||||
}
|
||||
|
||||
const formState = reactive<Partial<FormState>>({
|
||||
registerEnabled: false,
|
||||
managerOtherUserPipeline: false
|
||||
});
|
||||
|
||||
async function loadSysPublicSettings() {
|
||||
const data: any = await api.SettingsGet(SettingKeys.SysPublic);
|
||||
const setting = JSON.parse(data.setting);
|
||||
Object.assign(formState, setting);
|
||||
}
|
||||
|
||||
loadSysPublicSettings();
|
||||
const settingsStore = useSettingStore();
|
||||
const onFinish = async (form: any) => {
|
||||
await api.PublicSettingsSave(form);
|
||||
await settingsStore.loadSysSettings();
|
||||
notification.success({
|
||||
message: "保存成功"
|
||||
});
|
||||
};
|
||||
|
||||
const onFinishFailed = (errorInfo: any) => {
|
||||
// console.log("Failed:", errorInfo);
|
||||
};
|
||||
|
||||
async function stopOtherUserTimer() {
|
||||
await api.stopOtherUserTimer();
|
||||
notification.success({
|
||||
message: "停止成功"
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.page-sys-settings {
|
||||
.sys-settings-form {
|
||||
width: 500px;
|
||||
margin: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user