mirror of
https://github.com/certd/certd.git
synced 2026-04-14 12:30:54 +08:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4343fb1b30 | ||
|
|
64e6c74bb6 | ||
|
|
73962536d5 | ||
|
|
38be8d84b2 | ||
|
|
8ab632c97c | ||
|
|
903edf12df | ||
|
|
66f9b08fcf | ||
|
|
fcaf891a90 | ||
|
|
3b1f3e8a3f | ||
|
|
d8d9f9b99c | ||
|
|
126e548510 | ||
|
|
91fc1cd735 | ||
|
|
4244569211 | ||
|
|
f23c4af2ad | ||
|
|
809bde9d20 | ||
|
|
52bf8a1bb6 | ||
|
|
614ce97898 | ||
|
|
5aacd18320 |
16
CHANGELOG.md
16
CHANGELOG.md
@@ -3,6 +3,22 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.26.3](https://github.com/certd/certd/compare/v1.26.2...v1.26.3) (2024-10-12)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 优化系统设置加载时机 ([7396253](https://github.com/certd/certd/commit/73962536d5a4769902d760d005f3f879465addcc))
|
||||||
|
|
||||||
|
## [1.26.2](https://github.com/certd/certd/compare/v1.26.1...v1.26.2) (2024-10-11)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复某些情况下bindUrl失败的bug ([91fc1cd](https://github.com/certd/certd/commit/91fc1cd7353be4a22be951239ed70b38baebc74e))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 邮箱设置改为系统设置,普通用户无需配置发件邮箱 ([4244569](https://github.com/certd/certd/commit/42445692117184a3293e63bef84a74cbb5984b0e))
|
||||||
|
|
||||||
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
||||||
|
|
||||||
**Note:** Version bump only for package root
|
**Note:** Version bump only for package root
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -29,11 +29,11 @@ https://certd.handsfree.work/
|
|||||||
## 三、使用教程
|
## 三、使用教程
|
||||||
本案例演示,如何配置自动申请证书,并部署到阿里云CDN,然后快要到期前自动更新证书并重新部署
|
本案例演示,如何配置自动申请证书,并部署到阿里云CDN,然后快要到期前自动更新证书并重新部署
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||||||
-------> [点我查看详细使用步骤演示](./step.md) <--------
|
-------> [点我查看详细使用步骤演示](./step.md) <--------
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
02:06
|
13:39
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
# 腾讯云
|
# 腾讯云
|
||||||
|
|
||||||
|
|
||||||
## DNSPOD 授权设置
|
## DNSPOD 授权设置【已废弃,请使用腾讯云API】
|
||||||
目前腾讯云管理的域名的dns暂时只支持从DNSPOD进行设置
|
|
||||||
打开 https://console.dnspod.cn/account/token/apikey
|
打开 https://console.dnspod.cn/account/token/apikey
|
||||||
然后按如下方式获取DNSPOD的授权
|
然后按如下方式获取DNSPOD的授权
|
||||||

|

|
||||||
@@ -13,4 +12,4 @@
|
|||||||
腾讯云其他部署需要API密钥,需要在腾讯云控制台进行设置
|
腾讯云其他部署需要API密钥,需要在腾讯云控制台进行设置
|
||||||
打开 https://console.cloud.tencent.com/cam/capi
|
打开 https://console.cloud.tencent.com/cam/capi
|
||||||
然后按如下方式获取腾讯云的API密钥
|
然后按如下方式获取腾讯云的API密钥
|
||||||

|

|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
version: '3.3' # 兼容旧版docker-compose
|
version: '3.3' # 兼容旧版docker-compose
|
||||||
services:
|
services:
|
||||||
certd:
|
certd:
|
||||||
# 镜像 # ↓↓↓↓↓ --- 镜像版本号,建议改成固定版本号
|
# 镜像 # ↓↓↓↓↓ ---- 镜像版本号,建议改成固定版本号
|
||||||
image: registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest
|
image: registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest
|
||||||
container_name: certd # 容器名
|
container_name: certd # 容器名
|
||||||
restart: unless-stopped # 自动重启
|
restart: unless-stopped # 自动重启
|
||||||
@@ -23,18 +23,28 @@ services:
|
|||||||
# - "localdomain.comm:192.168.1.3"
|
# - "localdomain.comm:192.168.1.3"
|
||||||
environment: # 环境变量
|
environment: # 环境变量
|
||||||
- TZ=Asia/Shanghai
|
- TZ=Asia/Shanghai
|
||||||
#- HTTPS_PROXY=http://xxxxxx:xx
|
|
||||||
#- HTTP_PROXY=http://xxxxxx:xx
|
|
||||||
# ↑↑↑↑↑ ------------------------------------- 这里可以设置http代理
|
|
||||||
- certd_system_resetAdminPasswd=false
|
|
||||||
# ↑↑↑↑↑--------------------------- 如果忘记管理员密码,可以设置为true,重启之后,管理员密码将改成123456,然后请及时修改回false
|
|
||||||
- certd_cron_immediateTriggerOnce=false
|
|
||||||
# ↑↑↑↑↑--------------------------- 如果设置为true,启动后所有配置了cron的流水线任务都将被立即触发一次
|
|
||||||
- certd_site_icp_no=
|
|
||||||
# ↑↑↑↑↑ ----------------------------------------- 这里可以设置备案号
|
|
||||||
#- certd_koa_key=./data/ssl/cert.key
|
|
||||||
#- certd_koa_cert=./data/ssl/cert.crt
|
|
||||||
# ↑↑↑↑↑ ----------------------------------------- 配置证书和key,则表示https方式启动,使用https协议访问,https://your.domain:7001
|
|
||||||
# 设置环境变量即可自定义certd配置
|
# 设置环境变量即可自定义certd配置
|
||||||
# 配置项见: packages/ui/certd-server/src/config/config.default.ts
|
# 配置项见: packages/ui/certd-server/src/config/config.default.ts
|
||||||
# 配置规则: certd_ + 配置项, 点号用_代替
|
# 配置规则: certd_ + 配置项, 点号用_代替
|
||||||
|
|
||||||
|
# ↓↓↓↓ ------------------------------------ 这里可以设置http代理
|
||||||
|
#- HTTPS_PROXY=http://xxxxxx:xx
|
||||||
|
#- HTTP_PROXY=http://xxxxxx:xx
|
||||||
|
# ↓↓↓↓ ----------------------------- 如果忘记管理员密码,可以设置为true,重启之后,管理员密码将改成123456,然后请及时修改回false
|
||||||
|
- certd_system_resetAdminPasswd=false
|
||||||
|
# ↓↓↓↓ -------------------------- 如果设置为true,启动后所有配置了cron的流水线任务都将被立即触发一次
|
||||||
|
- certd_cron_immediateTriggerOnce=false
|
||||||
|
# ↓↓↓↓ -------------------------------- 配置证书和key,则表示https方式启动,使用https协议访问,https://your.domain:7001
|
||||||
|
#- certd_koa_key=./data/ssl/cert.key
|
||||||
|
#- certd_koa_cert=./data/ssl/cert.crt
|
||||||
|
|
||||||
|
# ↓↓↓↓ ------------------------------- 使用postgresql数据库
|
||||||
|
# - certd_flyway_scriptDir=./db/migration-pg # 升级脚本目录
|
||||||
|
# - certd_typeorm_dataSource_default_type=postgres # 数据库类型
|
||||||
|
# - certd_typeorm_dataSource_default_host=localhost # 数据库地址
|
||||||
|
# - certd_typeorm_dataSource_default_port=5433 # 数据库端口
|
||||||
|
# - certd_typeorm_dataSource_default_username=postgres # 用户名
|
||||||
|
# - certd_typeorm_dataSource_default_password=yourpasswd # 密码
|
||||||
|
# - certd_typeorm_dataSource_default_database=certd # 数据库名
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,5 +9,5 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"npmClient": "pnpm",
|
"npmClient": "pnpm",
|
||||||
"version": "1.26.1"
|
"version": "1.26.3"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.26.3](https://github.com/publishlab/node-acme-client/compare/v1.26.2...v1.26.3) (2024-10-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
|
## [1.26.2](https://github.com/publishlab/node-acme-client/compare/v1.26.1...v1.26.2) (2024-10-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
## [1.26.1](https://github.com/publishlab/node-acme-client/compare/v1.26.0...v1.26.1) (2024-10-10)
|
## [1.26.1](https://github.com/publishlab/node-acme-client/compare/v1.26.0...v1.26.1) (2024-10-10)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/acme-client
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"description": "Simple and unopinionated ACME client",
|
"description": "Simple and unopinionated ACME client",
|
||||||
"private": false,
|
"private": false,
|
||||||
"author": "nmorsman",
|
"author": "nmorsman",
|
||||||
"version": "1.26.1",
|
"version": "1.26.3",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"types": "types/index.d.ts",
|
"types": "types/index.d.ts",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -59,5 +59,5 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||||
},
|
},
|
||||||
"gitHead": "46b810822986f7144bb4f67ae5c4a239dbb3691b"
|
"gitHead": "66f9b08fcf5035577eafc609fd634d6490bc9cae"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.26.3](https://github.com/certd/certd/compare/v1.26.2...v1.26.3) (2024-10-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/basic
|
||||||
|
|
||||||
|
## [1.26.2](https://github.com/certd/certd/compare/v1.26.1...v1.26.2) (2024-10-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/basic
|
||||||
|
|
||||||
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/basic
|
**Note:** Version bump only for package @certd/basic
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
00:29
|
15:04
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/basic",
|
"name": "@certd/basic",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.26.1",
|
"version": "1.26.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"module": "./dist/index.js",
|
"module": "./dist/index.js",
|
||||||
@@ -64,5 +64,5 @@
|
|||||||
"vite": "^4.3.8",
|
"vite": "^4.3.8",
|
||||||
"vue-tsc": "^1.6.5"
|
"vue-tsc": "^1.6.5"
|
||||||
},
|
},
|
||||||
"gitHead": "46b810822986f7144bb4f67ae5c4a239dbb3691b"
|
"gitHead": "66f9b08fcf5035577eafc609fd634d6490bc9cae"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.26.3](https://github.com/certd/certd/compare/v1.26.2...v1.26.3) (2024-10-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
|
## [1.26.2](https://github.com/certd/certd/compare/v1.26.1...v1.26.2) (2024-10-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/pipeline
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/pipeline",
|
"name": "@certd/pipeline",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.26.1",
|
"version": "1.26.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
@@ -15,8 +15,8 @@
|
|||||||
"test": "mocha --loader=ts-node/esm"
|
"test": "mocha --loader=ts-node/esm"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/basic": "^1.26.1",
|
"@certd/basic": "^1.26.3",
|
||||||
"@certd/plus-core": "^1.26.1",
|
"@certd/plus-core": "^1.26.3",
|
||||||
"axios": "^1.7.2",
|
"axios": "^1.7.2",
|
||||||
"dayjs": "^1.11.7",
|
"dayjs": "^1.11.7",
|
||||||
"fix-path": "^4.0.0",
|
"fix-path": "^4.0.0",
|
||||||
@@ -66,5 +66,5 @@
|
|||||||
"vite": "^4.3.8",
|
"vite": "^4.3.8",
|
||||||
"vue-tsc": "^1.6.5"
|
"vue-tsc": "^1.6.5"
|
||||||
},
|
},
|
||||||
"gitHead": "46b810822986f7144bb4f67ae5c4a239dbb3691b"
|
"gitHead": "66f9b08fcf5035577eafc609fd634d6490bc9cae"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.26.3](https://github.com/certd/certd/compare/v1.26.2...v1.26.3) (2024-10-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-huawei
|
||||||
|
|
||||||
|
## [1.26.2](https://github.com/certd/certd/compare/v1.26.1...v1.26.2) (2024-10-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-huawei
|
||||||
|
|
||||||
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/lib-huawei
|
**Note:** Version bump only for package @certd/lib-huawei
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/lib-huawei",
|
"name": "@certd/lib-huawei",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.26.1",
|
"version": "1.26.3",
|
||||||
"main": "./dist/bundle.js",
|
"main": "./dist/bundle.js",
|
||||||
"module": "./dist/bundle.js",
|
"module": "./dist/bundle.js",
|
||||||
"types": "./dist/d/index.d.ts",
|
"types": "./dist/d/index.d.ts",
|
||||||
@@ -17,5 +17,5 @@
|
|||||||
"rimraf": "^5.0.5",
|
"rimraf": "^5.0.5",
|
||||||
"rollup": "^3.7.4"
|
"rollup": "^3.7.4"
|
||||||
},
|
},
|
||||||
"gitHead": "46b810822986f7144bb4f67ae5c4a239dbb3691b"
|
"gitHead": "66f9b08fcf5035577eafc609fd634d6490bc9cae"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.26.3](https://github.com/certd/certd/compare/v1.26.2...v1.26.3) (2024-10-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-iframe
|
||||||
|
|
||||||
|
## [1.26.2](https://github.com/certd/certd/compare/v1.26.1...v1.26.2) (2024-10-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-iframe
|
||||||
|
|
||||||
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/lib-iframe
|
**Note:** Version bump only for package @certd/lib-iframe
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/lib-iframe",
|
"name": "@certd/lib-iframe",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.26.1",
|
"version": "1.26.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
@@ -39,5 +39,5 @@
|
|||||||
"tslib": "^2.5.2",
|
"tslib": "^2.5.2",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "46b810822986f7144bb4f67ae5c4a239dbb3691b"
|
"gitHead": "66f9b08fcf5035577eafc609fd634d6490bc9cae"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.26.3](https://github.com/certd/certd/compare/v1.26.2...v1.26.3) (2024-10-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-jdcloud
|
||||||
|
|
||||||
|
## [1.26.2](https://github.com/certd/certd/compare/v1.26.1...v1.26.2) (2024-10-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-jdcloud
|
||||||
|
|
||||||
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/lib-jdcloud
|
**Note:** Version bump only for package @certd/lib-jdcloud
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/lib-jdcloud",
|
"name": "@certd/lib-jdcloud",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.26.1",
|
"version": "1.26.3",
|
||||||
"main": "./dist/bundle.mjs",
|
"main": "./dist/bundle.mjs",
|
||||||
"module": "./dist/bundle.mjs",
|
"module": "./dist/bundle.mjs",
|
||||||
"types": "./dist/d/index.d.ts",
|
"types": "./dist/d/index.d.ts",
|
||||||
@@ -27,5 +27,5 @@
|
|||||||
"rimraf": "^5.0.5",
|
"rimraf": "^5.0.5",
|
||||||
"rollup": "^3.7.4"
|
"rollup": "^3.7.4"
|
||||||
},
|
},
|
||||||
"gitHead": "46b810822986f7144bb4f67ae5c4a239dbb3691b"
|
"gitHead": "66f9b08fcf5035577eafc609fd634d6490bc9cae"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.26.3](https://github.com/certd/certd/compare/v1.26.2...v1.26.3) (2024-10-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-k8s
|
||||||
|
|
||||||
|
## [1.26.2](https://github.com/certd/certd/compare/v1.26.1...v1.26.2) (2024-10-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-k8s
|
||||||
|
|
||||||
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/lib-k8s
|
**Note:** Version bump only for package @certd/lib-k8s
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/lib-k8s",
|
"name": "@certd/lib-k8s",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.26.1",
|
"version": "1.26.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
"@kubernetes/client-node": "0.21.0"
|
"@kubernetes/client-node": "0.21.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/pipeline": "^1.26.1",
|
"@certd/pipeline": "^1.26.3",
|
||||||
"@rollup/plugin-commonjs": "^23.0.4",
|
"@rollup/plugin-commonjs": "^23.0.4",
|
||||||
"@rollup/plugin-json": "^6.0.0",
|
"@rollup/plugin-json": "^6.0.0",
|
||||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||||
@@ -40,5 +40,5 @@
|
|||||||
"tslib": "^2.5.2",
|
"tslib": "^2.5.2",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "46b810822986f7144bb4f67ae5c4a239dbb3691b"
|
"gitHead": "66f9b08fcf5035577eafc609fd634d6490bc9cae"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,22 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.26.3](https://github.com/certd/certd/compare/v1.26.2...v1.26.3) (2024-10-12)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 优化系统设置加载时机 ([7396253](https://github.com/certd/certd/commit/73962536d5a4769902d760d005f3f879465addcc))
|
||||||
|
|
||||||
|
## [1.26.2](https://github.com/certd/certd/compare/v1.26.1...v1.26.2) (2024-10-11)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复某些情况下bindUrl失败的bug ([91fc1cd](https://github.com/certd/certd/commit/91fc1cd7353be4a22be951239ed70b38baebc74e))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 邮箱设置改为系统设置,普通用户无需配置发件邮箱 ([4244569](https://github.com/certd/certd/commit/42445692117184a3293e63bef84a74cbb5984b0e))
|
||||||
|
|
||||||
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/lib-server
|
**Note:** Version bump only for package @certd/lib-server
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/lib-server",
|
"name": "@certd/lib-server",
|
||||||
"version": "1.26.1",
|
"version": "1.26.3",
|
||||||
"description": "midway with flyway, sql upgrade way ",
|
"description": "midway with flyway, sql upgrade way ",
|
||||||
"private": false,
|
"private": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -26,8 +26,8 @@
|
|||||||
],
|
],
|
||||||
"license": "AGPL",
|
"license": "AGPL",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/basic": "^1.26.1",
|
"@certd/basic": "^1.26.3",
|
||||||
"@certd/pipeline": "^1.26.1",
|
"@certd/pipeline": "^1.26.3",
|
||||||
"@midwayjs/cache": "~3.14.0",
|
"@midwayjs/cache": "~3.14.0",
|
||||||
"@midwayjs/core": "~3.17.1",
|
"@midwayjs/core": "~3.17.1",
|
||||||
"@midwayjs/i18n": "~3.17.3",
|
"@midwayjs/i18n": "~3.17.3",
|
||||||
@@ -68,5 +68,5 @@
|
|||||||
"typeorm": "^0.3.11",
|
"typeorm": "^0.3.11",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "46b810822986f7144bb4f67ae5c4a239dbb3691b"
|
"gitHead": "66f9b08fcf5035577eafc609fd634d6490bc9cae"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Config, Init, Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
|
import { Config, Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
|
||||||
import { AppKey, PlusRequestService, verify } from '@certd/pipeline';
|
import { AppKey, PlusRequestService, verify } from '@certd/pipeline';
|
||||||
import { logger } from '@certd/basic';
|
import { logger } from '@certd/basic';
|
||||||
import { SysInstallInfo, SysLicenseInfo, SysSettingsService } from '../../settings/index.js';
|
import { SysInstallInfo, SysLicenseInfo, SysSettingsService } from '../../settings/index.js';
|
||||||
@@ -11,26 +11,26 @@ export class PlusService {
|
|||||||
@Config('plus.server.baseUrls')
|
@Config('plus.server.baseUrls')
|
||||||
plusServerBaseUrls: string[];
|
plusServerBaseUrls: string[];
|
||||||
|
|
||||||
plusRequestService: PlusRequestService;
|
async getPlusRequestService() {
|
||||||
|
|
||||||
@Init()
|
|
||||||
async init() {
|
|
||||||
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
|
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
|
||||||
this.plusRequestService = new PlusRequestService({
|
return new PlusRequestService({
|
||||||
plusServerBaseUrls: this.plusServerBaseUrls,
|
plusServerBaseUrls: this.plusServerBaseUrls,
|
||||||
subjectId: installInfo.siteId,
|
subjectId: installInfo.siteId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async requestWithoutSign(config: any) {
|
async requestWithoutSign(config: any) {
|
||||||
return await this.plusRequestService.requestWithoutSign(config);
|
const plusRequestService = await this.getPlusRequestService();
|
||||||
|
return await plusRequestService.requestWithoutSign(config);
|
||||||
}
|
}
|
||||||
async request(config: any) {
|
async request(config: any) {
|
||||||
return await this.plusRequestService.request(config);
|
const plusRequestService = await this.getPlusRequestService();
|
||||||
|
return await plusRequestService.request(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
async active(formData: { code: any; appKey: string; subjectId: string }) {
|
async active(formData: { code: any; appKey: string; subjectId: string }) {
|
||||||
return await this.plusRequestService.requestWithoutSign({
|
const plusRequestService = await this.getPlusRequestService();
|
||||||
|
return await plusRequestService.requestWithoutSign({
|
||||||
url: '/activation/active',
|
url: '/activation/active',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: formData,
|
data: formData,
|
||||||
@@ -55,16 +55,18 @@ export class PlusService {
|
|||||||
const licenseInfo: SysLicenseInfo = await this.sysSettingsService.getSetting(SysLicenseInfo);
|
const licenseInfo: SysLicenseInfo = await this.sysSettingsService.getSetting(SysLicenseInfo);
|
||||||
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
|
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
|
||||||
|
|
||||||
|
const plusRequestService = await this.getPlusRequestService();
|
||||||
return await verify({
|
return await verify({
|
||||||
subjectId: installInfo.siteId,
|
subjectId: installInfo.siteId,
|
||||||
license: licenseInfo.license,
|
license: licenseInfo.license,
|
||||||
plusRequestService: this.plusRequestService,
|
plusRequestService: plusRequestService,
|
||||||
bindUrl: installInfo?.bindUrl,
|
bindUrl: installInfo?.bindUrl,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async bindUrl(subjectId: string, url: string) {
|
async bindUrl(subjectId: string, url: string) {
|
||||||
return await this.plusRequestService.request({
|
const plusRequestService = await this.getPlusRequestService();
|
||||||
|
return await plusRequestService.request({
|
||||||
url: '/activation/subject/urlBind',
|
url: '/activation/subject/urlBind',
|
||||||
data: {
|
data: {
|
||||||
subjectId,
|
subjectId,
|
||||||
|
|||||||
@@ -45,6 +45,26 @@ export class SysLicenseInfo extends BaseSettings {
|
|||||||
license?: string;
|
license?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class SysEmailConf extends BaseSettings {
|
||||||
|
static __title__ = '邮箱配置';
|
||||||
|
static __key__ = 'sys.email';
|
||||||
|
static __access__ = 'private';
|
||||||
|
|
||||||
|
host: string;
|
||||||
|
port: number;
|
||||||
|
auth: {
|
||||||
|
user: string;
|
||||||
|
pass: string;
|
||||||
|
};
|
||||||
|
secure: boolean; // use TLS
|
||||||
|
tls: {
|
||||||
|
// do not fail on invalid certs
|
||||||
|
rejectUnauthorized: boolean;
|
||||||
|
};
|
||||||
|
sender: string;
|
||||||
|
usePlus?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
export class SysSiteInfo extends BaseSettings {
|
export class SysSiteInfo extends BaseSettings {
|
||||||
static __title__ = '站点信息';
|
static __title__ = '站点信息';
|
||||||
static __key__ = 'sys.site';
|
static __key__ = 'sys.site';
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { CacheManager } from '@midwayjs/cache';
|
|||||||
import { BaseSettings, SysPrivateSettings, SysPublicSettings } from './models.js';
|
import { BaseSettings, SysPrivateSettings, SysPublicSettings } from './models.js';
|
||||||
import * as _ from 'lodash-es';
|
import * as _ from 'lodash-es';
|
||||||
import { BaseService } from '../../../basic/index.js';
|
import { BaseService } from '../../../basic/index.js';
|
||||||
import { checkComm } from '@certd/pipeline';
|
import { isComm } from '@certd/pipeline';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置
|
* 设置
|
||||||
@@ -40,8 +40,8 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
|
|||||||
if (!key) {
|
if (!key) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (key === 'sys.site') {
|
if (key === 'sys.site' && isComm()) {
|
||||||
checkComm();
|
return null;
|
||||||
}
|
}
|
||||||
return await this.repository.findOne({
|
return await this.repository.findOne({
|
||||||
where: {
|
where: {
|
||||||
@@ -83,6 +83,7 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
|
|||||||
let newSetting: T = new type();
|
let newSetting: T = new type();
|
||||||
const savedSettings = await this.getSettingByKey(key);
|
const savedSettings = await this.getSettingByKey(key);
|
||||||
newSetting = _.merge(newSetting, savedSettings);
|
newSetting = _.merge(newSetting, savedSettings);
|
||||||
|
await this.saveSetting(newSetting);
|
||||||
await this.cache.set(cacheKey, newSetting);
|
await this.cache.set(cacheKey, newSetting);
|
||||||
return newSetting;
|
return newSetting;
|
||||||
}
|
}
|
||||||
@@ -95,6 +96,7 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
|
|||||||
const entity = await this.getByKey(key);
|
const entity = await this.getByKey(key);
|
||||||
if (entity) {
|
if (entity) {
|
||||||
entity.setting = JSON.stringify(bean);
|
entity.setting = JSON.stringify(bean);
|
||||||
|
entity.access = type.__access__;
|
||||||
await this.repository.save(entity);
|
await this.repository.save(entity);
|
||||||
} else {
|
} else {
|
||||||
const newEntity = new SysSettingsEntity();
|
const newEntity = new SysSettingsEntity();
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.26.3](https://github.com/certd/certd/compare/v1.26.2...v1.26.3) (2024-10-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||||
|
|
||||||
|
## [1.26.2](https://github.com/certd/certd/compare/v1.26.1...v1.26.2) (2024-10-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||||
|
|
||||||
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/midway-flyway-js",
|
"name": "@certd/midway-flyway-js",
|
||||||
"version": "1.26.1",
|
"version": "1.26.3",
|
||||||
"description": "midway with flyway, sql upgrade way ",
|
"description": "midway with flyway, sql upgrade way ",
|
||||||
"private": false,
|
"private": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -56,5 +56,5 @@
|
|||||||
"typeorm": "^0.3.11",
|
"typeorm": "^0.3.11",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "46b810822986f7144bb4f67ae5c4a239dbb3691b"
|
"gitHead": "66f9b08fcf5035577eafc609fd634d6490bc9cae"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.26.3](https://github.com/certd/certd/compare/v1.26.2...v1.26.3) (2024-10-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
|
## [1.26.2](https://github.com/certd/certd/compare/v1.26.1...v1.26.2) (2024-10-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-cert
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-cert",
|
"name": "@certd/plugin-cert",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.26.1",
|
"version": "1.26.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
@@ -15,9 +15,9 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/acme-client": "^1.26.1",
|
"@certd/acme-client": "^1.26.3",
|
||||||
"@certd/basic": "^1.26.1",
|
"@certd/basic": "^1.26.3",
|
||||||
"@certd/pipeline": "^1.26.1",
|
"@certd/pipeline": "^1.26.3",
|
||||||
"@google-cloud/publicca": "^1.3.0",
|
"@google-cloud/publicca": "^1.3.0",
|
||||||
"dayjs": "^1.11.7",
|
"dayjs": "^1.11.7",
|
||||||
"jszip": "^3.10.1",
|
"jszip": "^3.10.1",
|
||||||
@@ -57,5 +57,5 @@
|
|||||||
"vite": "^3.1.0",
|
"vite": "^3.1.0",
|
||||||
"vue-tsc": "^0.38.9"
|
"vue-tsc": "^0.38.9"
|
||||||
},
|
},
|
||||||
"gitHead": "46b810822986f7144bb4f67ae5c4a239dbb3691b"
|
"gitHead": "66f9b08fcf5035577eafc609fd634d6490bc9cae"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,18 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.26.3](https://github.com/certd/certd/compare/v1.26.2...v1.26.3) (2024-10-12)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 优化系统设置加载时机 ([7396253](https://github.com/certd/certd/commit/73962536d5a4769902d760d005f3f879465addcc))
|
||||||
|
|
||||||
|
## [1.26.2](https://github.com/certd/certd/compare/v1.26.1...v1.26.2) (2024-10-11)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 邮箱设置改为系统设置,普通用户无需配置发件邮箱 ([4244569](https://github.com/certd/certd/commit/42445692117184a3293e63bef84a74cbb5984b0e))
|
||||||
|
|
||||||
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/ui-client
|
**Note:** Version bump only for package @certd/ui-client
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
<div class="fs-bootstrap__loading"></div>
|
<div class="fs-bootstrap__loading"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="fs-bootstrap__footer">
|
<div class="fs-bootstrap__footer">
|
||||||
<a href="https://github.com/certd/certd" target="_blank">
|
<!-- <a href="https://github.com/certd/certd" target="_blank">-->
|
||||||
https://github.com/certd/certd
|
<!-- https://github.com/certd/certd-->
|
||||||
</a>
|
<!-- </a>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/ui-client",
|
"name": "@certd/ui-client",
|
||||||
"version": "1.26.1",
|
"version": "1.26.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --open",
|
"dev": "vite --open",
|
||||||
@@ -61,8 +61,8 @@
|
|||||||
"vuedraggable": "^4.1.0"
|
"vuedraggable": "^4.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/lib-iframe": "^1.26.1",
|
"@certd/lib-iframe": "^1.26.3",
|
||||||
"@certd/pipeline": "^1.26.1",
|
"@certd/pipeline": "^1.26.3",
|
||||||
"@rollup/plugin-commonjs": "^25.0.7",
|
"@rollup/plugin-commonjs": "^25.0.7",
|
||||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||||
"@types/chai": "^4.3.12",
|
"@types/chai": "^4.3.12",
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ export default {
|
|||||||
const pageStore = usePageStore();
|
const pageStore = usePageStore();
|
||||||
pageStore.init();
|
pageStore.init();
|
||||||
const settingStore = useSettingStore();
|
const settingStore = useSettingStore();
|
||||||
settingStore.init();
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
routerEnabled,
|
routerEnabled,
|
||||||
|
|||||||
@@ -1,6 +1,28 @@
|
|||||||
import { request } from "../service";
|
import { request } from "../service";
|
||||||
import { SiteEnv, SiteInfo } from "/@/store/modules/settings";
|
|
||||||
|
|
||||||
|
export type SiteEnv = {
|
||||||
|
agent?: {
|
||||||
|
enabled?: boolean;
|
||||||
|
contactText?: string;
|
||||||
|
contactLink?: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
export type SiteInfo = {
|
||||||
|
title: string;
|
||||||
|
slogan: string;
|
||||||
|
logo: string;
|
||||||
|
loginLogo: string;
|
||||||
|
icpNo: string;
|
||||||
|
licenseTo?: string;
|
||||||
|
licenseToUrl?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PlusInfo = {
|
||||||
|
vipType?: string;
|
||||||
|
expireTime?: number;
|
||||||
|
isPlus: boolean;
|
||||||
|
isComm?: boolean;
|
||||||
|
};
|
||||||
export type SysPublicSetting = {
|
export type SysPublicSetting = {
|
||||||
registerEnabled: boolean;
|
registerEnabled: boolean;
|
||||||
managerOtherUserPipeline: boolean;
|
managerOtherUserPipeline: boolean;
|
||||||
@@ -11,29 +33,17 @@ export type SysInstallInfo = {
|
|||||||
siteId: string;
|
siteId: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function getSysPublicSettings(): Promise<SysPublicSetting> {
|
export type AllSettings = {
|
||||||
return await request({
|
sysPublic: SysPublicSetting;
|
||||||
url: "/basic/settings/public",
|
installInfo: SysInstallInfo;
|
||||||
method: "get"
|
plusInfo: PlusInfo;
|
||||||
});
|
siteInfo: SiteInfo;
|
||||||
}
|
siteEnv: SiteEnv;
|
||||||
|
};
|
||||||
|
|
||||||
export async function getInstallInfo(): Promise<SysInstallInfo> {
|
export async function loadAllSettings(): Promise<AllSettings> {
|
||||||
return await request({
|
return await request({
|
||||||
url: "/basic/settings/install",
|
url: "/basic/settings/all",
|
||||||
method: "get"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getSiteInfo(): Promise<SiteInfo> {
|
|
||||||
return await request({
|
|
||||||
url: "/basic/settings/siteInfo",
|
|
||||||
method: "get"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
export async function getSiteEnv(): Promise<SiteEnv> {
|
|
||||||
return await request({
|
|
||||||
url: "/basic/settings/siteEnv",
|
|
||||||
method: "get"
|
method: "get"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -45,10 +55,3 @@ export async function bindUrl(data: any): Promise<any> {
|
|||||||
data
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getPlusInfo() {
|
|
||||||
return await request({
|
|
||||||
url: "/basic/settings/plusInfo",
|
|
||||||
method: "get"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import TutorialSteps from "/@/components/tutorial/tutorial-steps.vue";
|
import TutorialSteps from "/@/components/tutorial/tutorial-steps.vue";
|
||||||
|
import { useSettingStore } from "/@/store/modules/settings";
|
||||||
const openedRef = ref(false);
|
const openedRef = ref(false);
|
||||||
function open() {
|
function open() {
|
||||||
openedRef.value = true;
|
openedRef.value = true;
|
||||||
@@ -14,10 +15,12 @@ function prev() {
|
|||||||
function next() {
|
function next() {
|
||||||
console.log("next");
|
console.log("next");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const settingStore = useSettingStore();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="tutorial-button" @click="open">
|
<div v-if="!settingStore.isComm" class="tutorial-button" @click="open">
|
||||||
<fs-icon icon="mingcute:question-line"></fs-icon>
|
<fs-icon icon="mingcute:question-line"></fs-icon>
|
||||||
<div class="ml-5">使用教程</div>
|
<div class="ml-5">使用教程</div>
|
||||||
<a-modal v-model:open="openedRef" class="tutorial-modal" width="90%">
|
<a-modal v-model:open="openedRef" class="tutorial-modal" width="90%">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout-vip isPlus" @click="openUpgrade">
|
<div v-if="!settingStore.isComm || userStore.isAdmin" class="layout-vip isPlus" @click="openUpgrade">
|
||||||
<contextHolder />
|
<contextHolder />
|
||||||
<fs-icon icon="mingcute:vip-1-line" :title="text.title" />
|
<fs-icon icon="mingcute:vip-1-line" :title="text.title" />
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
<div class="fs-user-info">您好,{{ userStore.getUserInfo?.nickName }}</div>
|
<div class="fs-user-info">您好,{{ userStore.getUserInfo?.nickName }}</div>
|
||||||
<template #overlay>
|
<template #overlay>
|
||||||
<a-menu>
|
<a-menu>
|
||||||
|
<a-menu-item>
|
||||||
|
<div @click="goUserProfile">账号信息</div>
|
||||||
|
</a-menu-item>
|
||||||
<a-menu-item>
|
<a-menu-item>
|
||||||
<div @click="doLogout">注销登录</div>
|
<div @click="doLogout">注销登录</div>
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
@@ -10,31 +13,33 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent } from "vue";
|
|
||||||
import { useUserStore } from "/src/store/modules/user";
|
import { useUserStore } from "/src/store/modules/user";
|
||||||
import { Modal } from "ant-design-vue";
|
import { Modal } from "ant-design-vue";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
export default defineComponent({
|
import { useRouter } from "vue-router";
|
||||||
name: "FsUserInfo",
|
|
||||||
setup() {
|
defineOptions({
|
||||||
const userStore = useUserStore();
|
name: "FsUserInfo"
|
||||||
console.log("user", userStore);
|
|
||||||
const { t } = useI18n();
|
|
||||||
function doLogout() {
|
|
||||||
Modal.confirm({
|
|
||||||
iconType: "warning",
|
|
||||||
title: t("app.login.logoutTip"),
|
|
||||||
content: t("app.login.logoutMessage"),
|
|
||||||
onOk: async () => {
|
|
||||||
await userStore.logout(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
userStore,
|
|
||||||
doLogout
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
const userStore = useUserStore();
|
||||||
|
console.log("user", userStore);
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
function goUserProfile() {
|
||||||
|
console.log("goUserProfile");
|
||||||
|
router.push("/certd/mine/user-profile");
|
||||||
|
}
|
||||||
|
function doLogout() {
|
||||||
|
Modal.confirm({
|
||||||
|
iconType: "warning",
|
||||||
|
title: t("app.login.logoutTip"),
|
||||||
|
content: t("app.login.logoutMessage"),
|
||||||
|
onOk: async () => {
|
||||||
|
await userStore.logout(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
<!-- Button-->
|
<!-- Button-->
|
||||||
<!-- </button>-->
|
<!-- </button>-->
|
||||||
<fs-menu
|
<fs-menu
|
||||||
v-if="settingStore?.siteEnv?.agent?.enabled === false"
|
v-if="settingStore?.siteEnv?.agent?.enabled === false && !settingStore.isComm"
|
||||||
class="header-menu"
|
class="header-menu"
|
||||||
mode="horizontal"
|
mode="horizontal"
|
||||||
:expand-selected="false"
|
:expand-selected="false"
|
||||||
@@ -67,19 +67,22 @@
|
|||||||
</a-layout-content>
|
</a-layout-content>
|
||||||
<a-layout-footer class="fs-framework-footer">
|
<a-layout-footer class="fs-framework-footer">
|
||||||
<div>
|
<div>
|
||||||
<span>Powered by</span>
|
<span v-if="!settingStore.isComm">
|
||||||
<a> handsfree.work </a>
|
<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">
|
<template v-if="siteInfo.icpNo">
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<span>
|
<span>
|
||||||
<a href="https://beian.miit.gov.cn/" target="_blank">{{ siteInfo.icpNo }}</a>
|
<a href="https://beian.miit.gov.cn/" target="_blank">{{ siteInfo.icpNo }}</a>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="siteInfo.licenseTo">
|
|
||||||
<a-divider type="vertical" />
|
|
||||||
<a :href="siteInfo.licenseToUrl || ''">{{ siteInfo.licenseTo }}</a>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
<div>v{{ version }}</div>
|
<div>v{{ version }}</div>
|
||||||
|
|
||||||
|
|||||||
@@ -13,26 +13,24 @@
|
|||||||
<router-view />
|
<router-view />
|
||||||
|
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<!-- <div class="links">-->
|
|
||||||
<!-- <a href="_self">帮助</a>-->
|
|
||||||
<!-- <a href="_self">隐私</a>-->
|
|
||||||
<!-- <a href="_self">条款</a>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<div class="copyright">
|
<div class="copyright">
|
||||||
<span>Copyright</span>
|
<span v-if="!settingStore.isComm">
|
||||||
<span>©</span>
|
<span>Copyright</span>
|
||||||
<span>{{ envRef.COPYRIGHT_YEAR }}</span>
|
<span>©</span>
|
||||||
<span>
|
<span>{{ envRef.COPYRIGHT_YEAR }}</span>
|
||||||
<a :href="envRef.COPYRIGHT_URL" target="_blank">{{ envRef.COPYRIGHT_NAME }}</a>
|
<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>
|
||||||
<span v-if="siteInfo.icpNo">
|
<span v-if="siteInfo.icpNo">
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<a href="https://beian.miit.gov.cn/" target="_blank">{{ siteInfo.icpNo }}</a>
|
<a href="https://beian.miit.gov.cn/" target="_blank">{{ siteInfo.icpNo }}</a>
|
||||||
</span>
|
</span>
|
||||||
<span v-if="siteInfo.licenseTo">
|
|
||||||
<a-divider type="vertical" />
|
|
||||||
<a :href="siteInfo.licenseToUrl" target="_blank">{{ siteInfo.licenseTo }}</a>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import { site } from "../utils/util.site";
|
|||||||
import { routes } from "./resolve";
|
import { routes } from "./resolve";
|
||||||
import { useResourceStore } from "../store/modules/resource";
|
import { useResourceStore } from "../store/modules/resource";
|
||||||
import { useUserStore } from "../store/modules/user";
|
import { useUserStore } from "../store/modules/user";
|
||||||
|
import { useSettingStore } from "/@/store/modules/settings";
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHashHistory(),
|
history: createWebHashHistory(),
|
||||||
routes
|
routes
|
||||||
@@ -18,6 +20,8 @@ const router = createRouter({
|
|||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
// 进度条
|
// 进度条
|
||||||
NProgress.start();
|
NProgress.start();
|
||||||
|
const settingStore = useSettingStore();
|
||||||
|
await settingStore.initOnce();
|
||||||
// 修复三级以上路由页面无法缓存的问题
|
// 修复三级以上路由页面无法缓存的问题
|
||||||
if (to.matched && to.matched.length > 2) {
|
if (to.matched && to.matched.length > 2) {
|
||||||
to.matched.splice(1, to.matched.length - 2);
|
to.matched.splice(1, to.matched.length - 2);
|
||||||
|
|||||||
@@ -27,8 +27,7 @@ export const frameworkResource = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
//...crudResources,
|
//...crudResources,
|
||||||
...certdResources,
|
...certdResources
|
||||||
...sysResources
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { sysResources } from "/@/router/source/modules/sys";
|
||||||
|
|
||||||
export const certdResources = [
|
export const certdResources = [
|
||||||
{
|
{
|
||||||
title: "证书自动化",
|
title: "证书自动化",
|
||||||
@@ -56,16 +58,16 @@ export const certdResources = [
|
|||||||
auth: true
|
auth: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: "邮箱设置",
|
// title: "邮箱设置",
|
||||||
name: "EmailSetting",
|
// name: "EmailSetting",
|
||||||
path: "/certd/settings/email",
|
// path: "/certd/settings/email",
|
||||||
component: "/certd/settings/email-setting.vue",
|
// component: "/certd/settings/email-setting.vue",
|
||||||
meta: {
|
// meta: {
|
||||||
icon: "ion:mail-outline",
|
// icon: "ion:mail-outline",
|
||||||
auth: true
|
// auth: true
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: "账号信息",
|
title: "账号信息",
|
||||||
name: "UserProfile",
|
name: "UserProfile",
|
||||||
@@ -73,9 +75,11 @@ export const certdResources = [
|
|||||||
component: "/certd/mine/user-profile.vue",
|
component: "/certd/mine/user-profile.vue",
|
||||||
meta: {
|
meta: {
|
||||||
icon: "ion:person-outline",
|
icon: "ion:person-outline",
|
||||||
auth: true
|
auth: true,
|
||||||
|
isMenu: false
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
...sysResources
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -13,40 +13,6 @@ export const sysResources = [
|
|||||||
permission: "sys"
|
permission: "sys"
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
|
||||||
title: "权限管理",
|
|
||||||
name: "AuthorityManager",
|
|
||||||
path: "/sys/authority",
|
|
||||||
redirect: "/sys/authority/permission",
|
|
||||||
meta: {
|
|
||||||
icon: "ion:ribbon-outline",
|
|
||||||
//需要校验权限
|
|
||||||
permission: "sys:auth"
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
title: "权限资源管理",
|
|
||||||
name: "PermissionManager",
|
|
||||||
path: "/sys/authority/permission",
|
|
||||||
component: "/sys/authority/permission/index.vue",
|
|
||||||
meta: {
|
|
||||||
icon: "ion:list-outline",
|
|
||||||
//需要校验权限
|
|
||||||
permission: "sys:auth:per:view"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "角色管理",
|
|
||||||
name: "RoleManager",
|
|
||||||
path: "/sys/authority/role",
|
|
||||||
component: "/sys/authority/role/index.vue",
|
|
||||||
meta: {
|
|
||||||
icon: "ion:people-outline",
|
|
||||||
permission: "sys:auth:role:view"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "用户管理",
|
title: "用户管理",
|
||||||
name: "UserManager",
|
name: "UserManager",
|
||||||
@@ -77,6 +43,17 @@ export const sysResources = [
|
|||||||
permission: "sys:settings:view"
|
permission: "sys:settings:view"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "邮箱设置",
|
||||||
|
name: "EmailSetting",
|
||||||
|
path: "/sys/settings/email",
|
||||||
|
component: "/sys/settings/email-setting.vue",
|
||||||
|
meta: {
|
||||||
|
permission: "sys:settings:view",
|
||||||
|
icon: "ion:mail-outline",
|
||||||
|
auth: true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "站点个性化",
|
title: "站点个性化",
|
||||||
name: "SiteSetting",
|
name: "SiteSetting",
|
||||||
@@ -91,6 +68,38 @@ export const sysResources = [
|
|||||||
permission: "sys:settings:view"
|
permission: "sys:settings:view"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "账号绑定",
|
||||||
|
name: "AccountBind",
|
||||||
|
path: "/sys/account",
|
||||||
|
component: "/sys/account/index.vue",
|
||||||
|
meta: {
|
||||||
|
icon: "ion:golf-outline",
|
||||||
|
permission: "sys:settings:view"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "权限管理",
|
||||||
|
name: "PermissionManager",
|
||||||
|
path: "/sys/authority/permission",
|
||||||
|
component: "/sys/authority/permission/index.vue",
|
||||||
|
meta: {
|
||||||
|
icon: "ion:list-outline",
|
||||||
|
//需要校验权限
|
||||||
|
permission: "sys:auth:per:view"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "角色管理",
|
||||||
|
name: "RoleManager",
|
||||||
|
path: "/sys/authority/role",
|
||||||
|
component: "/sys/authority/role/index.vue",
|
||||||
|
meta: {
|
||||||
|
icon: "ion:people-outline",
|
||||||
|
permission: "sys:auth:role:view"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// {
|
// {
|
||||||
// title: "商业版设置",
|
// title: "商业版设置",
|
||||||
// name: "SysCommercial",
|
// name: "SysCommercial",
|
||||||
@@ -118,16 +127,6 @@ export const sysResources = [
|
|||||||
// }
|
// }
|
||||||
// ]
|
// ]
|
||||||
// }
|
// }
|
||||||
{
|
|
||||||
title: "账号绑定",
|
|
||||||
name: "AccountBind",
|
|
||||||
path: "/sys/account",
|
|
||||||
component: "/sys/account/index.vue",
|
|
||||||
meta: {
|
|
||||||
icon: "ion:golf-outline",
|
|
||||||
permission: "sys:settings:view"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import _ from "lodash-es";
|
|||||||
import { LocalStorage } from "/src/utils/util.storage";
|
import { LocalStorage } from "/src/utils/util.storage";
|
||||||
|
|
||||||
import * as basicApi from "/@/api/modules/api.basic";
|
import * as basicApi from "/@/api/modules/api.basic";
|
||||||
import { SysInstallInfo, SysPublicSetting } from "/@/api/modules/api.basic";
|
import { PlusInfo, SiteEnv, SiteInfo, SysInstallInfo, SysPublicSetting } from "/@/api/modules/api.basic";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/modules/user";
|
||||||
import { mitter } from "/@/utils/util.mitt";
|
import { mitter } from "/@/utils/util.mitt";
|
||||||
import { env } from "/@/utils/util.env";
|
import { env } from "/@/utils/util.env";
|
||||||
@@ -36,31 +36,7 @@ export interface SettingState {
|
|||||||
siteInfo: SiteInfo;
|
siteInfo: SiteInfo;
|
||||||
plusInfo?: PlusInfo;
|
plusInfo?: PlusInfo;
|
||||||
siteEnv?: SiteEnv;
|
siteEnv?: SiteEnv;
|
||||||
}
|
inited?: boolean;
|
||||||
|
|
||||||
export type SiteEnv = {
|
|
||||||
agent?: {
|
|
||||||
enabled?: boolean;
|
|
||||||
contactText?: string;
|
|
||||||
contactLink?: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
export type SiteInfo = {
|
|
||||||
title: string;
|
|
||||||
slogan: string;
|
|
||||||
logo: string;
|
|
||||||
loginLogo: string;
|
|
||||||
warningOff: boolean;
|
|
||||||
icpNo: string;
|
|
||||||
licenseTo?: string;
|
|
||||||
licenseToUrl?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface PlusInfo {
|
|
||||||
vipType?: string;
|
|
||||||
expireTime?: number;
|
|
||||||
isPlus: boolean;
|
|
||||||
isComm?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultThemeConfig = {
|
const defaultThemeConfig = {
|
||||||
@@ -73,7 +49,6 @@ const defaultSiteInfo = {
|
|||||||
slogan: env.SLOGAN || "让你的证书永不过期",
|
slogan: env.SLOGAN || "让你的证书永不过期",
|
||||||
logo: env.LOGO || "/static/images/logo/logo.svg",
|
logo: env.LOGO || "/static/images/logo/logo.svg",
|
||||||
loginLogo: env.LOGIN_LOGO || "/static/images/logo/rect-block.svg",
|
loginLogo: env.LOGIN_LOGO || "/static/images/logo/rect-block.svg",
|
||||||
warningOff: false,
|
|
||||||
icpNo: env.ICP_NO,
|
icpNo: env.ICP_NO,
|
||||||
licenseTo: "",
|
licenseTo: "",
|
||||||
licenseToUrl: ""
|
licenseToUrl: ""
|
||||||
@@ -88,7 +63,8 @@ export const useSettingStore = defineStore({
|
|||||||
},
|
},
|
||||||
plusInfo: {
|
plusInfo: {
|
||||||
isPlus: false,
|
isPlus: false,
|
||||||
vipType: "free"
|
vipType: "free",
|
||||||
|
isComm: false
|
||||||
},
|
},
|
||||||
sysPublic: {
|
sysPublic: {
|
||||||
registerEnabled: false,
|
registerEnabled: false,
|
||||||
@@ -109,7 +85,8 @@ export const useSettingStore = defineStore({
|
|||||||
contactText: "",
|
contactText: "",
|
||||||
contactLink: ""
|
contactLink: ""
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
inited: false
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
getThemeConfig(): any {
|
getThemeConfig(): any {
|
||||||
@@ -127,6 +104,12 @@ export const useSettingStore = defineStore({
|
|||||||
isComm(): boolean {
|
isComm(): boolean {
|
||||||
return this.plusInfo?.isComm && this.plusInfo?.expireTime > new Date().getTime();
|
return this.plusInfo?.isComm && this.plusInfo?.expireTime > new Date().getTime();
|
||||||
},
|
},
|
||||||
|
isAgent(): boolean {
|
||||||
|
return this.siteEnv?.agent?.enabled === true;
|
||||||
|
},
|
||||||
|
isCommOrAgent() {
|
||||||
|
return this.isComm || this.isAgent;
|
||||||
|
},
|
||||||
vipLabel(): string {
|
vipLabel(): string {
|
||||||
const vipLabelMap: any = {
|
const vipLabelMap: any = {
|
||||||
free: "免费版",
|
free: "免费版",
|
||||||
@@ -146,33 +129,18 @@ export const useSettingStore = defineStore({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async loadSysSettings() {
|
async loadSysSettings() {
|
||||||
await this.loadSysPublicSettings();
|
const allSettings = await basicApi.loadAllSettings();
|
||||||
await this.loadSiteEnv();
|
_.merge(this.sysPublic, allSettings.sysPublic || {});
|
||||||
await this.loadInstallInfo();
|
_.merge(this.installInfo, allSettings.installInfo || {});
|
||||||
await this.loadPlusInfo();
|
_.merge(this.siteEnv, allSettings.siteEnv || {});
|
||||||
await this.loadSiteInfo();
|
_.merge(this.plusInfo, allSettings.plusInfo || {});
|
||||||
|
//@ts-ignore
|
||||||
|
this.initSiteInfo(allSettings.siteInfo || {});
|
||||||
await this.checkUrlBound();
|
await this.checkUrlBound();
|
||||||
},
|
},
|
||||||
async loadSysPublicSettings() {
|
initSiteInfo(siteInfo: SiteInfo) {
|
||||||
const settings = await basicApi.getSysPublicSettings();
|
//@ts-ignore
|
||||||
_.merge(this.sysPublic, settings);
|
if (this.isComm) {
|
||||||
},
|
|
||||||
async loadInstallInfo() {
|
|
||||||
const installInfo = await basicApi.getInstallInfo();
|
|
||||||
_.merge(this.installInfo, installInfo);
|
|
||||||
},
|
|
||||||
async loadSiteEnv() {
|
|
||||||
const siteEnv = await basicApi.getSiteEnv();
|
|
||||||
_.merge(this.siteEnv, siteEnv);
|
|
||||||
},
|
|
||||||
async loadPlusInfo() {
|
|
||||||
this.plusInfo = await basicApi.getPlusInfo();
|
|
||||||
},
|
|
||||||
async loadSiteInfo() {
|
|
||||||
const isComm = this.isComm;
|
|
||||||
let siteInfo: SiteInfo;
|
|
||||||
if (isComm) {
|
|
||||||
siteInfo = await basicApi.getSiteInfo();
|
|
||||||
if (siteInfo.logo) {
|
if (siteInfo.logo) {
|
||||||
siteInfo.logo = `/api/basic/file/download?key=${siteInfo.logo}`;
|
siteInfo.logo = `/api/basic/file/download?key=${siteInfo.logo}`;
|
||||||
}
|
}
|
||||||
@@ -205,8 +173,9 @@ export const useSettingStore = defineStore({
|
|||||||
|
|
||||||
const doBindUrl = async (url: string) => {
|
const doBindUrl = async (url: string) => {
|
||||||
await basicApi.bindUrl({ url });
|
await basicApi.bindUrl({ url });
|
||||||
await this.loadInstallInfo();
|
await this.loadSysSettings();
|
||||||
};
|
};
|
||||||
|
|
||||||
const baseUrl = getBaseUrl();
|
const baseUrl = getBaseUrl();
|
||||||
if (!bindUrl) {
|
if (!bindUrl) {
|
||||||
//绑定url
|
//绑定url
|
||||||
@@ -269,6 +238,13 @@ export const useSettingStore = defineStore({
|
|||||||
async init() {
|
async init() {
|
||||||
await this.setThemeConfig(this.getThemeConfig);
|
await this.setThemeConfig(this.getThemeConfig);
|
||||||
await this.loadSysSettings();
|
await this.loadSysSettings();
|
||||||
|
},
|
||||||
|
async initOnce() {
|
||||||
|
if (this.inited) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await this.init();
|
||||||
|
this.inited = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as envs from "./util.env";
|
import * as envs from "./util.env";
|
||||||
import * as sites from "./util.site";
|
import * as sites from "./util.site";
|
||||||
import * as storages from "./util.storage";
|
import * as storages from "./util.storage";
|
||||||
import * as commons from "./util.common";
|
import commons from "./util.common";
|
||||||
import * as mitt from "./util.mitt";
|
import * as mitt from "./util.mitt";
|
||||||
export const util = {
|
export const util = {
|
||||||
...envs,
|
...envs,
|
||||||
|
|||||||
@@ -29,5 +29,9 @@ export default {
|
|||||||
array.push(item);
|
array.push(item);
|
||||||
}
|
}
|
||||||
return array;
|
return array;
|
||||||
|
},
|
||||||
|
|
||||||
|
async sleep(ms: number) {
|
||||||
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<div class="p-10">
|
<div class="p-10">
|
||||||
<a-descriptions title="" bordered>
|
<a-descriptions title="" bordered>
|
||||||
<a-descriptions-item label="用户名">{{ userInfo.userInfoname }}</a-descriptions-item>
|
<a-descriptions-item label="用户名">{{ userInfo.username }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="昵称">{{ userInfo.nickName }}</a-descriptions-item>
|
<a-descriptions-item label="昵称">{{ userInfo.nickName }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="邮箱">{{ userInfo.email }}</a-descriptions-item>
|
<a-descriptions-item label="邮箱">{{ userInfo.email }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="手机号">{{ userInfo.phoneCode }}{{ userInfo.mobile }}</a-descriptions-item>
|
<a-descriptions-item label="手机号">{{ userInfo.phoneCode }}{{ userInfo.mobile }}</a-descriptions-item>
|
||||||
|
|||||||
@@ -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)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="d2-page-cover__sub-title">{{ siteInfo.slogan }}</p>
|
<p class="d2-page-cover__sub-title">{{ siteInfo.slogan }}</p>
|
||||||
<div v-if="siteInfo.warningOff !== true && settingStore.siteEnv?.agent?.enabled === false" class="warning">
|
<div v-if="!settingStore.isCommOrAgent" class="warning">
|
||||||
<a-alert type="warning" show-icon>
|
<a-alert type="warning" show-icon>
|
||||||
<template #description>
|
<template #description>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
@@ -17,10 +17,10 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-alert>
|
</a-alert>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div v-if="!settingStore.isCommOrAgent" class="content">
|
||||||
<img src="/static/images/preview.png" class="preview_img" />
|
<img src="/static/images/preview.png" class="preview_img" />
|
||||||
</div>
|
</div>
|
||||||
<div class="footer_box">
|
<div v-if="!settingStore.isCommOrAgent" class="footer_box">
|
||||||
<div>如果觉得好用,请不要吝啬你的star哟!</div>
|
<div>如果觉得好用,请不要吝啬你的star哟!</div>
|
||||||
<a href="https://gitee.com/certd/certd" target="_blank"><img src="https://gitee.com/certd/certd/badge/star.svg?theme=dark" alt="star" /></a>
|
<a href="https://gitee.com/certd/certd" target="_blank"><img src="https://gitee.com/certd/certd/badge/star.svg?theme=dark" alt="star" /></a>
|
||||||
<a href="https://github.com/certd/certd" target="_blank"><img alt="GitHub stars" src="https://img.shields.io/github/stars/certd/certd?logo=github" /></a>
|
<a href="https://github.com/certd/certd" target="_blank"><img alt="GitHub stars" src="https://img.shields.io/github/stars/certd/certd?logo=github" /></a>
|
||||||
@@ -29,7 +29,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, ref, Ref } from "vue";
|
import { computed, ref, Ref } from "vue";
|
||||||
import { SiteInfo, useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/modules/settings";
|
||||||
|
import { SiteInfo } from "/@/api/modules/api.basic";
|
||||||
|
|
||||||
const version = ref(import.meta.env.VITE_APP_VERSION);
|
const version = ref(import.meta.env.VITE_APP_VERSION);
|
||||||
const settingStore = useSettingStore();
|
const settingStore = useSettingStore();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { request } from "/@/api/service";
|
import { request } from "/src/api/service";
|
||||||
const apiPrefix = "/basic/email";
|
const apiPrefix = "/basic/email";
|
||||||
|
|
||||||
export async function TestSend(receiver: string) {
|
export async function TestSend(receiver: string) {
|
||||||
@@ -4,7 +4,8 @@ const apiPrefix = "/sys/settings";
|
|||||||
|
|
||||||
export const SettingKeys = {
|
export const SettingKeys = {
|
||||||
SysPublic: "sys.public",
|
SysPublic: "sys.public",
|
||||||
SysPrivate: "sys.private"
|
SysPrivate: "sys.private",
|
||||||
|
SysEmail: "sys.email"
|
||||||
};
|
};
|
||||||
export async function SettingsGet(key: string) {
|
export async function SettingsGet(key: string) {
|
||||||
return await request({
|
return await request({
|
||||||
@@ -17,7 +18,7 @@ export async function SettingsGet(key: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function SettingsSave(key: string, setting: any) {
|
export async function SettingsSave(key: string, setting: any) {
|
||||||
await request({
|
return await request({
|
||||||
url: apiPrefix + "/save",
|
url: apiPrefix + "/save",
|
||||||
method: "post",
|
method: "post",
|
||||||
data: {
|
data: {
|
||||||
@@ -27,8 +28,15 @@ export async function SettingsSave(key: string, setting: any) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function EmailSettingsGet() {
|
||||||
|
return await request({
|
||||||
|
url: apiPrefix + "/getEmailSettings",
|
||||||
|
method: "post"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export async function PublicSettingsSave(setting: any) {
|
export async function PublicSettingsSave(setting: any) {
|
||||||
await request({
|
return await request({
|
||||||
url: apiPrefix + "/savePublicSettings",
|
url: apiPrefix + "/savePublicSettings",
|
||||||
method: "post",
|
method: "post",
|
||||||
data: setting
|
data: setting
|
||||||
@@ -36,7 +44,7 @@ export async function PublicSettingsSave(setting: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function stopOtherUserTimer() {
|
export async function stopOtherUserTimer() {
|
||||||
await request({
|
return await request({
|
||||||
url: apiPrefix + "/stopOtherUserTimer",
|
url: apiPrefix + "/stopOtherUserTimer",
|
||||||
method: "post"
|
method: "post"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ import * as api from "./api";
|
|||||||
import { SettingKeys } from "./api";
|
import { SettingKeys } from "./api";
|
||||||
import * as emailApi from "./api.email";
|
import * as emailApi from "./api.email";
|
||||||
import { notification } from "ant-design-vue";
|
import { notification } from "ant-design-vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/src/store/modules/settings";
|
||||||
|
import _ from "lodash-es";
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "EmailSetting"
|
name: "EmailSetting"
|
||||||
});
|
});
|
||||||
@@ -114,19 +114,15 @@ const formState = reactive<Partial<FormState>>({
|
|||||||
});
|
});
|
||||||
|
|
||||||
async function load() {
|
async function load() {
|
||||||
const data: any = await api.SettingsGet(SettingKeys.Email);
|
const data: any = await api.EmailSettingsGet();
|
||||||
if (!data?.setting) {
|
_.merge(formState, data);
|
||||||
return;
|
|
||||||
}
|
|
||||||
const setting = JSON.parse(data.setting);
|
|
||||||
Object.assign(formState, setting);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
load();
|
load();
|
||||||
|
|
||||||
const onFinish = async (form: any) => {
|
const onFinish = async (form: any) => {
|
||||||
console.log("Success:", form);
|
console.log("Success:", form);
|
||||||
await api.SettingsSave(SettingKeys.Email, form);
|
await api.SettingsSave(SettingKeys.SysEmail, form);
|
||||||
notification.success({
|
notification.success({
|
||||||
message: "保存成功"
|
message: "保存成功"
|
||||||
});
|
});
|
||||||
@@ -137,7 +133,7 @@ const onFinishFailed = (errorInfo: any) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
async function onUsePlusChanged() {
|
async function onUsePlusChanged() {
|
||||||
await api.SettingsSave(SettingKeys.Email, formState);
|
await api.SettingsSave(SettingKeys.SysEmail, formState);
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TestFormState {
|
interface TestFormState {
|
||||||
@@ -54,11 +54,13 @@ defineOptions({
|
|||||||
interface FormState {
|
interface FormState {
|
||||||
registerEnabled: boolean;
|
registerEnabled: boolean;
|
||||||
managerOtherUserPipeline: boolean;
|
managerOtherUserPipeline: boolean;
|
||||||
|
icpNo: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const formState = reactive<Partial<FormState>>({
|
const formState = reactive<Partial<FormState>>({
|
||||||
registerEnabled: false,
|
registerEnabled: false,
|
||||||
managerOtherUserPipeline: false
|
managerOtherUserPipeline: false,
|
||||||
|
icpNo: ""
|
||||||
});
|
});
|
||||||
|
|
||||||
async function loadSysPublicSettings() {
|
async function loadSysPublicSettings() {
|
||||||
|
|||||||
@@ -37,9 +37,6 @@
|
|||||||
:build-url="buildUrl"
|
:build-url="buildUrl"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="关闭首页告警" name="warningOff">
|
|
||||||
<a-switch v-model:checked="formState.warningOff" />
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="你的主体名称" name="licenseTo">
|
<a-form-item label="你的主体名称" name="licenseTo">
|
||||||
<a-input v-model:value="formState.licenseTo" />
|
<a-input v-model:value="formState.licenseTo" />
|
||||||
<div class="helper">将会显示在底部</div>
|
<div class="helper">将会显示在底部</div>
|
||||||
@@ -77,7 +74,6 @@ interface FormState {
|
|||||||
slogan: string;
|
slogan: string;
|
||||||
logo: string;
|
logo: string;
|
||||||
loginLogo: string;
|
loginLogo: string;
|
||||||
warningOff: boolean;
|
|
||||||
licenseTo: string;
|
licenseTo: string;
|
||||||
licenseToUrl: string;
|
licenseToUrl: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,19 +21,20 @@ typeorm:
|
|||||||
dataSource:
|
dataSource:
|
||||||
default:
|
default:
|
||||||
database: './data/db-comm.sqlite'
|
database: './data/db-comm.sqlite'
|
||||||
plus:
|
|
||||||
server:
|
|
||||||
baseUrls: ['https://api.ai.handsfree.work', 'https://api.ai.docmirror.cn']
|
|
||||||
|
|
||||||
account:
|
|
||||||
server:
|
|
||||||
baseUrl: 'https://ai.handsfree.work/subject'
|
|
||||||
|
|
||||||
|
|
||||||
#plus:
|
#plus:
|
||||||
# server:
|
# server:
|
||||||
# baseUrls: ['http://127.0.0.1:11007']
|
# baseUrls: ['https://api.ai.handsfree.work', 'https://api.ai.docmirror.cn']
|
||||||
#
|
#
|
||||||
#account:
|
#account:
|
||||||
# server:
|
# server:
|
||||||
# baseUrl: 'http://127.0.0.1:1017/subject'
|
# baseUrl: 'https://ai.handsfree.work/subject'
|
||||||
|
|
||||||
|
|
||||||
|
plus:
|
||||||
|
server:
|
||||||
|
baseUrls: ['http://127.0.0.1:11007']
|
||||||
|
|
||||||
|
account:
|
||||||
|
server:
|
||||||
|
baseUrl: 'http://127.0.0.1:1017/subject'
|
||||||
|
|||||||
40
packages/ui/certd-server/.env.commpro.yaml
Normal file
40
packages/ui/certd-server/.env.commpro.yaml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# key: ./data/ssl/cert.key
|
||||||
|
# cert: ./data/ssl/cert.crt
|
||||||
|
#plus:
|
||||||
|
# server:
|
||||||
|
# baseUrl: 'http://127.0.0.1:11007'
|
||||||
|
|
||||||
|
#flyway:
|
||||||
|
# scriptDir: './db/migration-pg'
|
||||||
|
|
||||||
|
#typeorm:
|
||||||
|
# dataSource:
|
||||||
|
# default:
|
||||||
|
# type: postgres
|
||||||
|
# host: localhost
|
||||||
|
# port: 5433
|
||||||
|
# username: postgres
|
||||||
|
# password: root
|
||||||
|
# database: postgres
|
||||||
|
|
||||||
|
typeorm:
|
||||||
|
dataSource:
|
||||||
|
default:
|
||||||
|
database: './data/db-comm-pro.sqlite'
|
||||||
|
|
||||||
|
plus:
|
||||||
|
server:
|
||||||
|
baseUrls: ['https://api.ai.handsfree.work', 'https://api.ai.docmirror.cn']
|
||||||
|
|
||||||
|
account:
|
||||||
|
server:
|
||||||
|
baseUrl: 'https://ai.handsfree.work/subject'
|
||||||
|
|
||||||
|
#
|
||||||
|
#plus:
|
||||||
|
# server:
|
||||||
|
# baseUrls: ['http://127.0.0.1:11007']
|
||||||
|
#
|
||||||
|
#account:
|
||||||
|
# server:
|
||||||
|
# baseUrl: 'http://127.0.0.1:1017/subject'
|
||||||
@@ -17,10 +17,10 @@
|
|||||||
# password: root
|
# password: root
|
||||||
# database: postgres
|
# database: postgres
|
||||||
|
|
||||||
#typeorm:
|
typeorm:
|
||||||
# dataSource:
|
dataSource:
|
||||||
# default:
|
default:
|
||||||
# database: './data/db-comm.sqlite'
|
database: './data/db.sqlite'
|
||||||
plus:
|
plus:
|
||||||
server:
|
server:
|
||||||
baseUrls: ['https://api.ai.handsfree.work', 'https://api.ai.docmirror.cn']
|
baseUrls: ['https://api.ai.handsfree.work', 'https://api.ai.docmirror.cn']
|
||||||
|
|||||||
@@ -3,6 +3,22 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.26.3](https://github.com/certd/certd/compare/v1.26.2...v1.26.3) (2024-10-12)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 优化系统设置加载时机 ([7396253](https://github.com/certd/certd/commit/73962536d5a4769902d760d005f3f879465addcc))
|
||||||
|
|
||||||
|
## [1.26.2](https://github.com/certd/certd/compare/v1.26.1...v1.26.2) (2024-10-11)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复某些情况下bindUrl失败的bug ([91fc1cd](https://github.com/certd/certd/commit/91fc1cd7353be4a22be951239ed70b38baebc74e))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 邮箱设置改为系统设置,普通用户无需配置发件邮箱 ([4244569](https://github.com/certd/certd/commit/42445692117184a3293e63bef84a74cbb5984b0e))
|
||||||
|
|
||||||
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
## [1.26.1](https://github.com/certd/certd/compare/v1.26.0...v1.26.1) (2024-10-10)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/ui-server
|
**Note:** Version bump only for package @certd/ui-server
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/ui-server",
|
"name": "@certd/ui-server",
|
||||||
"version": "1.26.1",
|
"version": "1.26.3",
|
||||||
"description": "fast-server base midway",
|
"description": "fast-server base midway",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
"start": "cross-env NODE_ENV=production node ./bootstrap.js",
|
"start": "cross-env NODE_ENV=production node ./bootstrap.js",
|
||||||
"dev": "cross-env NODE_ENV=local mwtsc --watch --run @midwayjs/mock/app",
|
"dev": "cross-env NODE_ENV=local mwtsc --watch --run @midwayjs/mock/app",
|
||||||
"commdev": "cross-env NODE_ENV=commdev mwtsc --watch --run @midwayjs/mock/app",
|
"commdev": "cross-env NODE_ENV=commdev mwtsc --watch --run @midwayjs/mock/app",
|
||||||
|
"commpro": "cross-env NODE_ENV=commpro mwtsc --watch --run @midwayjs/mock/app",
|
||||||
"pgdev": "cross-env NODE_ENV=pgdev mwtsc --watch --run @midwayjs/mock/app",
|
"pgdev": "cross-env NODE_ENV=pgdev mwtsc --watch --run @midwayjs/mock/app",
|
||||||
"test": "cross-env NODE_ENV=unittest mocha",
|
"test": "cross-env NODE_ENV=unittest mocha",
|
||||||
"cov": "cross-env c8 --all --reporter=text --reporter=lcovonly npm run test",
|
"cov": "cross-env c8 --all --reporter=text --reporter=lcovonly npm run test",
|
||||||
@@ -23,17 +24,17 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alicloud/pop-core": "^1.7.10",
|
"@alicloud/pop-core": "^1.7.10",
|
||||||
"@certd/acme-client": "^1.26.1",
|
"@certd/acme-client": "^1.26.3",
|
||||||
"@certd/commercial-core": "^1.26.1",
|
"@certd/commercial-core": "^1.26.3",
|
||||||
"@certd/lib-huawei": "^1.26.1",
|
"@certd/lib-huawei": "^1.26.3",
|
||||||
"@certd/lib-jdcloud": "^1.26.1",
|
"@certd/lib-jdcloud": "^1.26.3",
|
||||||
"@certd/lib-k8s": "^1.26.1",
|
"@certd/lib-k8s": "^1.26.3",
|
||||||
"@certd/lib-server": "^1.26.1",
|
"@certd/lib-server": "^1.26.3",
|
||||||
"@certd/midway-flyway-js": "^1.26.1",
|
"@certd/midway-flyway-js": "^1.26.3",
|
||||||
"@certd/pipeline": "^1.26.1",
|
"@certd/pipeline": "^1.26.3",
|
||||||
"@certd/plugin-cert": "^1.26.1",
|
"@certd/plugin-cert": "^1.26.3",
|
||||||
"@certd/plugin-plus": "^1.26.1",
|
"@certd/plugin-plus": "^1.26.3",
|
||||||
"@certd/plus-core": "^1.26.1",
|
"@certd/plus-core": "^1.26.3",
|
||||||
"@koa/cors": "^5.0.0",
|
"@koa/cors": "^5.0.0",
|
||||||
"@midwayjs/bootstrap": "~3.17.1",
|
"@midwayjs/bootstrap": "~3.17.1",
|
||||||
"@midwayjs/cache": "~3.14.0",
|
"@midwayjs/cache": "~3.14.0",
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export class MainConfiguration {
|
|||||||
this.app.getMiddleware().insertFirst(async (ctx: IMidwayKoaContext, next: NextFunction) => {
|
this.app.getMiddleware().insertFirst(async (ctx: IMidwayKoaContext, next: NextFunction) => {
|
||||||
await next();
|
await next();
|
||||||
if (ctx.path === '/' || ctx.path === '/index.html') {
|
if (ctx.path === '/' || ctx.path === '/index.html') {
|
||||||
ctx.response.set('Cache-Control', 'public,max-age=180');
|
ctx.response.set('Cache-Control', 'public,max-age=60');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ALL, Body, Config, Controller, Get, Inject, Provide } from '@midwayjs/core';
|
import { Config, Controller, Get, Inject, Provide } from '@midwayjs/core';
|
||||||
import { BaseController, Constants, SysInstallInfo, SysPublicSettings, SysSettingsService, SysSiteEnv, SysSiteInfo } from '@certd/lib-server';
|
import { BaseController, Constants, SysInstallInfo, SysPublicSettings, SysSettingsService, SysSiteEnv, SysSiteInfo } from '@certd/lib-server';
|
||||||
import { AppKey, getPlusInfo } from '@certd/pipeline';
|
import { AppKey, getPlusInfo } from '@certd/pipeline';
|
||||||
|
|
||||||
@@ -15,39 +15,45 @@ export class BasicSettingsController extends BaseController {
|
|||||||
@Config('agent')
|
@Config('agent')
|
||||||
agentConfig: SysSiteEnv['agent'];
|
agentConfig: SysSiteEnv['agent'];
|
||||||
|
|
||||||
@Get('/public', { summary: Constants.per.guest })
|
|
||||||
public async getSysPublic() {
|
public async getSysPublic() {
|
||||||
const settings = await this.sysSettingsService.getSetting(SysPublicSettings);
|
return await this.sysSettingsService.getSetting(SysPublicSettings);
|
||||||
return this.ok(settings);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('/install', { summary: Constants.per.guest })
|
|
||||||
public async getInstallInfo() {
|
public async getInstallInfo() {
|
||||||
const settings: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
|
const settings: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
|
||||||
settings.accountServerBaseUrl = this.accountServerBaseUrl;
|
settings.accountServerBaseUrl = this.accountServerBaseUrl;
|
||||||
settings.appKey = AppKey;
|
settings.appKey = AppKey;
|
||||||
return this.ok(settings);
|
return settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('/siteInfo', { summary: Constants.per.guest })
|
|
||||||
public async getSiteInfo() {
|
public async getSiteInfo() {
|
||||||
const settings: SysSiteInfo = await this.sysSettingsService.getSetting(SysSiteInfo);
|
return await this.sysSettingsService.getSetting(SysSiteInfo);
|
||||||
return this.ok(settings);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('/siteEnv', { summary: Constants.per.guest })
|
|
||||||
public async getSiteEnv() {
|
public async getSiteEnv() {
|
||||||
const env: SysSiteEnv = {
|
const env: SysSiteEnv = {
|
||||||
agent: this.agentConfig,
|
agent: this.agentConfig,
|
||||||
};
|
};
|
||||||
return this.ok(env);
|
return env;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('/plusInfo', { summary: Constants.per.guest })
|
async plusInfo() {
|
||||||
async plusInfo(@Body(ALL) body: any) {
|
return getPlusInfo();
|
||||||
const info = getPlusInfo();
|
}
|
||||||
|
|
||||||
|
@Get('/all', { summary: Constants.per.guest })
|
||||||
|
async getAllSettings() {
|
||||||
|
const sysPublic = await this.getSysPublic();
|
||||||
|
const installInfo = await this.getInstallInfo();
|
||||||
|
const siteInfo = await this.getSiteInfo();
|
||||||
|
const siteEnv = await this.getSiteEnv();
|
||||||
|
const plusInfo = await this.plusInfo();
|
||||||
return this.ok({
|
return this.ok({
|
||||||
...info,
|
sysPublic,
|
||||||
|
installInfo,
|
||||||
|
siteInfo,
|
||||||
|
siteEnv,
|
||||||
|
plusInfo,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
|
import { Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
|
||||||
import type { EmailSend } from '@certd/pipeline';
|
import type { EmailSend } from '@certd/pipeline';
|
||||||
import { IEmailService, isPlus } from '@certd/pipeline';
|
import { IEmailService, isPlus, logger } from '@certd/pipeline';
|
||||||
import nodemailer from 'nodemailer';
|
import nodemailer from 'nodemailer';
|
||||||
import type SMTPConnection from 'nodemailer/lib/smtp-connection';
|
import type SMTPConnection from 'nodemailer/lib/smtp-connection';
|
||||||
import { logger } from '@certd/pipeline';
|
|
||||||
import { UserSettingsService } from '../../mine/service/user-settings-service.js';
|
import { UserSettingsService } from '../../mine/service/user-settings-service.js';
|
||||||
import { PlusService } from '@certd/lib-server';
|
import { PlusService, SysSettingsService } from '@certd/lib-server';
|
||||||
|
import { getEmailSettings } from '../../sys/settings/fix.js';
|
||||||
|
|
||||||
export type EmailConfig = {
|
export type EmailConfig = {
|
||||||
host: string;
|
host: string;
|
||||||
@@ -27,6 +27,9 @@ export type EmailConfig = {
|
|||||||
export class EmailService implements IEmailService {
|
export class EmailService implements IEmailService {
|
||||||
@Inject()
|
@Inject()
|
||||||
settingsService: UserSettingsService;
|
settingsService: UserSettingsService;
|
||||||
|
|
||||||
|
@Inject()
|
||||||
|
sysSettingsService: SysSettingsService;
|
||||||
@Inject()
|
@Inject()
|
||||||
plusService: PlusService;
|
plusService: PlusService;
|
||||||
|
|
||||||
@@ -55,21 +58,22 @@ export class EmailService implements IEmailService {
|
|||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
async send(email: EmailSend) {
|
async send(email: EmailSend) {
|
||||||
console.log('sendEmail', email);
|
logger.info('sendEmail', email);
|
||||||
|
|
||||||
const emailConfigEntity = await this.settingsService.getByKey('email', email.userId);
|
const emailConf = await getEmailSettings(this.sysSettingsService, this.settingsService);
|
||||||
if (emailConfigEntity == null || !emailConfigEntity.setting) {
|
|
||||||
|
if (!emailConf.host && emailConf.usePlus == null) {
|
||||||
if (isPlus()) {
|
if (isPlus()) {
|
||||||
//自动使用plus发邮件
|
//自动使用plus发邮件
|
||||||
return await this.sendByPlus(email);
|
return await this.sendByPlus(email);
|
||||||
}
|
}
|
||||||
throw new Error('email settings 未设置');
|
throw new Error('email settings 还未设置');
|
||||||
}
|
}
|
||||||
const emailConfig = JSON.parse(emailConfigEntity.setting) as EmailConfig;
|
|
||||||
if (emailConfig.usePlus && isPlus()) {
|
if (emailConf.usePlus && isPlus()) {
|
||||||
return await this.sendByPlus(email);
|
return await this.sendByPlus(email);
|
||||||
}
|
}
|
||||||
await this.sendByCustom(emailConfig, email);
|
await this.sendByCustom(emailConf, email);
|
||||||
logger.info('sendEmail complete: ', email);
|
logger.info('sendEmail complete: ', email);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { ALL, Body, Controller, Inject, Post, Provide, Query } from '@midwayjs/core';
|
import { ALL, Body, Controller, Inject, Post, Provide, Query } from '@midwayjs/core';
|
||||||
import { CrudController } from '@certd/lib-server';
|
import { CrudController, SysPublicSettings, SysSettingsService } from '@certd/lib-server';
|
||||||
import { SysSettingsService } from '@certd/lib-server';
|
|
||||||
import { SysSettingsEntity } from '../entity/sys-settings.js';
|
import { SysSettingsEntity } from '../entity/sys-settings.js';
|
||||||
import { SysPublicSettings } from '@certd/lib-server';
|
|
||||||
import * as _ from 'lodash-es';
|
import * as _ from 'lodash-es';
|
||||||
import { PipelineService } from '../../../pipeline/service/pipeline-service.js';
|
import { PipelineService } from '../../../pipeline/service/pipeline-service.js';
|
||||||
|
import { UserSettingsService } from '../../../mine/service/user-settings-service.js';
|
||||||
|
import { getEmailSettings } from '../fix.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
@@ -14,6 +14,8 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
|
|||||||
@Inject()
|
@Inject()
|
||||||
service: SysSettingsService;
|
service: SysSettingsService;
|
||||||
@Inject()
|
@Inject()
|
||||||
|
userSettingsService: UserSettingsService;
|
||||||
|
@Inject()
|
||||||
pipelineService: PipelineService;
|
pipelineService: PipelineService;
|
||||||
|
|
||||||
getService() {
|
getService() {
|
||||||
@@ -68,6 +70,13 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
|
|||||||
return this.ok(entity);
|
return this.ok(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// savePublicSettings
|
||||||
|
@Post('/getEmailSettings', { summary: 'sys:settings:edit' })
|
||||||
|
async getEmailSettings(@Body(ALL) body) {
|
||||||
|
const conf = await getEmailSettings(this.service, this.userSettingsService);
|
||||||
|
return this.ok(conf);
|
||||||
|
}
|
||||||
|
|
||||||
// savePublicSettings
|
// savePublicSettings
|
||||||
@Post('/savePublicSettings', { summary: 'sys:settings:edit' })
|
@Post('/savePublicSettings', { summary: 'sys:settings:edit' })
|
||||||
async savePublicSettings(@Body(ALL) body) {
|
async savePublicSettings(@Body(ALL) body) {
|
||||||
|
|||||||
17
packages/ui/certd-server/src/modules/sys/settings/fix.ts
Normal file
17
packages/ui/certd-server/src/modules/sys/settings/fix.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import { SysEmailConf, SysSettingsService } from '@certd/lib-server';
|
||||||
|
import * as _ from 'lodash-es';
|
||||||
|
import { UserSettingsService } from '../../mine/service/user-settings-service.js';
|
||||||
|
|
||||||
|
export async function getEmailSettings(sysSettingService: SysSettingsService, userSettingsService: UserSettingsService): Promise<SysEmailConf> {
|
||||||
|
let conf = await sysSettingService.getSetting<SysEmailConf>(SysEmailConf);
|
||||||
|
if (!conf.host || conf.usePlus == null) {
|
||||||
|
//到userSetting里面去找
|
||||||
|
const adminEmailSetting = await userSettingsService.getByKey('email', 1);
|
||||||
|
if (adminEmailSetting) {
|
||||||
|
const setting = JSON.parse(adminEmailSetting.setting);
|
||||||
|
conf = _.merge(conf, setting);
|
||||||
|
await sysSettingService.saveSetting(conf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return conf;
|
||||||
|
}
|
||||||
54
step.md
54
step.md
@@ -13,19 +13,19 @@
|
|||||||
## 自动化流水线创建
|
## 自动化流水线创建
|
||||||
|
|
||||||
### 1. 创建证书申请部署流水线
|
### 1. 创建证书申请部署流水线
|
||||||

|

|
||||||
|
|
||||||
需要添加域名的DNS解析服务商的授权
|
需要添加域名的DNS解析服务商的授权
|
||||||

|

|
||||||
|
|
||||||
填写accessKey和accessSecret
|
填写accessKey和accessSecret
|
||||||

|

|
||||||
流水线创建成功
|
流水线创建成功
|
||||||

|

|
||||||
|
|
||||||
### 2. 任务详情界面
|
### 2. 任务详情界面
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
到这一步申请证书就已经配置完成了。
|
到这一步申请证书就已经配置完成了。
|
||||||
点击手动触发,就可以申请证书了。
|
点击手动触发,就可以申请证书了。
|
||||||
@@ -34,72 +34,72 @@
|
|||||||
|
|
||||||
### 3. 添加部署到阿里云CDN任务
|
### 3. 添加部署到阿里云CDN任务
|
||||||
点击添加任务
|
点击添加任务
|
||||||

|

|
||||||
|
|
||||||
选择任务类型
|
选择任务类型
|
||||||

|

|
||||||
|
|
||||||
填写任务参数
|
填写任务参数
|
||||||

|

|
||||||
|
|
||||||
点击确定,部署到CDN任务配置成功
|
点击确定,部署到CDN任务配置成功
|
||||||
|
|
||||||
### 4. 添加部署到服务器主机任务
|
### 4. 添加部署到服务器主机任务
|
||||||
点击新任务,弹出添加任务界面
|
点击新任务,弹出添加任务界面
|
||||||

|

|
||||||
先选择上传到主机任务
|
先选择上传到主机任务
|
||||||
|
|
||||||
填写任务参数,比如证书保存路径
|
填写任务参数,比如证书保存路径
|
||||||

|

|
||||||
|
|
||||||
需要添加主机ip、用户名、密码,只需添加一次,后续其他任务可以复用
|
需要添加主机ip、用户名、密码,只需添加一次,后续其他任务可以复用
|
||||||

|

|
||||||
|
|
||||||
然后添加第二个任务,执行主机命令,部署证书
|
然后添加第二个任务,执行主机命令,部署证书
|
||||||

|

|
||||||
|
|
||||||
选择执行脚本命令任务
|
选择执行脚本命令任务
|
||||||

|

|
||||||
|
|
||||||
编写脚本,选择之前添加的主机
|
编写脚本,选择之前添加的主机
|
||||||

|

|
||||||
|
|
||||||
点击确定,部署到主机任务配置成功
|
点击确定,部署到主机任务配置成功
|
||||||

|

|
||||||
|
|
||||||
### 5. 手动触发执行任务,测试一下
|
### 5. 手动触发执行任务,测试一下
|
||||||

|

|
||||||
|
|
||||||
点击任务可以查看状态和日志
|
点击任务可以查看状态和日志
|
||||||

|

|
||||||
|
|
||||||
这里执行失败,可以查看错误日志
|
这里执行失败,可以查看错误日志
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
修改正确后,重新执行
|
修改正确后,重新执行
|
||||||

|

|
||||||
可以看到前面执行过的就会跳过,不会重复执行
|
可以看到前面执行过的就会跳过,不会重复执行
|
||||||

|

|
||||||
|
|
||||||
### 6. 查看证书部署效果
|
### 6. 查看证书部署效果
|
||||||
可以看到证书已经部署到CDN成功
|
可以看到证书已经部署到CDN成功
|
||||||

|

|
||||||

|

|
||||||
也可以手动下载证书
|
也可以手动下载证书
|
||||||

|

|
||||||
|
|
||||||
### 7. 定时触发
|
### 7. 定时触发
|
||||||
配置定时触发,以后每天定时执行
|
配置定时触发,以后每天定时执行
|
||||||
cron格式,例如: `0 0 3 * * *` 表示每天凌晨3点执行
|
cron格式,例如: `0 0 3 * * *` 表示每天凌晨3点执行
|
||||||
到期前20天会自动申请新证书并部署,没到期前不会重复申请
|
到期前20天会自动申请新证书并部署,没到期前不会重复申请
|
||||||

|

|
||||||
|
|
||||||
### 8. 邮件通知
|
### 8. 邮件通知
|
||||||
可以接收邮件通知(支持时机:开始、成功、失败、失败转成功)
|
可以接收邮件通知(支持时机:开始、成功、失败、失败转成功)
|
||||||

|

|
||||||
需要配置邮件服务器
|
需要配置邮件服务器
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user