mirror of
https://github.com/certd/certd.git
synced 2026-05-14 03:57:30 +08:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8d8304e859 | |||
| 6ddc23e2aa | |||
| 2fc491015e | |||
| bb0afe1fa7 | |||
| eb46f8c776 | |||
| bd511f97cb | |||
| 560bf40e4b | |||
| 4f4652c1cd | |||
| 60e13c2a1d | |||
| 1fe0dc4d16 | |||
| 181a1e3c0a | |||
| 6bba771856 | |||
| 921f1f42fb |
Vendored
+1
-1
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features"
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"editor.tabSize": 2,
|
||||
"explorer.autoReveal": false,
|
||||
|
||||
@@ -3,6 +3,21 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 阿里云esa查询证书限制接口无效,改成配置证书数量上限检查方式进行清理 ([2302567](https://github.com/certd/certd/commit/230256793f8ad87ef8a0738c37108bf7b5ab9853))
|
||||
* 某些情况下登陆页面没有显示重置密码文档链接的问题 ([40801d0](https://github.com/certd/certd/commit/40801d0a0668c77adb57fae42b4b6615b198a88d))
|
||||
* 修复部署到火山引擎vod,获取域名列表为空的bug ([0719f4c](https://github.com/certd/certd/commit/0719f4c99e9198544d03431107b53652e076e881))
|
||||
* 修复litessl new-nonce报428的bug ([540ef96](https://github.com/certd/certd/commit/540ef967457a7871637cfdb5012ed1fa3261757b))
|
||||
* 修复oidc配置取消后获取登出地址失败后无法列出oauth列表的bug ([eb5de15](https://github.com/certd/certd/commit/eb5de150332fd914c56b812c3ba2c2445f902bb7))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 将重置密码的日志挪到启动成功之后,方便查看 ([0fa9b34](https://github.com/certd/certd/commit/0fa9b344e08cf355aee7a7566f061cc5d95dc374))
|
||||
* 支持绑定两个url地址 ([a2e9a41](https://github.com/certd/certd/commit/a2e9a41a7e712395c0e3ee6fe55b370aa1fc1f12))
|
||||
|
||||
## [1.38.4](https://github.com/certd/certd/compare/v1.38.3...v1.38.4) (2026-01-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"notice": "永久专业版上线,新用户立减50,升级到最新版点击下方“立即赞助”按钮前往获取",
|
||||
"plus": {
|
||||
"name": "专业版",
|
||||
"price": "89.9",
|
||||
"price3": "199",
|
||||
"tooltip": "开源需要您的赞助支持",
|
||||
"priceText":"¥89.9/年",
|
||||
"discountText":"永久专业版50优惠券立即领取"
|
||||
},
|
||||
"comm": {
|
||||
"name": "商业版",
|
||||
"price": "399",
|
||||
"price3": "899",
|
||||
"tooltip": "3年优惠300",
|
||||
"priceText":"¥399/年",
|
||||
"discountText":"¥899/3年(3年优惠300)"
|
||||
},
|
||||
"app":{
|
||||
"minVersion":"1.36.0",
|
||||
"minVersionTip":"版本过低,为了您的数据安全,请尽快升级"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -52,3 +52,11 @@ service:
|
||||
3. DNS 有其他平台申请过的_acme-challenge记录,删除即可
|
||||
|
||||
|
||||
## 7. DNS problem: NXDOMAIN looking up TXT for _acme-challenge.xxx
|
||||
`
|
||||
DNS problem: NXDOMAIN looking up TXT for _acme-challenge.xxxxx - check that a DNS record exists for this domain
|
||||
`
|
||||
证书颁发机构向域名ns查询TXT验证记录失败,有以下几种可能
|
||||
1、域名的ns服务器修改成别的了,但申请证书时的DNS提供商选择错误(检查确认,配置正确的DNS提供商)
|
||||
2、证书颁发机构与ns域名服务器之间访问不通,无法查询到TXT记录(尝试更换证书颁发机构)
|
||||
3、ns服务商解析值生效慢(尝试修改证书申请任务里面的等待生效时长600-1000s)
|
||||
@@ -70,5 +70,5 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||
},
|
||||
"gitHead": "84291482732687cc8162c6505666ba2b29b02918"
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
}
|
||||
|
||||
@@ -47,5 +47,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "84291482732687cc8162c6505666ba2b29b02918"
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
}
|
||||
|
||||
@@ -45,5 +45,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "84291482732687cc8162c6505666ba2b29b02918"
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
}
|
||||
|
||||
@@ -24,5 +24,5 @@
|
||||
"prettier": "^2.8.8",
|
||||
"tslib": "^2.8.1"
|
||||
},
|
||||
"gitHead": "84291482732687cc8162c6505666ba2b29b02918"
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
}
|
||||
|
||||
@@ -31,5 +31,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "84291482732687cc8162c6505666ba2b29b02918"
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
}
|
||||
|
||||
@@ -56,5 +56,5 @@
|
||||
"fetch"
|
||||
]
|
||||
},
|
||||
"gitHead": "84291482732687cc8162c6505666ba2b29b02918"
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
}
|
||||
|
||||
@@ -32,5 +32,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "84291482732687cc8162c6505666ba2b29b02918"
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
}
|
||||
|
||||
@@ -64,5 +64,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "84291482732687cc8162c6505666ba2b29b02918"
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
}
|
||||
|
||||
@@ -65,6 +65,8 @@ export class SysPublicSettings extends BaseSettings {
|
||||
}> = {};
|
||||
|
||||
notice?: string;
|
||||
|
||||
adminMode?: "enterprise" | "saas" = "saas";
|
||||
}
|
||||
|
||||
export class SysPrivateSettings extends BaseSettings {
|
||||
|
||||
@@ -21,6 +21,9 @@ export class AccessEntity {
|
||||
@Column({ name: 'encrypt_setting', comment: '已加密设置', length: 10240, nullable: true })
|
||||
encryptSetting: string;
|
||||
|
||||
@Column({ name: 'project_id', comment: '项目id' })
|
||||
projectId: number;
|
||||
|
||||
@Column({
|
||||
name: 'create_time',
|
||||
comment: '创建时间',
|
||||
|
||||
@@ -28,6 +28,9 @@ export class AddonEntity {
|
||||
@Column({ name: 'is_default', comment: '是否默认', nullable: false, default: false })
|
||||
isDefault: boolean;
|
||||
|
||||
@Column({ name: 'project_id', comment: '项目id' })
|
||||
projectId: number;
|
||||
|
||||
|
||||
@Column({
|
||||
name: 'create_time',
|
||||
|
||||
@@ -46,5 +46,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "84291482732687cc8162c6505666ba2b29b02918"
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
}
|
||||
|
||||
@@ -38,5 +38,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "84291482732687cc8162c6505666ba2b29b02918"
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
}
|
||||
|
||||
@@ -57,5 +57,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "84291482732687cc8162c6505666ba2b29b02918"
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
:options="optionsRef"
|
||||
:value="value"
|
||||
v-bind="attrs"
|
||||
:open="openProp"
|
||||
@click="onClick"
|
||||
@update:value="emit('update:value', $event)"
|
||||
>
|
||||
@@ -56,11 +57,11 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { computed, defineComponent, ref, Ref, useAttrs } from "vue";
|
||||
import { request } from "/@/api/service";
|
||||
import { Dicts } from "../lib/dicts";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useDomainImport, useDomainImportManage } from "/@/views/certd/cert/domain/use";
|
||||
import { Dicts } from "../lib/dicts";
|
||||
import { request } from "/@/api/service";
|
||||
import { openRouteInNewWindow } from "/@/vben/utils";
|
||||
import { useDomainImportManage } from "/@/views/certd/cert/domain/use";
|
||||
|
||||
defineOptions({
|
||||
name: "DomainSelector",
|
||||
@@ -82,6 +83,7 @@ const props = defineProps<{
|
||||
search?: boolean;
|
||||
pager?: boolean;
|
||||
value?: any[];
|
||||
open?: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -90,6 +92,15 @@ const emit = defineEmits<{
|
||||
|
||||
const attrs = useAttrs();
|
||||
|
||||
const hasOptions: Ref = ref(null);
|
||||
|
||||
const openProp = computed(() => {
|
||||
if (hasOptions.value == null) {
|
||||
return false;
|
||||
}
|
||||
return hasOptions.value;
|
||||
});
|
||||
|
||||
const searchKeyRef = ref("");
|
||||
const optionsRef = ref([]);
|
||||
const message = ref("");
|
||||
@@ -143,6 +154,13 @@ const getOptions = async () => {
|
||||
}
|
||||
|
||||
optionsRef.value = options;
|
||||
if (hasOptions.value == null) {
|
||||
if (options.length > 0) {
|
||||
hasOptions.value = true;
|
||||
} else {
|
||||
hasOptions.value = false;
|
||||
}
|
||||
}
|
||||
pagerRef.value.total = list.length;
|
||||
if (props.pager) {
|
||||
if (res.total != null) {
|
||||
|
||||
@@ -208,6 +208,10 @@ export default {
|
||||
orderManager: "Order Management",
|
||||
userSuites: "User Suites",
|
||||
netTest: "Network Test",
|
||||
|
||||
enterpriseSetting: "Enterprise Settings",
|
||||
projectManager: "Project Management",
|
||||
projectUserManager: "Project User Management",
|
||||
},
|
||||
certificateRepo: {
|
||||
title: "Certificate Repository",
|
||||
@@ -861,4 +865,8 @@ export default {
|
||||
select: "Select",
|
||||
placeholder: "select please",
|
||||
},
|
||||
adminMode: {
|
||||
enterpriseMode: "Enterprise Mode",
|
||||
saasMode: "SaaS Mode",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -120,7 +120,7 @@ export default {
|
||||
},
|
||||
customPipeline: "自定义流水线",
|
||||
createCertdPipeline: "创建证书流水线",
|
||||
commercialCertHosting: "商用证书托管",
|
||||
commercialCertHosting: "已有证书托管",
|
||||
tooltip: {
|
||||
manualUploadOwnCert: "手动上传自有证书,执行自动部署",
|
||||
noAutoApplyCommercialCert: "并不能自动申请商业证书",
|
||||
@@ -214,6 +214,9 @@ export default {
|
||||
orderManager: "订单管理",
|
||||
userSuites: "用户套餐",
|
||||
netTest: "网络测试",
|
||||
enterpriseSetting: "企业管理设置",
|
||||
projectManager: "项目管理",
|
||||
projectUserManager: "项目用户管理",
|
||||
},
|
||||
certificateRepo: {
|
||||
title: "证书仓库",
|
||||
@@ -876,4 +879,11 @@ export default {
|
||||
select: "选择",
|
||||
placeholder: "请选择",
|
||||
},
|
||||
adminMode: {
|
||||
enterpriseMode: "企业模式",
|
||||
saasMode: "SaaS模式",
|
||||
},
|
||||
ent: {
|
||||
projectName: "项目名称",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -187,7 +187,59 @@ export const sysResources = [
|
||||
keepAlive: true,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
title: "certd.sysResources.enterpriseManager",
|
||||
name: "EnterpriseManager",
|
||||
path: "/sys/enterprise",
|
||||
redirect: "/sys/enterprise/project",
|
||||
meta: {
|
||||
icon: "ion:cart-outline",
|
||||
permission: "sys:settings:edit",
|
||||
show: () => {
|
||||
const settingStore = useSettingStore();
|
||||
return settingStore.isEnterprise;
|
||||
},
|
||||
keepAlive: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
title: "certd.sysResources.projectManager",
|
||||
name: "ProjectManager",
|
||||
path: "/sys/enterprise/project",
|
||||
component: "/sys/enterprise/project/index.vue",
|
||||
meta: {
|
||||
show: true,
|
||||
icon: "ion:cart",
|
||||
permission: "sys:settings:edit",
|
||||
keepAlive: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "certd.sysResources.projectMemberManager",
|
||||
name: "ProjectMemberManager",
|
||||
path: "/sys/enterprise/project/member",
|
||||
component: "/sys/enterprise/project/member/index.vue",
|
||||
meta: {
|
||||
isMenu: false,
|
||||
show: true,
|
||||
icon: "ion:cart",
|
||||
permission: "sys:settings:edit",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "certd.sysResources.enterpriseSetting",
|
||||
name: "EnterpriseSetting",
|
||||
path: "/sys/enterprise/setting",
|
||||
redirect: "/sys/settings?tab=enterprise",
|
||||
meta: {
|
||||
isMenu: true,
|
||||
show: true,
|
||||
icon: "ion:cart",
|
||||
permission: "sys:settings:edit",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "certd.sysResources.suiteManager",
|
||||
name: "SuiteManager",
|
||||
|
||||
@@ -86,6 +86,9 @@ export type SysPublicSetting = {
|
||||
>;
|
||||
// 系统通知
|
||||
notice?: string;
|
||||
|
||||
// 管理员模式
|
||||
adminMode?: "enterprise" | "saas";
|
||||
};
|
||||
export type SuiteSetting = {
|
||||
enabled?: boolean;
|
||||
|
||||
@@ -141,6 +141,9 @@ export const useSettingStore = defineStore({
|
||||
isComm(): boolean {
|
||||
return this.plusInfo?.isComm && (this.plusInfo?.expireTime === -1 || this.plusInfo?.expireTime > new Date().getTime());
|
||||
},
|
||||
isEnterprise(): boolean {
|
||||
return this.isPlus && this.sysPublic.adminMode === "enterprise";
|
||||
},
|
||||
isAgent(): boolean {
|
||||
return this.siteEnv?.agent?.enabled === true;
|
||||
},
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
import { request } from "/src/api/service";
|
||||
|
||||
const apiPrefix = "/sys/project/provider";
|
||||
|
||||
export async function GetList(query: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/page",
|
||||
method: "post",
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
|
||||
export async function AddObj(obj: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/add",
|
||||
method: "post",
|
||||
data: obj,
|
||||
});
|
||||
}
|
||||
|
||||
export async function UpdateObj(obj: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/update",
|
||||
method: "post",
|
||||
data: obj,
|
||||
});
|
||||
}
|
||||
|
||||
export async function DelObj(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/delete",
|
||||
method: "post",
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
export async function GetObj(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/info",
|
||||
method: "post",
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
export async function GetDetail(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/detail",
|
||||
method: "post",
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
export async function DeleteBatch(ids: any[]) {
|
||||
return await request({
|
||||
url: apiPrefix + "/deleteByIds",
|
||||
method: "post",
|
||||
data: { ids },
|
||||
});
|
||||
}
|
||||
|
||||
export async function SetDefault(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/setDefault",
|
||||
method: "post",
|
||||
data: { id },
|
||||
});
|
||||
}
|
||||
|
||||
export async function SetDisabled(id: any, disabled: boolean) {
|
||||
return await request({
|
||||
url: apiPrefix + "/setDisabled",
|
||||
method: "post",
|
||||
data: { id, disabled },
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
import * as api from "./api";
|
||||
import { useI18n } from "/src/locales";
|
||||
import { computed, Ref, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, utils } from "@fast-crud/fast-crud";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { Modal } from "ant-design-vue";
|
||||
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
return await api.GetList(query);
|
||||
};
|
||||
const editRequest = async ({ form, row }: EditReq) => {
|
||||
form.id = row.id;
|
||||
const res = await api.UpdateObj(form);
|
||||
return res;
|
||||
};
|
||||
const delRequest = async ({ row }: DelReq) => {
|
||||
return await api.DelObj(row.id);
|
||||
};
|
||||
|
||||
const addRequest = async ({ form }: AddReq) => {
|
||||
const res = await api.AddObj(form);
|
||||
return res;
|
||||
};
|
||||
|
||||
const userStore = useUserStore();
|
||||
const settingStore = useSettingStore();
|
||||
const selectedRowKeys: Ref<any[]> = ref([]);
|
||||
context.selectedRowKeys = selectedRowKeys;
|
||||
|
||||
return {
|
||||
crudOptions: {
|
||||
settings: {
|
||||
plugins: {
|
||||
//这里使用行选择插件,生成行选择crudOptions配置,最终会与crudOptions合并
|
||||
rowSelection: {
|
||||
enabled: true,
|
||||
order: -2,
|
||||
before: true,
|
||||
// handle: (pluginProps,useCrudProps)=>CrudOptions,
|
||||
props: {
|
||||
multiple: true,
|
||||
crossPage: true,
|
||||
selectedRowKeys,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
request: {
|
||||
pageRequest,
|
||||
addRequest,
|
||||
editRequest,
|
||||
delRequest,
|
||||
},
|
||||
rowHandle: {
|
||||
minWidth: 200,
|
||||
fixed: "right",
|
||||
},
|
||||
columns: {
|
||||
id: {
|
||||
title: "ID",
|
||||
key: "id",
|
||||
type: "number",
|
||||
column: {
|
||||
width: 100,
|
||||
},
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
domain: {
|
||||
title: t("certd.cnameDomain"),
|
||||
type: "text",
|
||||
editForm: {
|
||||
component: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
form: {
|
||||
component: {
|
||||
placeholder: t("certd.cnameDomainPlaceholder"),
|
||||
},
|
||||
helper: t("certd.cnameDomainHelper"),
|
||||
rules: [
|
||||
{ required: true, message: t("certd.requiredField") },
|
||||
{ pattern: /^[^*]+$/, message: t("certd.cnameDomainPattern") },
|
||||
],
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
},
|
||||
},
|
||||
dnsProviderType: {
|
||||
title: t("certd.dnsProvider"),
|
||||
type: "dict-select",
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
dict: dict({
|
||||
url: "pi/dnsProvider/list",
|
||||
value: "key",
|
||||
label: "title",
|
||||
}),
|
||||
form: {
|
||||
rules: [{ required: true, message: t("certd.requiredField") }],
|
||||
},
|
||||
column: {
|
||||
width: 150,
|
||||
component: {
|
||||
color: "auto",
|
||||
},
|
||||
},
|
||||
},
|
||||
accessId: {
|
||||
title: t("certd.dnsProviderAuthorization"),
|
||||
type: "dict-select",
|
||||
dict: dict({
|
||||
url: "/pi/access/list",
|
||||
value: "id",
|
||||
label: "name",
|
||||
}),
|
||||
form: {
|
||||
component: {
|
||||
name: "access-selector",
|
||||
vModel: "modelValue",
|
||||
type: compute(({ form }) => {
|
||||
return form.dnsProviderType;
|
||||
}),
|
||||
},
|
||||
rules: [{ required: true, message: t("certd.requiredField") }],
|
||||
},
|
||||
column: {
|
||||
width: 150,
|
||||
component: {
|
||||
color: "auto",
|
||||
},
|
||||
},
|
||||
},
|
||||
isDefault: {
|
||||
title: t("certd.isDefault"),
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: t("certd.yes"), value: true, color: "success" },
|
||||
{ label: t("certd.no"), value: false, color: "default" },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
value: false,
|
||||
rules: [{ required: true, message: t("certd.selectIsDefault") }],
|
||||
},
|
||||
column: {
|
||||
align: "center",
|
||||
width: 100,
|
||||
},
|
||||
},
|
||||
setDefault: {
|
||||
title: t("certd.setDefault"),
|
||||
type: "text",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
align: "center",
|
||||
conditionalRenderDisabled: true,
|
||||
cellRender: ({ row }) => {
|
||||
if (row.isDefault) {
|
||||
return;
|
||||
}
|
||||
const onClick = async () => {
|
||||
Modal.confirm({
|
||||
title: t("certd.prompt"),
|
||||
content: t("certd.confirmSetDefault"),
|
||||
onOk: async () => {
|
||||
await api.SetDefault(row.id);
|
||||
await crudExpose.doRefresh();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<a-button type={"link"} size={"small"} onClick={onClick}>
|
||||
{t("certd.setAsDefault")}
|
||||
</a-button>
|
||||
);
|
||||
},
|
||||
},
|
||||
},
|
||||
disabled: {
|
||||
title: t("certd.disabled"),
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: t("certd.enabled"), value: false, color: "success" },
|
||||
{ label: t("certd.disabledLabel"), value: true, color: "error" },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
value: false,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
title: t("certd.clickToToggle"),
|
||||
on: {
|
||||
async click({ value, row }) {
|
||||
Modal.confirm({
|
||||
title: t("certd.prompt"),
|
||||
content: t("certd.confirmToggleStatus", { action: !value ? t("certd.disable") : t("certd.enable") }),
|
||||
onOk: async () => {
|
||||
await api.SetDisabled(row.id, !value);
|
||||
await crudExpose.doRefresh();
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
createTime: {
|
||||
title: t("certd.createTime"),
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
sorter: true,
|
||||
width: 160,
|
||||
align: "center",
|
||||
},
|
||||
},
|
||||
updateTime: {
|
||||
title: t("certd.updateTime"),
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
show: true,
|
||||
width: 160,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<fs-page class="page-cert">
|
||||
<template #header>
|
||||
<div class="title">
|
||||
{{ t("certd.cnameTitle") }}
|
||||
<span class="sub">
|
||||
{{ t("certd.cnameDescription") }}
|
||||
<a href="https://certd.docmirror.cn/guide/feature/cname/" target="_blank">
|
||||
{{ t("certd.cnameLinkText") }}
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<fs-crud ref="crudRef" v-bind="crudBinding">
|
||||
<template #pagination-left>
|
||||
<a-tooltip :title="t('certd.batchDelete')">
|
||||
<fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
</fs-crud>
|
||||
</fs-page>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onActivated, onMounted } from "vue";
|
||||
import { useFs } from "@fast-crud/fast-crud";
|
||||
import createCrudOptions from "./crud";
|
||||
import { message, Modal } from "ant-design-vue";
|
||||
import { DeleteBatch } from "./api";
|
||||
import { useI18n } from "/src/locales";
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
defineOptions({
|
||||
name: "CnameProvider",
|
||||
});
|
||||
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
|
||||
|
||||
const selectedRowKeys = context.selectedRowKeys;
|
||||
const handleBatchDelete = () => {
|
||||
if (selectedRowKeys.value?.length > 0) {
|
||||
Modal.confirm({
|
||||
title: t("certd.confirmTitle"),
|
||||
content: t("certd.confirmDeleteBatch", { count: selectedRowKeys.value.length }),
|
||||
async onOk() {
|
||||
await DeleteBatch(selectedRowKeys.value);
|
||||
message.info(t("certd.deleteSuccess"));
|
||||
crudExpose.doRefresh();
|
||||
selectedRowKeys.value = [];
|
||||
},
|
||||
});
|
||||
} else {
|
||||
message.error(t("certd.selectRecordsFirst"));
|
||||
}
|
||||
};
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
crudExpose.doRefresh();
|
||||
});
|
||||
onActivated(async () => {
|
||||
await crudExpose.doRefresh();
|
||||
});
|
||||
</script>
|
||||
<style lang="less"></style>
|
||||
@@ -0,0 +1,68 @@
|
||||
import { request } from "/src/api/service";
|
||||
|
||||
const apiPrefix = "/sys/enterprise/project";
|
||||
const userApiPrefix = "/sys/authority/user";
|
||||
|
||||
export async function GetList(query: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/page",
|
||||
method: "post",
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
|
||||
export async function AddObj(obj: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/add",
|
||||
method: "post",
|
||||
data: obj,
|
||||
});
|
||||
}
|
||||
|
||||
export async function UpdateObj(obj: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/update",
|
||||
method: "post",
|
||||
data: obj,
|
||||
});
|
||||
}
|
||||
|
||||
export async function DelObj(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/delete",
|
||||
method: "post",
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
export async function GetObj(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/info",
|
||||
method: "post",
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
export async function GetDetail(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/detail",
|
||||
method: "post",
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
export async function DeleteBatch(ids: any[]) {
|
||||
return await request({
|
||||
url: apiPrefix + "/deleteByIds",
|
||||
method: "post",
|
||||
data: { ids },
|
||||
});
|
||||
}
|
||||
|
||||
export async function SetDisabled(id: any, disabled: boolean) {
|
||||
return await request({
|
||||
url: apiPrefix + "/setDisabled",
|
||||
method: "post",
|
||||
data: { id, disabled },
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
import * as api from "./api";
|
||||
import { useI18n } from "/src/locales";
|
||||
import { computed, Ref, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, utils } from "@fast-crud/fast-crud";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { Modal } from "ant-design-vue";
|
||||
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
return await api.GetList(query);
|
||||
};
|
||||
const editRequest = async ({ form, row }: EditReq) => {
|
||||
form.id = row.id;
|
||||
const res = await api.UpdateObj(form);
|
||||
return res;
|
||||
};
|
||||
const delRequest = async ({ row }: DelReq) => {
|
||||
return await api.DelObj(row.id);
|
||||
};
|
||||
|
||||
const addRequest = async ({ form }: AddReq) => {
|
||||
const res = await api.AddObj(form);
|
||||
return res;
|
||||
};
|
||||
|
||||
const userStore = useUserStore();
|
||||
const settingStore = useSettingStore();
|
||||
const selectedRowKeys: Ref<any[]> = ref([]);
|
||||
context.selectedRowKeys = selectedRowKeys;
|
||||
|
||||
return {
|
||||
crudOptions: {
|
||||
settings: {
|
||||
plugins: {
|
||||
//这里使用行选择插件,生成行选择crudOptions配置,最终会与crudOptions合并
|
||||
rowSelection: {
|
||||
enabled: true,
|
||||
order: -2,
|
||||
before: true,
|
||||
// handle: (pluginProps,useCrudProps)=>CrudOptions,
|
||||
props: {
|
||||
multiple: true,
|
||||
crossPage: true,
|
||||
selectedRowKeys,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
request: {
|
||||
pageRequest,
|
||||
addRequest,
|
||||
editRequest,
|
||||
delRequest,
|
||||
},
|
||||
rowHandle: {
|
||||
minWidth: 200,
|
||||
fixed: "right",
|
||||
},
|
||||
columns: {
|
||||
id: {
|
||||
title: "ID",
|
||||
key: "id",
|
||||
type: "number",
|
||||
column: {
|
||||
width: 100,
|
||||
},
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
name: {
|
||||
title: t("certd.ent.projectName"),
|
||||
type: "text",
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
form: {
|
||||
component: {},
|
||||
helper: t("certd.ent.projectNameHelper"),
|
||||
rules: [{ required: true, message: t("certd.requiredField") }],
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
},
|
||||
},
|
||||
disabled: {
|
||||
title: t("certd.disabled"),
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: t("certd.enabled"), value: false, color: "success" },
|
||||
{ label: t("certd.disabledLabel"), value: true, color: "error" },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
value: false,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
title: t("certd.clickToToggle"),
|
||||
on: {
|
||||
async click({ value, row }) {
|
||||
Modal.confirm({
|
||||
title: t("certd.prompt"),
|
||||
content: t("certd.confirmToggleStatus", { action: !value ? t("certd.disable") : t("certd.enable") }),
|
||||
onOk: async () => {
|
||||
await api.SetDisabled(row.id, !value);
|
||||
await crudExpose.doRefresh();
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
createTime: {
|
||||
title: t("certd.createTime"),
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
sorter: true,
|
||||
width: 160,
|
||||
align: "center",
|
||||
},
|
||||
},
|
||||
updateTime: {
|
||||
title: t("certd.updateTime"),
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
show: true,
|
||||
width: 160,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<fs-page class="page-cert">
|
||||
<template #header>
|
||||
<div class="title">
|
||||
{{ t("certd.sysResources.projectManager") }}
|
||||
</div>
|
||||
</template>
|
||||
<fs-crud ref="crudRef" v-bind="crudBinding">
|
||||
<template #pagination-left>
|
||||
<a-tooltip :title="t('certd.batchDelete')">
|
||||
<fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
</fs-crud>
|
||||
</fs-page>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onActivated, onMounted } from "vue";
|
||||
import { useFs } from "@fast-crud/fast-crud";
|
||||
import createCrudOptions from "./crud";
|
||||
import { message, Modal } from "ant-design-vue";
|
||||
import { DeleteBatch } from "./api";
|
||||
import { useI18n } from "/src/locales";
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
defineOptions({
|
||||
name: "ProjectManager",
|
||||
});
|
||||
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
|
||||
|
||||
const selectedRowKeys = context.selectedRowKeys;
|
||||
const handleBatchDelete = () => {
|
||||
if (selectedRowKeys.value?.length > 0) {
|
||||
Modal.confirm({
|
||||
title: t("certd.confirmTitle"),
|
||||
content: t("certd.confirmDeleteBatch", { count: selectedRowKeys.value.length }),
|
||||
async onOk() {
|
||||
await DeleteBatch(selectedRowKeys.value);
|
||||
message.info(t("certd.deleteSuccess"));
|
||||
crudExpose.doRefresh();
|
||||
selectedRowKeys.value = [];
|
||||
},
|
||||
});
|
||||
} else {
|
||||
message.error(t("certd.selectRecordsFirst"));
|
||||
}
|
||||
};
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
crudExpose.doRefresh();
|
||||
});
|
||||
onActivated(async () => {
|
||||
await crudExpose.doRefresh();
|
||||
});
|
||||
</script>
|
||||
<style lang="less"></style>
|
||||
@@ -0,0 +1,67 @@
|
||||
import { request } from "/src/api/service";
|
||||
|
||||
const apiPrefix = "/sys/enterprise/projectMember";
|
||||
const userApiPrefix = "/sys/authority/user";
|
||||
export async function GetList(query: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/page",
|
||||
method: "post",
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
|
||||
export async function AddObj(obj: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/add",
|
||||
method: "post",
|
||||
data: obj,
|
||||
});
|
||||
}
|
||||
|
||||
export async function UpdateObj(obj: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/update",
|
||||
method: "post",
|
||||
data: obj,
|
||||
});
|
||||
}
|
||||
|
||||
export async function DelObj(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/delete",
|
||||
method: "post",
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
export async function GetObj(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/info",
|
||||
method: "post",
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
export async function GetDetail(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/detail",
|
||||
method: "post",
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
export async function DeleteBatch(ids: any[]) {
|
||||
return await request({
|
||||
url: apiPrefix + "/deleteByIds",
|
||||
method: "post",
|
||||
data: { ids },
|
||||
});
|
||||
}
|
||||
|
||||
export async function GetUserSimpleByIds(query: any) {
|
||||
return await request({
|
||||
url: userApiPrefix + "/getSimpleByIds",
|
||||
method: "post",
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
import { Modal } from "ant-design-vue";
|
||||
import { Ref, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import * as api from "./api";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import { useI18n } from "/src/locales";
|
||||
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
return await api.GetList(query);
|
||||
};
|
||||
const editRequest = async ({ form, row }: EditReq) => {
|
||||
form.id = row.id;
|
||||
const res = await api.UpdateObj(form);
|
||||
return res;
|
||||
};
|
||||
const delRequest = async ({ row }: DelReq) => {
|
||||
return await api.DelObj(row.id);
|
||||
};
|
||||
|
||||
const addRequest = async ({ form }: AddReq) => {
|
||||
const res = await api.AddObj(form);
|
||||
return res;
|
||||
};
|
||||
|
||||
const userStore = useUserStore();
|
||||
const settingStore = useSettingStore();
|
||||
const selectedRowKeys: Ref<any[]> = ref([]);
|
||||
context.selectedRowKeys = selectedRowKeys;
|
||||
|
||||
return {
|
||||
crudOptions: {
|
||||
settings: {
|
||||
plugins: {
|
||||
//这里使用行选择插件,生成行选择crudOptions配置,最终会与crudOptions合并
|
||||
rowSelection: {
|
||||
enabled: true,
|
||||
order: -2,
|
||||
before: true,
|
||||
// handle: (pluginProps,useCrudProps)=>CrudOptions,
|
||||
props: {
|
||||
multiple: true,
|
||||
crossPage: true,
|
||||
selectedRowKeys,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
request: {
|
||||
pageRequest,
|
||||
addRequest,
|
||||
editRequest,
|
||||
delRequest,
|
||||
},
|
||||
rowHandle: {
|
||||
minWidth: 200,
|
||||
fixed: "right",
|
||||
},
|
||||
columns: {
|
||||
id: {
|
||||
title: "ID",
|
||||
key: "id",
|
||||
type: "number",
|
||||
column: {
|
||||
width: 100,
|
||||
},
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
projectId: {
|
||||
title: "项目ID",
|
||||
type: "text",
|
||||
search: {
|
||||
show: false,
|
||||
},
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
userId: {
|
||||
title: "用户ID",
|
||||
type: "dict-select",
|
||||
dict: dict({
|
||||
url: "/sys/authority/user/getSimpleUsers",
|
||||
value: "id",
|
||||
label: "nickName",
|
||||
labelBuilder: (item: any) => item.nickName || item.username || item.phoneCode + item.mobile,
|
||||
}),
|
||||
search: {
|
||||
show: false,
|
||||
},
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
permission: {
|
||||
title: t("certd.ent.projectPermission"),
|
||||
type: "dict-select",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: t("certd.read"), value: "read", color: "cyan" },
|
||||
{ label: t("certd.write"), value: "write", color: "blue" },
|
||||
{ label: t("certd.admin"), value: "admin", color: "green" },
|
||||
],
|
||||
}),
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
form: {
|
||||
show: true,
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
},
|
||||
},
|
||||
createTime: {
|
||||
title: t("certd.createTime"),
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
sorter: true,
|
||||
width: 160,
|
||||
align: "center",
|
||||
},
|
||||
},
|
||||
updateTime: {
|
||||
title: t("certd.updateTime"),
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
show: true,
|
||||
width: 160,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<fs-page class="page-project-member">
|
||||
<template #header>
|
||||
<div class="title">
|
||||
{{ t("certd.projectMemberManager") }}
|
||||
<span class="sub">
|
||||
{{ t("certd.projectMemberDescription") }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<fs-crud ref="crudRef" v-bind="crudBinding">
|
||||
<template #pagination-left>
|
||||
<a-tooltip :title="t('certd.batchDelete')">
|
||||
<fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
</fs-crud>
|
||||
</fs-page>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onActivated, onMounted } from "vue";
|
||||
import { useFs } from "@fast-crud/fast-crud";
|
||||
import createCrudOptions from "./crud";
|
||||
import { message, Modal } from "ant-design-vue";
|
||||
import { DeleteBatch } from "./api";
|
||||
import { useI18n } from "/src/locales";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
defineOptions({
|
||||
name: "ProjectMemberManager",
|
||||
});
|
||||
|
||||
const route = useRoute();
|
||||
const projectIdStr = route.query.projectId as string;
|
||||
const projectId = Number(projectIdStr);
|
||||
|
||||
const context: any = {
|
||||
projectId,
|
||||
};
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });
|
||||
|
||||
const selectedRowKeys = context.selectedRowKeys;
|
||||
const handleBatchDelete = () => {
|
||||
if (selectedRowKeys.value?.length > 0) {
|
||||
Modal.confirm({
|
||||
title: t("certd.confirmTitle"),
|
||||
content: t("certd.confirmDeleteBatch", { count: selectedRowKeys.value.length }),
|
||||
async onOk() {
|
||||
await DeleteBatch(selectedRowKeys.value);
|
||||
message.info(t("certd.deleteSuccess"));
|
||||
crudExpose.doRefresh();
|
||||
selectedRowKeys.value = [];
|
||||
},
|
||||
});
|
||||
} else {
|
||||
message.error(t("certd.selectRecordsFirst"));
|
||||
}
|
||||
};
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
crudExpose.doRefresh();
|
||||
});
|
||||
onActivated(async () => {
|
||||
await crudExpose.doRefresh();
|
||||
});
|
||||
</script>
|
||||
<style lang="less"></style>
|
||||
@@ -26,6 +26,9 @@
|
||||
<a-tab-pane key="pipeline" :tab="t('certd.sys.setting.pipelineSetting')">
|
||||
<SettingPipeline v-if="activeKey === 'pipeline'" />
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="mode" :tab="t('certd.adminMode')">
|
||||
<SettingMode v-if="activeKey === 'mode'" />
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</div>
|
||||
</fs-page>
|
||||
@@ -39,6 +42,8 @@ import SettingSafe from "/@/views/sys/settings/tabs/safe.vue";
|
||||
import SettingCaptcha from "/@/views/sys/settings/tabs/captcha.vue";
|
||||
import SettingPipeline from "/@/views/sys/settings/tabs/pipeline.vue";
|
||||
import SettingOauth from "/@/views/sys/settings/tabs/oauth.vue";
|
||||
import SettingMode from "/@/views/sys/settings/tabs/mode.vue";
|
||||
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { ref } from "vue";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
|
||||
@@ -34,7 +34,9 @@
|
||||
<a-select-option value="ipv4first">{{ t("certd.ipv4Priority") }}</a-select-option>
|
||||
<a-select-option value="ipv6first">{{ t("certd.ipv6Priority") }}</a-select-option>
|
||||
</a-select>
|
||||
<div class="helper">{{ t("certd.dualStackNetworkHelper") }}, <a href="https://certd.docmirror.cn/guide/use/setting/ipv6.html" target="_blank">{{ t("certd.helpDocLink") }}</a></div>
|
||||
<div class="helper">
|
||||
{{ t("certd.dualStackNetworkHelper") }}, <a href="https://certd.docmirror.cn/guide/use/setting/ipv6.html" target="_blank">{{ t("certd.helpDocLink") }}</a>
|
||||
</div>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item :label="t('certd.sys.setting.showRunStrategy')" :name="['public', 'showRunStrategy']">
|
||||
@@ -68,8 +70,6 @@ import { useSettingStore } from "/@/store/settings";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { util } from "/@/utils";
|
||||
import { useI18n } from "/src/locales";
|
||||
import AddonSelector from "../../../certd/addon/addon-selector/index.vue";
|
||||
import CaptchaInput from "/@/components/captcha/captcha-input.vue";
|
||||
const { t } = useI18n();
|
||||
|
||||
defineOptions({
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<div class="sys-settings-form sys-settings-mode">
|
||||
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" @finish="onFinish">
|
||||
<a-form-item :label="t('certd.adminMode')" :name="['public', 'adminMode']">
|
||||
<fs-dict-radio v-model:checked="formState.public.adminMode" :dict="adminModeDict" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 8 }">
|
||||
<a-button :loading="saveLoading" type="primary" html-type="submit">{{ t("certd.saveButton") }}</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="tsx">
|
||||
import { reactive, ref } from "vue";
|
||||
import { SysSettings } from "/@/views/sys/settings/api";
|
||||
import * as api from "/@/views/sys/settings/api";
|
||||
import { merge } from "lodash-es";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { useI18n } from "/src/locales";
|
||||
const { t } = useI18n();
|
||||
|
||||
defineOptions({
|
||||
name: "SettingMode",
|
||||
});
|
||||
|
||||
const adminModeDict = [
|
||||
{
|
||||
label: t("certd.adminMode.enterpriseMode"),
|
||||
value: "enterprise",
|
||||
},
|
||||
{
|
||||
label: t("certd.adminMode.saasMode"),
|
||||
value: "saas",
|
||||
},
|
||||
];
|
||||
|
||||
const formState = reactive<Partial<SysSettings>>({
|
||||
public: {},
|
||||
private: {},
|
||||
});
|
||||
|
||||
async function loadSysSettings() {
|
||||
const data: any = await api.SysSettingsGet();
|
||||
merge(formState, data);
|
||||
}
|
||||
|
||||
const saveLoading = ref(false);
|
||||
loadSysSettings();
|
||||
const settingsStore = useSettingStore();
|
||||
const onFinish = async (form: any) => {
|
||||
try {
|
||||
saveLoading.value = true;
|
||||
|
||||
await api.SysSettingsSave(form);
|
||||
await settingsStore.loadSysSettings();
|
||||
notification.success({
|
||||
message: t("certd.saveSuccess"),
|
||||
});
|
||||
} finally {
|
||||
saveLoading.value = false;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less"></style>
|
||||
@@ -0,0 +1,53 @@
|
||||
|
||||
CREATE TABLE "cd_project"
|
||||
(
|
||||
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
"user_id" integer NOT NULL,
|
||||
"name" varchar(512) NOT NULL,
|
||||
"disabled" boolean NOT NULL DEFAULT (false),
|
||||
"create_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
"update_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
|
||||
|
||||
CREATE INDEX "index_project_user_id" ON "cd_project" ("user_id");
|
||||
INSERT INTO cd_project (id, user_id, "name", "disabled") VALUES (1, 0, 'default', false);
|
||||
|
||||
|
||||
ALTER TABLE cd_cert_info ADD COLUMN project_id integer;
|
||||
CREATE INDEX "index_cert_project_id" ON "cd_cert_info" ("project_id");
|
||||
|
||||
ALTER TABLE cd_site_info ADD COLUMN project_id integer;
|
||||
CREATE INDEX "index_site_project_id" ON "cd_site_info" ("project_id");
|
||||
|
||||
ALTER TABLE cd_site_ip ADD COLUMN project_id integer;
|
||||
CREATE INDEX "index_site_ip_project_id" ON "cd_site_ip" ("project_id");
|
||||
|
||||
ALTER TABLE cd_open_key ADD COLUMN project_id integer;
|
||||
CREATE INDEX "index_open_key_project_id" ON "cd_open_key" ("project_id");
|
||||
|
||||
ALTER TABLE cd_access ADD COLUMN project_id integer;
|
||||
CREATE INDEX "index_access_project_id" ON "cd_access" ("project_id");
|
||||
|
||||
ALTER TABLE cd_addon ADD COLUMN project_id integer;
|
||||
CREATE INDEX "index_addon_project_id" ON "cd_addon" ("project_id");
|
||||
|
||||
ALTER TABLE pi_pipeline ADD COLUMN project_id integer;
|
||||
CREATE INDEX "index_pipeline_project_id" ON "cd_pipeline" ("project_id");
|
||||
|
||||
ALTER TABLE pi_pipeline_group ADD COLUMN project_id integer;
|
||||
CREATE INDEX "index_pipeline_group_project_id" ON "cd_pipeline_group" ("project_id");
|
||||
|
||||
ALTER TABLE pi_storage ADD COLUMN project_id integer;
|
||||
CREATE INDEX "index_storage_project_id" ON "cd_storage" ("project_id");
|
||||
|
||||
ALTER TABLE pi_notification ADD COLUMN project_id integer;
|
||||
CREATE INDEX "index_notification_project_id" ON "cd_notification" ("project_id");
|
||||
|
||||
ALTER TABLE pi_history ADD COLUMN project_id integer;
|
||||
CREATE INDEX "index_history_project_id" ON "cd_history" ("project_id");
|
||||
|
||||
ALTER TABLE pi_history_log ADD COLUMN project_id integer;
|
||||
CREATE INDEX "index_history_log_project_id" ON "cd_history_log" ("project_id");
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ default:
|
||||
runStrategy: 0
|
||||
name: CertApplyUpload
|
||||
icon: ph:certificate
|
||||
title: 商用证书托管
|
||||
title: 已有证书托管
|
||||
group: cert
|
||||
desc: 手动上传自定义证书后,自动部署(每次证书有更新,都需要手动上传一次)
|
||||
shortcut:
|
||||
|
||||
@@ -28,7 +28,7 @@ export class UserController extends CrudController<UserService> {
|
||||
return this.service;
|
||||
}
|
||||
|
||||
@Post('/getSimpleUserByIds', {summary: 'sys:auth:user:add'})
|
||||
@Post('/getSimpleUserByIds', {summary: 'sys:auth:user:view'})
|
||||
async getSimpleUserByIds(@Body('ids') ids: number[]) {
|
||||
const users = await this.service.find({
|
||||
select: {
|
||||
@@ -46,6 +46,21 @@ export class UserController extends CrudController<UserService> {
|
||||
return this.ok(users);
|
||||
}
|
||||
|
||||
|
||||
@Post('/getSimpleUsers', {summary: 'sys:auth:user:view'})
|
||||
async getSimpleUsers() {
|
||||
const users = await this.service.find({
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
nickName: true,
|
||||
mobile: true,
|
||||
phoneCode: true,
|
||||
},
|
||||
});
|
||||
return this.ok(users);
|
||||
}
|
||||
|
||||
@Post('/page', {summary: 'sys:auth:user:view'})
|
||||
async page(
|
||||
@Body(ALL)
|
||||
@@ -153,4 +168,6 @@ export class UserController extends CrudController<UserService> {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
import { CrudController, SysSettingsService } from "@certd/lib-server";
|
||||
import { ALL, Body, Controller, Inject, Post, Provide, Query } from "@midwayjs/core";
|
||||
import { ProjectService } from "../../../modules/sys/enterprise/service/project-service.js";
|
||||
import { ProjectEntity } from "../../../modules/sys/enterprise/entity/project.js";
|
||||
import { merge } from "lodash-es";
|
||||
|
||||
/**
|
||||
*/
|
||||
@Provide()
|
||||
@Controller("/api/sys/enterprise/project")
|
||||
export class SysProjectController extends CrudController<ProjectEntity> {
|
||||
@Inject()
|
||||
service: ProjectService;
|
||||
|
||||
@Inject()
|
||||
sysSettingsService: SysSettingsService;
|
||||
|
||||
getService<T>() {
|
||||
return this.service;
|
||||
}
|
||||
|
||||
@Post("/page", { summary: "sys:settings:view" })
|
||||
async page(@Body(ALL) body: any) {
|
||||
body.query = body.query ?? {};
|
||||
return await super.page(body);
|
||||
}
|
||||
|
||||
@Post("/list", { summary: "sys:settings:view" })
|
||||
async list(@Body(ALL) body: any) {
|
||||
return super.list(body);
|
||||
}
|
||||
|
||||
@Post("/add", { summary: "sys:settings:edit" })
|
||||
async add(@Body(ALL) bean: any) {
|
||||
const def: any = {
|
||||
isDefault: false,
|
||||
disabled: false,
|
||||
};
|
||||
merge(bean, def);
|
||||
bean.userId = this.getUserId();
|
||||
return super.add(bean);
|
||||
}
|
||||
|
||||
@Post("/update", { summary: "sys:settings:edit" })
|
||||
async update(@Body(ALL) bean: any) {
|
||||
bean.userId = this.getUserId();
|
||||
return super.update(bean);
|
||||
}
|
||||
|
||||
@Post("/info", { summary: "sys:settings:view" })
|
||||
async info(@Query("id") id: number) {
|
||||
return super.info(id);
|
||||
}
|
||||
|
||||
@Post("/delete", { summary: "sys:settings:edit" })
|
||||
async delete(@Query("id") id: number) {
|
||||
return super.delete(id);
|
||||
}
|
||||
|
||||
@Post("/deleteByIds", { summary: "sys:settings:edit" })
|
||||
async deleteByIds(@Body("ids") ids: number[]) {
|
||||
const res = await this.service.delete(ids);
|
||||
return this.ok(res);
|
||||
}
|
||||
@Post("/setDisabled", { summary: "sys:settings:edit" })
|
||||
async setDisabled(@Body("id") id: number, @Body("disabled") disabled: boolean) {
|
||||
await this.service.setDisabled(id, disabled);
|
||||
return this.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
import { CrudController, SysSettingsService } from "@certd/lib-server";
|
||||
import { ALL, Body, Controller, Inject, Post, Provide, Query } from "@midwayjs/core";
|
||||
import { ProjectMemberEntity } from "../../../modules/sys/enterprise/entity/project-member.js";
|
||||
import { ProjectMemberService } from "../../../modules/sys/enterprise/service/project-member-service.js";
|
||||
import { merge } from "lodash-es";
|
||||
|
||||
/**
|
||||
*/
|
||||
@Provide()
|
||||
@Controller("/api/sys/enterprise/projectMember")
|
||||
export class SysProjectMemberController extends CrudController<ProjectMemberEntity> {
|
||||
@Inject()
|
||||
service: ProjectMemberService;
|
||||
|
||||
@Inject()
|
||||
sysSettingsService: SysSettingsService;
|
||||
|
||||
getService<T>() {
|
||||
return this.service;
|
||||
}
|
||||
|
||||
@Post("/page", { summary: "sys:settings:view" })
|
||||
async page(@Body(ALL) body: any) {
|
||||
body.query = body.query ?? {};
|
||||
return await super.page(body);
|
||||
}
|
||||
|
||||
@Post("/list", { summary: "sys:settings:view" })
|
||||
async list(@Body(ALL) body: any) {
|
||||
return super.list(body);
|
||||
}
|
||||
|
||||
@Post("/add", { summary: "sys:settings:edit" })
|
||||
async add(@Body(ALL) bean: any) {
|
||||
const def: any = {
|
||||
isDefault: false,
|
||||
disabled: false,
|
||||
};
|
||||
merge(bean, def);
|
||||
bean.userId = this.getUserId();
|
||||
return super.add(bean);
|
||||
}
|
||||
|
||||
@Post("/update", { summary: "sys:settings:edit" })
|
||||
async update(@Body(ALL) bean: any) {
|
||||
bean.userId = this.getUserId();
|
||||
return super.update(bean);
|
||||
}
|
||||
|
||||
@Post("/info", { summary: "sys:settings:view" })
|
||||
async info(@Query("id") id: number) {
|
||||
return super.info(id);
|
||||
}
|
||||
|
||||
@Post("/delete", { summary: "sys:settings:edit" })
|
||||
async delete(@Query("id") id: number) {
|
||||
return super.delete(id);
|
||||
}
|
||||
|
||||
@Post("/deleteByIds", { summary: "sys:settings:edit" })
|
||||
async deleteByIds(@Body("ids") ids: number[]) {
|
||||
const res = await this.service.delete(ids);
|
||||
return this.ok(res);
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import { Application } from '@midwayjs/koa';
|
||||
import { httpsServer, HttpsServerOptions } from './https/server.js';
|
||||
import { UserService } from '../sys/authority/service/user-service.js';
|
||||
import { UserSettingsService } from '../mine/service/user-settings-service.js';
|
||||
import { startProxyServer } from './proxy/server.js';
|
||||
|
||||
@Autoload()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@@ -37,6 +38,7 @@ export class AutoZPrint {
|
||||
async init() {
|
||||
//监听https
|
||||
this.startHttpsServer();
|
||||
// this.startProxyServer();
|
||||
logger.info("ENV:", process.env.NODE_ENV);
|
||||
if (isDev()) {
|
||||
this.startHeapLog();
|
||||
@@ -97,4 +99,8 @@ export class AutoZPrint {
|
||||
hostname: this.httpsConfig.hostname || this.koaConfig.hostname,
|
||||
});
|
||||
}
|
||||
|
||||
startProxyServer() {
|
||||
startProxyServer({port: 7003});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
// proxy-server.js
|
||||
import http from 'http';
|
||||
import https from 'https';
|
||||
import url from 'url';
|
||||
import net from 'net';
|
||||
import { logger } from '@certd/basic';
|
||||
|
||||
|
||||
export function startProxyServer(opts:{port:number}) {
|
||||
const {port} = opts;
|
||||
|
||||
// 创建 HTTP 代理服务器
|
||||
const proxyServer = http.createServer((clientReq, clientRes) => {
|
||||
logger.log(`[proxy] 收到请求: ${clientReq.method} ${clientReq.url}`);
|
||||
|
||||
// 解析请求的 URL
|
||||
const parsedUrl = url.parse(clientReq.url);
|
||||
const options = {
|
||||
hostname: parsedUrl.hostname,
|
||||
port: parsedUrl.port || (parsedUrl.protocol === 'https:' ? 443 : 80),
|
||||
path: parsedUrl.path,
|
||||
method: clientReq.method,
|
||||
headers: clientReq.headers
|
||||
};
|
||||
|
||||
// 根据协议选择不同的模块
|
||||
const protocol = parsedUrl.protocol === 'https:' ? https : http;
|
||||
|
||||
// 移除可能会引起问题的 headers
|
||||
delete options.headers['proxy-connection'];
|
||||
delete options.headers['connection'];
|
||||
delete options.headers['keep-alive'];
|
||||
|
||||
// 创建到目标服务器的请求
|
||||
const proxyReq = protocol.request(options, (proxyRes) => {
|
||||
// 将目标服务器的响应返回给客户端
|
||||
clientRes.writeHead(proxyRes.statusCode, proxyRes.headers);
|
||||
proxyRes.pipe(clientRes);
|
||||
});
|
||||
|
||||
proxyReq.on('error', (err) => {
|
||||
logger.error('[proxy] 代理请求错误:', err);
|
||||
clientRes.writeHead(500);
|
||||
clientRes.end('代理服务器错误');
|
||||
});
|
||||
|
||||
// 将客户端请求体转发到目标服务器
|
||||
clientReq.pipe(proxyReq);
|
||||
});
|
||||
|
||||
// 处理 CONNECT 方法(HTTPS 代理)
|
||||
proxyServer.on('connect', (req, clientSocket, head) => {
|
||||
logger.log(`[proxy] HTTPS 连接请求: ${req.url}`);
|
||||
|
||||
const [hostname, port] = req.url.split(':');
|
||||
const portNum = parseInt(port) || 443;
|
||||
|
||||
// 连接到目标服务器
|
||||
const serverSocket = net.connect(portNum, hostname, () => {
|
||||
// 告诉客户端连接已建立
|
||||
clientSocket.write('HTTP/1.1 200 Connection Established\r\n' +
|
||||
'Proxy-agent: Node.js-Proxy\r\n' +
|
||||
'\r\n');
|
||||
|
||||
// 建立双向数据流
|
||||
serverSocket.write(head);
|
||||
serverSocket.pipe(clientSocket);
|
||||
clientSocket.pipe(serverSocket);
|
||||
});
|
||||
|
||||
serverSocket.on('error', (err) => {
|
||||
logger.error('[proxy] HTTPS 代理错误:', err);
|
||||
clientSocket.end();
|
||||
});
|
||||
|
||||
clientSocket.on('error', (err) => {
|
||||
logger.error('[proxy] 客户端 socket 错误:', err);
|
||||
serverSocket.end();
|
||||
});
|
||||
});
|
||||
|
||||
// 监听端口
|
||||
proxyServer.listen(port, () => {
|
||||
logger.info(`[proxy] 正向代理服务器运行在 http://0.0.0.0:${port}`);
|
||||
});
|
||||
|
||||
return proxyServer
|
||||
}
|
||||
@@ -42,6 +42,9 @@ export class CertInfoEntity {
|
||||
@Column({ name: 'cert_file', comment: '证书下载' })
|
||||
certFile: string;
|
||||
|
||||
@Column({ name: 'project_id', comment: '项目id' })
|
||||
projectId: number;
|
||||
|
||||
@Column({
|
||||
name: 'create_time',
|
||||
comment: '创建时间',
|
||||
|
||||
@@ -71,6 +71,9 @@ export class SiteInfoEntity {
|
||||
@Column({ name: 'group_id', comment: '分组id' })
|
||||
groupId: number;
|
||||
|
||||
@Column({ name: 'project_id', comment: '项目id' })
|
||||
projectId: number;
|
||||
|
||||
@Column({ name: 'create_time', comment: '创建时间', default: () => 'CURRENT_TIMESTAMP' })
|
||||
createTime: Date;
|
||||
@Column({ name: 'update_time', comment: '修改时间', default: () => 'CURRENT_TIMESTAMP' })
|
||||
|
||||
@@ -33,6 +33,8 @@ export class SiteIpEntity {
|
||||
remark: string;
|
||||
@Column({ name: "disabled", comment: "禁用启用" })
|
||||
disabled: boolean;
|
||||
@Column({ name: 'project_id', comment: '项目id' })
|
||||
projectId: number;
|
||||
|
||||
@Column({ name: 'create_time', comment: '创建时间', default: () => 'CURRENT_TIMESTAMP' })
|
||||
createTime: Date;
|
||||
|
||||
@@ -17,6 +17,9 @@ export class OpenKeyEntity {
|
||||
@Column({ name: 'scope', comment: '权限范围' })
|
||||
scope: string; // open 仅开放接口、 user 用户所有权限
|
||||
|
||||
@Column({ name: 'project_id', comment: '项目id' })
|
||||
projectId: number;
|
||||
|
||||
@Column({ name: 'create_time', comment: '创建时间', default: () => 'CURRENT_TIMESTAMP' })
|
||||
createTime: Date;
|
||||
|
||||
|
||||
@@ -25,6 +25,9 @@ export class HistoryLogEntity {
|
||||
@Column({ comment: '日志内容', length: 40960, nullable: true })
|
||||
logs: string;
|
||||
|
||||
@Column({ name: 'project_id', comment: '项目id' })
|
||||
projectId: number;
|
||||
|
||||
@Column({
|
||||
name: 'create_time',
|
||||
comment: '创建时间',
|
||||
|
||||
@@ -26,6 +26,9 @@ export class HistoryEntity {
|
||||
})
|
||||
endTime: Date;
|
||||
|
||||
@Column({ name: 'project_id', comment: '项目id' })
|
||||
projectId: number;
|
||||
|
||||
@Column({
|
||||
name: 'create_time',
|
||||
comment: '创建时间',
|
||||
@@ -38,6 +41,7 @@ export class HistoryEntity {
|
||||
default: () => 'CURRENT_TIMESTAMP',
|
||||
})
|
||||
updateTime: Date;
|
||||
|
||||
|
||||
pipelineTitle: string;
|
||||
|
||||
|
||||
@@ -20,6 +20,9 @@ export class NotificationEntity {
|
||||
@Column({ name: 'is_default', comment: '是否默认' })
|
||||
isDefault: boolean;
|
||||
|
||||
@Column({ name: 'project_id', comment: '项目id' })
|
||||
projectId: number;
|
||||
|
||||
@Column({
|
||||
name: 'create_time',
|
||||
comment: '创建时间',
|
||||
|
||||
@@ -17,6 +17,9 @@ export class PipelineGroupEntity {
|
||||
@Column({ name: 'favorite', comment: '收藏' })
|
||||
favorite: boolean;
|
||||
|
||||
@Column({ name: 'project_id', comment: '项目id' })
|
||||
projectId: number;
|
||||
|
||||
@Column({
|
||||
name: 'create_time',
|
||||
comment: '创建时间',
|
||||
|
||||
@@ -61,6 +61,9 @@ export class PipelineEntity {
|
||||
@Column({name: 'order', comment: '排序', nullable: true,})
|
||||
order: number;
|
||||
|
||||
@Column({ name: 'project_id', comment: '项目id' })
|
||||
projectId: number;
|
||||
|
||||
@Column({name: 'create_time',comment: '创建时间', default: () => 'CURRENT_TIMESTAMP',})
|
||||
createTime: Date;
|
||||
@Column({
|
||||
|
||||
@@ -23,6 +23,9 @@ export class StorageEntity {
|
||||
@Column({ comment: 'value', length: 40960, nullable: true })
|
||||
value: string;
|
||||
|
||||
@Column({ name: 'project_id', comment: '项目id' })
|
||||
projectId: number;
|
||||
|
||||
@Column({
|
||||
name: 'create_time',
|
||||
comment: '创建时间',
|
||||
|
||||
@@ -39,6 +39,9 @@ export class TemplateEntity {
|
||||
})
|
||||
order: number;
|
||||
|
||||
@Column({ name: 'project_id', comment: '项目id' })
|
||||
projectId: number;
|
||||
|
||||
@Column({
|
||||
name: 'create_time',
|
||||
comment: '创建时间',
|
||||
|
||||
@@ -54,7 +54,6 @@ export class SubDomainService extends BaseService<SubDomainEntity> {
|
||||
throw new Error('域名已存在');
|
||||
}
|
||||
return await super.add(bean)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
/**
|
||||
*/
|
||||
@Entity('cd_audit_log')
|
||||
export class AuditLogEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column({ name: 'user_id', comment: 'UserId' })
|
||||
userId: number;
|
||||
|
||||
@Column({ name: 'user_name', comment: '用户名' })
|
||||
userName: string;
|
||||
|
||||
@Column({ name: 'project_id', comment: 'ProjectId' })
|
||||
projectId: number;
|
||||
|
||||
@Column({ name: 'project_name', comment: '项目名称' })
|
||||
projectName: string;
|
||||
|
||||
@Column({ name: 'action', comment: '操作' })
|
||||
action: string;
|
||||
|
||||
@Column({ name: 'content', comment: '内容' })
|
||||
content: string;
|
||||
|
||||
@Column({ name: 'ip_address', comment: 'IP地址' })
|
||||
ipAddress: string;
|
||||
|
||||
@Column({
|
||||
name: 'create_time',
|
||||
comment: '创建时间',
|
||||
default: () => 'CURRENT_TIMESTAMP',
|
||||
})
|
||||
createTime: Date;
|
||||
@Column({
|
||||
name: 'update_time',
|
||||
comment: '修改时间',
|
||||
default: () => 'CURRENT_TIMESTAMP',
|
||||
})
|
||||
updateTime: Date;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
/**
|
||||
*/
|
||||
@Entity('cd_project_member')
|
||||
export class ProjectMemberEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column({ name: 'user_id', comment: 'UserId' })
|
||||
userId: number;
|
||||
|
||||
@Column({ name: 'project_id', comment: 'ProjectId' })
|
||||
projectId: number;
|
||||
|
||||
@Column({ name: 'permission', comment: '权限' })
|
||||
permission: string; // read / write / admin
|
||||
|
||||
@Column({
|
||||
name: 'create_time',
|
||||
comment: '创建时间',
|
||||
default: () => 'CURRENT_TIMESTAMP',
|
||||
})
|
||||
createTime: Date;
|
||||
@Column({
|
||||
name: 'update_time',
|
||||
comment: '修改时间',
|
||||
default: () => 'CURRENT_TIMESTAMP',
|
||||
})
|
||||
updateTime: Date;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
/**
|
||||
*/
|
||||
@Entity('cd_project')
|
||||
export class ProjectEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column({ name: 'user_id', comment: 'UserId' })
|
||||
userId: number;
|
||||
|
||||
@Column({ name: 'name', comment: '项目名称' })
|
||||
name: string;
|
||||
|
||||
@Column({ name: 'disabled', comment: '禁用' })
|
||||
disabled: boolean;
|
||||
|
||||
@Column({
|
||||
name: 'create_time',
|
||||
comment: '创建时间',
|
||||
default: () => 'CURRENT_TIMESTAMP',
|
||||
})
|
||||
createTime: Date;
|
||||
@Column({
|
||||
name: 'update_time',
|
||||
comment: '修改时间',
|
||||
default: () => 'CURRENT_TIMESTAMP',
|
||||
})
|
||||
updateTime: Date;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import {Inject, Provide, Scope, ScopeEnum} from '@midwayjs/core';
|
||||
import {BaseService, SysSettingsService} from '@certd/lib-server';
|
||||
import {InjectEntityModel} from '@midwayjs/typeorm';
|
||||
import {Repository} from 'typeorm';
|
||||
import { ProjectMemberEntity } from '../entity/project-member.js';
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
export class ProjectMemberService extends BaseService<ProjectMemberEntity> {
|
||||
@InjectEntityModel(ProjectMemberEntity)
|
||||
repository: Repository<ProjectMemberEntity>;
|
||||
|
||||
@Inject()
|
||||
sysSettingsService: SysSettingsService;
|
||||
|
||||
//@ts-ignore
|
||||
getRepository() {
|
||||
return this.repository;
|
||||
}
|
||||
|
||||
async add(bean: ProjectMemberEntity) {
|
||||
const {projectId, userId} = bean;
|
||||
if (!projectId) {
|
||||
throw new Error('项目ID不能为空');
|
||||
}
|
||||
if (!userId) {
|
||||
throw new Error('用户ID不能为空');
|
||||
}
|
||||
const exist = await this.repository.findOne({
|
||||
where: {
|
||||
projectId,
|
||||
userId,
|
||||
},
|
||||
});
|
||||
if (exist) {
|
||||
throw new Error('项目用户已存在');
|
||||
}
|
||||
return await super.add(bean)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import {Inject, Provide, Scope, ScopeEnum} from '@midwayjs/core';
|
||||
import {BaseService, SysSettingsService} from '@certd/lib-server';
|
||||
import {InjectEntityModel} from '@midwayjs/typeorm';
|
||||
import {Repository} from 'typeorm';
|
||||
import { ProjectEntity } from '../entity/project.js';
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
export class ProjectService extends BaseService<ProjectEntity> {
|
||||
@InjectEntityModel(ProjectEntity)
|
||||
repository: Repository<ProjectEntity>;
|
||||
|
||||
|
||||
@Inject()
|
||||
sysSettingsService: SysSettingsService;
|
||||
|
||||
//@ts-ignore
|
||||
getRepository() {
|
||||
return this.repository;
|
||||
}
|
||||
|
||||
async add(bean: ProjectEntity) {
|
||||
const {name} = bean;
|
||||
if (!name) {
|
||||
throw new Error('项目名称不能为空');
|
||||
}
|
||||
const exist = await this.repository.findOne({
|
||||
where: {
|
||||
name,
|
||||
userId:0,
|
||||
},
|
||||
});
|
||||
if (exist) {
|
||||
throw new Error('项目名称已存在');
|
||||
}
|
||||
bean.userId = 0
|
||||
bean.disabled = false
|
||||
return await super.add(bean)
|
||||
}
|
||||
|
||||
async setDisabled(id: number, disabled: boolean) {
|
||||
const project = await this.repository.findOne({
|
||||
where: {
|
||||
id,
|
||||
userId:0,
|
||||
},
|
||||
});
|
||||
if (!project) {
|
||||
throw new Error('项目不存在');
|
||||
}
|
||||
await this.repository.update({
|
||||
userId:0,
|
||||
}, {
|
||||
disabled,
|
||||
});
|
||||
project.disabled = disabled;
|
||||
await this.repository.save(project);
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import dayjs from "dayjs";
|
||||
@IsTaskPlugin({
|
||||
name: "CertApplyUpload",
|
||||
icon: "ph:certificate",
|
||||
title: "商用证书托管",
|
||||
title: "已有证书托管",
|
||||
group: pluginGroups.cert.key,
|
||||
desc: "手动上传自定义证书后,自动部署(每次证书有更新,都需要手动上传一次)",
|
||||
default: {
|
||||
|
||||
@@ -44,7 +44,7 @@ export class XinnetAccess extends BaseAccess {
|
||||
name: "api-test",
|
||||
action: "TestRequest"
|
||||
},
|
||||
helper: "点击测试接口是否正常"
|
||||
helper: "测试前请务必先在新网后台关闭异地登录保护、关闭动态口令验证\n如果提示需要短信验证码,请等几个小时后再试"
|
||||
})
|
||||
testRequest = true;
|
||||
|
||||
|
||||
@@ -57,7 +57,19 @@ export class XinnetProvider extends AbstractDnsProvider<XinnetRecord> {
|
||||
if (!res.list || res.list.length == 0) {
|
||||
throw new Error("域名不存在");
|
||||
}
|
||||
const serviceCode = res.list[0].serviceCode;
|
||||
|
||||
let list = res.list.map((item) => ({
|
||||
domainName: item.domainName,
|
||||
serviceCode: item.serviceCode
|
||||
}));
|
||||
this.logger.info("域名列表:", JSON.stringify(list));
|
||||
|
||||
const domainItem = list.find((item) => item.domainName === domain);
|
||||
if (!domainItem) {
|
||||
throw new Error("域名(" + domain + ")不存在");
|
||||
}
|
||||
|
||||
const serviceCode = domainItem.serviceCode;
|
||||
|
||||
const dcpCookie = await client.getDcpCookie({
|
||||
serviceCode
|
||||
|
||||
Generated
+44
-44
@@ -49,7 +49,7 @@ importers:
|
||||
packages/core/acme-client:
|
||||
dependencies:
|
||||
'@certd/basic':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../basic
|
||||
'@peculiar/x509':
|
||||
specifier: ^1.11.0
|
||||
@@ -213,10 +213,10 @@ importers:
|
||||
packages/core/pipeline:
|
||||
dependencies:
|
||||
'@certd/basic':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../basic
|
||||
'@certd/plus-core':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../pro/plus-core
|
||||
dayjs:
|
||||
specifier: ^1.11.7
|
||||
@@ -412,7 +412,7 @@ importers:
|
||||
packages/libs/lib-k8s:
|
||||
dependencies:
|
||||
'@certd/basic':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/basic
|
||||
'@kubernetes/client-node':
|
||||
specifier: 0.21.0
|
||||
@@ -452,19 +452,19 @@ importers:
|
||||
packages/libs/lib-server:
|
||||
dependencies:
|
||||
'@certd/acme-client':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/acme-client
|
||||
'@certd/basic':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/basic
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/pipeline
|
||||
'@certd/plugin-lib':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../plugins/plugin-lib
|
||||
'@certd/plus-core':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../pro/plus-core
|
||||
'@midwayjs/cache':
|
||||
specifier: 3.14.0
|
||||
@@ -610,16 +610,16 @@ importers:
|
||||
packages/plugins/plugin-cert:
|
||||
dependencies:
|
||||
'@certd/acme-client':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/acme-client
|
||||
'@certd/basic':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/basic
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/pipeline
|
||||
'@certd/plugin-lib':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../plugin-lib
|
||||
psl:
|
||||
specifier: ^1.9.0
|
||||
@@ -683,16 +683,16 @@ importers:
|
||||
specifier: ^3.964.0
|
||||
version: 3.964.0(aws-crt@1.26.2)
|
||||
'@certd/acme-client':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/acme-client
|
||||
'@certd/basic':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/basic
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/pipeline
|
||||
'@certd/plus-core':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../pro/plus-core
|
||||
'@kubernetes/client-node':
|
||||
specifier: 0.21.0
|
||||
@@ -783,16 +783,16 @@ importers:
|
||||
packages/pro/commercial-core:
|
||||
dependencies:
|
||||
'@certd/basic':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/basic
|
||||
'@certd/lib-server':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../libs/lib-server
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/pipeline
|
||||
'@certd/plus-core':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../plus-core
|
||||
'@midwayjs/core':
|
||||
specifier: 3.20.11
|
||||
@@ -865,16 +865,16 @@ importers:
|
||||
packages/pro/plugin-plus:
|
||||
dependencies:
|
||||
'@certd/basic':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/basic
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/pipeline
|
||||
'@certd/plugin-lib':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../plugins/plugin-lib
|
||||
'@certd/plus-core':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../plus-core
|
||||
crypto-js:
|
||||
specifier: ^4.2.0
|
||||
@@ -950,7 +950,7 @@ importers:
|
||||
packages/pro/plus-core:
|
||||
dependencies:
|
||||
'@certd/basic':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/basic
|
||||
dayjs:
|
||||
specifier: ^1.11.7
|
||||
@@ -1246,10 +1246,10 @@ importers:
|
||||
version: 0.1.3(zod@3.24.4)
|
||||
devDependencies:
|
||||
'@certd/lib-iframe':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../libs/lib-iframe
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/pipeline
|
||||
'@rollup/plugin-commonjs':
|
||||
specifier: ^25.0.7
|
||||
@@ -1438,46 +1438,46 @@ importers:
|
||||
specifier: ^3.964.0
|
||||
version: 3.964.0(aws-crt@1.26.2)
|
||||
'@certd/acme-client':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/acme-client
|
||||
'@certd/basic':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/basic
|
||||
'@certd/commercial-core':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../pro/commercial-core
|
||||
'@certd/cv4pve-api-javascript':
|
||||
specifier: ^8.4.2
|
||||
version: 8.4.2
|
||||
'@certd/jdcloud':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../libs/lib-jdcloud
|
||||
'@certd/lib-huawei':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../libs/lib-huawei
|
||||
'@certd/lib-k8s':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../libs/lib-k8s
|
||||
'@certd/lib-server':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../libs/lib-server
|
||||
'@certd/midway-flyway-js':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../libs/midway-flyway-js
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../core/pipeline
|
||||
'@certd/plugin-cert':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../plugins/plugin-cert
|
||||
'@certd/plugin-lib':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../plugins/plugin-lib
|
||||
'@certd/plugin-plus':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../pro/plugin-plus
|
||||
'@certd/plus-core':
|
||||
specifier: ^1.38.3
|
||||
specifier: ^1.38.5
|
||||
version: link:../../pro/plus-core
|
||||
'@google-cloud/publicca':
|
||||
specifier: ^1.3.0
|
||||
@@ -19971,13 +19971,13 @@ snapshots:
|
||||
resolve: 1.22.10
|
||||
semver: 6.3.1
|
||||
|
||||
eslint-plugin-prettier@3.4.1(eslint-config-prettier@8.10.0(eslint@7.32.0))(eslint@7.32.0)(prettier@2.8.8):
|
||||
eslint-plugin-prettier@3.4.1(eslint-config-prettier@8.10.0(eslint@8.57.0))(eslint@7.32.0)(prettier@2.8.8):
|
||||
dependencies:
|
||||
eslint: 7.32.0
|
||||
prettier: 2.8.8
|
||||
prettier-linter-helpers: 1.0.0
|
||||
optionalDependencies:
|
||||
eslint-config-prettier: 8.10.0(eslint@7.32.0)
|
||||
eslint-config-prettier: 8.10.0(eslint@8.57.0)
|
||||
|
||||
eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.10.0(eslint@8.57.0))(eslint@8.57.0)(prettier@2.8.8):
|
||||
dependencies:
|
||||
@@ -22377,7 +22377,7 @@ snapshots:
|
||||
eslint: 7.32.0
|
||||
eslint-config-prettier: 8.10.0(eslint@7.32.0)
|
||||
eslint-plugin-node: 11.1.0(eslint@7.32.0)
|
||||
eslint-plugin-prettier: 3.4.1(eslint-config-prettier@8.10.0(eslint@7.32.0))(eslint@7.32.0)(prettier@2.8.8)
|
||||
eslint-plugin-prettier: 3.4.1(eslint-config-prettier@8.10.0(eslint@8.57.0))(eslint@7.32.0)(prettier@2.8.8)
|
||||
execa: 5.1.1
|
||||
inquirer: 7.3.3
|
||||
json5: 2.2.3
|
||||
|
||||
@@ -1 +1 @@
|
||||
02:12
|
||||
00:04
|
||||
|
||||
@@ -1 +1 @@
|
||||
02:25
|
||||
00:18
|
||||
|
||||
Reference in New Issue
Block a user