mirror of
https://github.com/certd/certd.git
synced 2026-04-03 14:10:54 +08:00
Merge branch 'v2-dev' into v2_admin_mode
This commit is contained in:
12
CHANGELOG.md
12
CHANGELOG.md
@@ -3,6 +3,18 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复新网找错域名的bug ([bd511f9](https://github.com/certd/certd/commit/bd511f97cb7fbdcaeff7ac899f0460a5c7b41826))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 当域名管理中没有域名时,创建流水线时不展开域名选择框 ([9166a57](https://github.com/certd/certd/commit/9166a579301a60750f0b72b6a42b0c8d730695fd))
|
||||
* count tip ([e19743f](https://github.com/certd/certd/commit/e19743f70553700f1f91bff76f87370f749dd247))
|
||||
* oauth支持github 和google, 修复头像显示问题 ([693a4a6](https://github.com/certd/certd/commit/693a4a663385ced3176286bf4b5f3566da83d90e))
|
||||
|
||||
## [1.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -3,6 +3,18 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复新网找错域名的bug ([bd511f9](https://github.com/certd/certd/commit/bd511f97cb7fbdcaeff7ac899f0460a5c7b41826))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 当域名管理中没有域名时,创建流水线时不展开域名选择框 ([9166a57](https://github.com/certd/certd/commit/9166a579301a60750f0b72b6a42b0c8d730695fd))
|
||||
* count tip ([e19743f](https://github.com/certd/certd/commit/e19743f70553700f1f91bff76f87370f749dd247))
|
||||
* oauth支持github 和google, 修复头像显示问题 ([693a4a6](https://github.com/certd/certd/commit/693a4a663385ced3176286bf4b5f3566da83d90e))
|
||||
|
||||
## [1.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
| 序号 | 名称 | 说明 |
|
||||
|-----|-----|-----|
|
||||
| 1.| **证书申请(JS版)** | 免费通配符域名证书申请,支持多个域名打到同一个证书上 |
|
||||
| 2.| **商用证书托管** | 手动上传自定义证书后,自动部署(每次证书有更新,都需要手动上传一次) |
|
||||
| 2.| **已有证书托管** | 手动上传自定义证书后,自动部署(每次证书有更新,都需要手动上传一次) |
|
||||
| 3.| **获取阿里云订阅证书** | 从阿里云拉取订阅模式的商用证书 |
|
||||
| 4.| **证书申请(Lego)** | 支持海量DNS解析提供商,推荐使用,一样的免费通配符域名证书申请,支持多个域名打到同一个证书上 |
|
||||
## 2. 主机
|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
}
|
||||
},
|
||||
"npmClient": "pnpm",
|
||||
"version": "1.38.5"
|
||||
"version": "1.38.6"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.6](https://github.com/publishlab/node-acme-client/compare/v1.38.5...v1.38.6) (2026-02-04)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
## [1.38.5](https://github.com/publishlab/node-acme-client/compare/v1.38.4...v1.38.5) (2026-02-02)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"description": "Simple and unopinionated ACME client",
|
||||
"private": false,
|
||||
"author": "nmorsman",
|
||||
"version": "1.38.5",
|
||||
"version": "1.38.6",
|
||||
"type": "module",
|
||||
"module": "scr/index.js",
|
||||
"main": "src/index.js",
|
||||
@@ -18,7 +18,7 @@
|
||||
"types"
|
||||
],
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.38.5",
|
||||
"@certd/basic": "^1.38.6",
|
||||
"@peculiar/x509": "^1.11.0",
|
||||
"asn1js": "^3.0.5",
|
||||
"axios": "^1.9.0",
|
||||
@@ -70,5 +70,5 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||
},
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca"
|
||||
}
|
||||
|
||||
@@ -600,7 +600,7 @@ class AcmeClient {
|
||||
throw new Error(`[${d}] Unexpected item status: ${resp.data.status}`);
|
||||
};
|
||||
|
||||
this.log(`[${d}] Waiting for valid status (等待valid状态): ${item.url}`, this.backoffOpts);
|
||||
this.log(`[${d}] Waiting for valid status (等待valid状态): ${item.url}`, JSON.stringify(this.backoffOpts));
|
||||
return util.retry(verifyFn, this.backoffOpts);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
## [1.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
@@ -1 +1 @@
|
||||
23:59
|
||||
01:13
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/basic",
|
||||
"private": false,
|
||||
"version": "1.38.5",
|
||||
"version": "1.38.6",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -47,5 +47,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
## [1.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/pipeline",
|
||||
"private": false,
|
||||
"version": "1.38.5",
|
||||
"version": "1.38.6",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -18,8 +18,8 @@
|
||||
"compile": "tsc --skipLibCheck --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.38.5",
|
||||
"@certd/plus-core": "^1.38.5",
|
||||
"@certd/basic": "^1.38.6",
|
||||
"@certd/plus-core": "^1.38.6",
|
||||
"dayjs": "^1.11.7",
|
||||
"lodash-es": "^4.17.21",
|
||||
"reflect-metadata": "^0.1.13"
|
||||
@@ -45,5 +45,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-huawei",
|
||||
"private": false,
|
||||
"version": "1.38.5",
|
||||
"version": "1.38.6",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
"types": "./dist/d/index.d.ts",
|
||||
@@ -24,5 +24,5 @@
|
||||
"prettier": "^2.8.8",
|
||||
"tslib": "^2.8.1"
|
||||
},
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-iframe",
|
||||
"private": false,
|
||||
"version": "1.38.5",
|
||||
"version": "1.38.6",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -31,5 +31,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
## [1.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/jdcloud",
|
||||
"version": "1.38.5",
|
||||
"version": "1.38.6",
|
||||
"description": "jdcloud openApi sdk",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
@@ -56,5 +56,5 @@
|
||||
"fetch"
|
||||
]
|
||||
},
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-k8s",
|
||||
"private": false,
|
||||
"version": "1.38.5",
|
||||
"version": "1.38.6",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -17,7 +17,7 @@
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.38.5",
|
||||
"@certd/basic": "^1.38.6",
|
||||
"@kubernetes/client-node": "0.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -32,5 +32,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-server
|
||||
|
||||
## [1.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/lib-server",
|
||||
"version": "1.38.5",
|
||||
"version": "1.38.6",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -28,11 +28,11 @@
|
||||
],
|
||||
"license": "AGPL",
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.38.5",
|
||||
"@certd/basic": "^1.38.5",
|
||||
"@certd/pipeline": "^1.38.5",
|
||||
"@certd/plugin-lib": "^1.38.5",
|
||||
"@certd/plus-core": "^1.38.5",
|
||||
"@certd/acme-client": "^1.38.6",
|
||||
"@certd/basic": "^1.38.6",
|
||||
"@certd/pipeline": "^1.38.6",
|
||||
"@certd/plugin-lib": "^1.38.6",
|
||||
"@certd/plus-core": "^1.38.6",
|
||||
"@midwayjs/cache": "3.14.0",
|
||||
"@midwayjs/core": "3.20.11",
|
||||
"@midwayjs/i18n": "3.20.13",
|
||||
@@ -64,5 +64,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/midway-flyway-js",
|
||||
"version": "1.38.5",
|
||||
"version": "1.38.6",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -46,5 +46,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
## [1.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-cert",
|
||||
"private": false,
|
||||
"version": "1.38.5",
|
||||
"version": "1.38.6",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -17,10 +17,10 @@
|
||||
"compile": "tsc --skipLibCheck --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.38.5",
|
||||
"@certd/basic": "^1.38.5",
|
||||
"@certd/pipeline": "^1.38.5",
|
||||
"@certd/plugin-lib": "^1.38.5",
|
||||
"@certd/acme-client": "^1.38.6",
|
||||
"@certd/basic": "^1.38.6",
|
||||
"@certd/pipeline": "^1.38.6",
|
||||
"@certd/plugin-lib": "^1.38.6",
|
||||
"psl": "^1.9.0",
|
||||
"punycode.js": "^2.3.1"
|
||||
},
|
||||
@@ -38,5 +38,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca"
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
export * from "@certd/plugin-lib";
|
||||
export * from "@certd/plugin-lib";
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-lib
|
||||
|
||||
## [1.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-lib
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-lib",
|
||||
"private": false,
|
||||
"version": "1.38.5",
|
||||
"version": "1.38.6",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -22,10 +22,10 @@
|
||||
"@alicloud/pop-core": "^1.7.10",
|
||||
"@alicloud/tea-util": "^1.4.11",
|
||||
"@aws-sdk/client-s3": "^3.964.0",
|
||||
"@certd/acme-client": "^1.38.5",
|
||||
"@certd/basic": "^1.38.5",
|
||||
"@certd/pipeline": "^1.38.5",
|
||||
"@certd/plus-core": "^1.38.5",
|
||||
"@certd/acme-client": "^1.38.6",
|
||||
"@certd/basic": "^1.38.6",
|
||||
"@certd/pipeline": "^1.38.6",
|
||||
"@certd/plus-core": "^1.38.6",
|
||||
"@kubernetes/client-node": "0.21.0",
|
||||
"ali-oss": "^6.22.0",
|
||||
"basic-ftp": "^5.0.5",
|
||||
@@ -57,5 +57,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "eeb1f27fa47ddc616451f3e5a8fb8d1de345d252"
|
||||
"gitHead": "1368259a1e780486204e9d814c88a741a373dcca"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 当域名管理中没有域名时,创建流水线时不展开域名选择框 ([9166a57](https://github.com/certd/certd/commit/9166a579301a60750f0b72b6a42b0c8d730695fd))
|
||||
* count tip ([e19743f](https://github.com/certd/certd/commit/e19743f70553700f1f91bff76f87370f749dd247))
|
||||
* oauth支持github 和google, 修复头像显示问题 ([693a4a6](https://github.com/certd/certd/commit/693a4a663385ced3176286bf4b5f3566da83d90e))
|
||||
|
||||
## [1.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-client",
|
||||
"version": "1.38.5",
|
||||
"version": "1.38.6",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --open",
|
||||
@@ -106,8 +106,8 @@
|
||||
"zod-defaults": "^0.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@certd/lib-iframe": "^1.38.5",
|
||||
"@certd/pipeline": "^1.38.5",
|
||||
"@certd/lib-iframe": "^1.38.6",
|
||||
"@certd/pipeline": "^1.38.6",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@types/chai": "^4.3.12",
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<div class="flex flex-row">
|
||||
<a-select
|
||||
class="domain-select-input"
|
||||
:popup-class-name="popupClassName"
|
||||
:dropdown-style="dropdownStyle"
|
||||
show-search
|
||||
:filter-option="filterOption"
|
||||
@@ -56,7 +57,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { computed, defineComponent, ref, Ref, useAttrs } from "vue";
|
||||
import { computed, defineComponent, onMounted, ref, Ref, useAttrs } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { Dicts } from "../lib/dicts";
|
||||
import { request } from "/@/api/service";
|
||||
@@ -94,11 +95,11 @@ const attrs = useAttrs();
|
||||
|
||||
const hasOptions: Ref = ref(null);
|
||||
|
||||
const openProp = computed(() => {
|
||||
if (hasOptions.value == null) {
|
||||
return false;
|
||||
const popupClassName = computed(() => {
|
||||
if (!hasOptions.value) {
|
||||
return "hidden-important";
|
||||
}
|
||||
return hasOptions.value;
|
||||
return "";
|
||||
});
|
||||
|
||||
const searchKeyRef = ref("");
|
||||
@@ -155,6 +156,7 @@ const getOptions = async () => {
|
||||
|
||||
optionsRef.value = options;
|
||||
if (hasOptions.value == null) {
|
||||
//初始设置一次
|
||||
if (options.length > 0) {
|
||||
hasOptions.value = true;
|
||||
} else {
|
||||
@@ -223,6 +225,10 @@ function openDomainImportDialog() {
|
||||
const dropdownStyle = ref({
|
||||
zIndex: 2000,
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
refreshOptions();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less"></style>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="params-show">
|
||||
<a-tag type="primary" color="green" v-for="item of params" :key="item.value" class="item">
|
||||
<a-tag v-for="item of params" :key="item.value" type="primary" color="green" class="item">
|
||||
<span class="label">{{ item.label }}=</span>
|
||||
<fs-copyable :modelValue="`\$\{${item.value}\}`" :button="{show:false}" :inline="true"></fs-copyable>
|
||||
<fs-copyable :model-value="`\$\{${item.value}\}`" :button="{ show: false }" :inline="true"></fs-copyable>
|
||||
</a-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -8,9 +8,20 @@
|
||||
<div class="flex flex-col order-count-text weight-bold">
|
||||
<div class="count-text ml-4 flex items-center">
|
||||
<fs-icon icon="noto:fire" class="fs-20 mr-2"></fs-icon>
|
||||
<span> 今日赞助 </span>
|
||||
<span class="count-number color-red font-bold text-2xl ml-1 mr-1"> {{ stage.orderCount }} </span>人,
|
||||
<span> {{ stage.title }} </span>
|
||||
<template v-if="stage.vipTotal > 0">
|
||||
<span> 已有 </span>
|
||||
<span class="count-number color-red font-bold text-2xl ml-1 mr-1"> {{ stage.vipTotal }} </span> 位小伙伴赞助,
|
||||
<span>
|
||||
{{ stage.title }}
|
||||
</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span> 今日赞助 </span>
|
||||
<span class="count-number color-red font-bold text-2xl ml-1 mr-1"> {{ stage.orderCount }} </span> 人,
|
||||
<span>
|
||||
{{ stage.title }}
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -109,14 +120,13 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, nextTick, onMounted, reactive, Ref, ref } from "vue";
|
||||
import { message, Modal } from "ant-design-vue";
|
||||
import dayjs from "dayjs";
|
||||
import { computed, nextTick, onMounted, onUnmounted, reactive, Ref, ref } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import * as api from "./api";
|
||||
import { utils } from "/@/utils";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
@@ -230,12 +240,13 @@ const vipTypeDefine: any = {
|
||||
},
|
||||
};
|
||||
|
||||
const TodayVipOrderCountRef: Ref = ref({});
|
||||
const TodayVipOrderCountRef: Ref = ref({ enabled: false, current: 0, stages: [] });
|
||||
|
||||
async function getTodayVipOrderCount() {
|
||||
const res = await api.getTodayVipOrderCount();
|
||||
if (res) {
|
||||
TodayVipOrderCountRef.value = res;
|
||||
TodayVipOrderCountRef.value.current = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,31 +259,50 @@ const todayOrderCount = computed(() => {
|
||||
}
|
||||
const lastStage = countInfo?.stages?.[countInfo?.stages?.length - 1] || {};
|
||||
lastStage.orderCount = orderCount;
|
||||
|
||||
const stages: any = [];
|
||||
stages.push({
|
||||
title: countInfo.title,
|
||||
vipTotal: countInfo?.vipTotal || 0,
|
||||
orderCount: orderCount,
|
||||
bg: lastStage.bg,
|
||||
});
|
||||
if (lastStage.orderCount > 0) {
|
||||
stages.push(lastStage);
|
||||
}
|
||||
return {
|
||||
enabled: enabled,
|
||||
orderCount: orderCount,
|
||||
title: lastStage.title || "",
|
||||
stages: countInfo?.stages,
|
||||
stages: stages,
|
||||
};
|
||||
});
|
||||
|
||||
async function scrollOrderCount() {
|
||||
const stages = todayOrderCount.value.stages;
|
||||
if (!stages.length) {
|
||||
if (stages.length === 0) {
|
||||
return;
|
||||
}
|
||||
let index = 0;
|
||||
for (const stage of stages) {
|
||||
const doScroll = () => {
|
||||
TodayVipOrderCountRef.value.current = index;
|
||||
await utils.sleep(500);
|
||||
index++;
|
||||
}
|
||||
if (index >= stages.length) {
|
||||
index = 0;
|
||||
}
|
||||
};
|
||||
doScroll();
|
||||
scrollOrderCountIntervalRef.value = setInterval(doScroll, 7000);
|
||||
}
|
||||
|
||||
const scrollOrderCountIntervalRef: Ref = ref(null);
|
||||
onMounted(async () => {
|
||||
await getTodayVipOrderCount();
|
||||
await nextTick();
|
||||
await scrollOrderCount();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(scrollOrderCountIntervalRef.value);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
||||
@@ -35,7 +35,13 @@ const menus = computed(() => [
|
||||
|
||||
const avatar = computed(() => {
|
||||
const avt = userStore.getUserInfo?.avatar;
|
||||
return avt ? `/api/basic/file/download?key=${avt}` : "";
|
||||
if (!avt) {
|
||||
return "";
|
||||
}
|
||||
if (avt.startsWith("http")) {
|
||||
return avt;
|
||||
}
|
||||
return `/api/basic/file/download?key=${avt}`;
|
||||
});
|
||||
|
||||
async function handleLogout() {
|
||||
|
||||
@@ -476,4 +476,10 @@ h6 {
|
||||
.fs-icon{
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.hidden-important {
|
||||
display: none !important;
|
||||
visibility: hidden !important;
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
<a-descriptions-item :label="t('authentication.username')">{{ userInfo.username }}</a-descriptions-item>
|
||||
<a-descriptions-item :label="t('authentication.nickName')">{{ userInfo.nickName }}</a-descriptions-item>
|
||||
<a-descriptions-item :label="t('authentication.avatar')">
|
||||
<a-avatar v-if="userInfo.avatar" size="large" :src="'api/basic/file/download?&key=' + userInfo.avatar" style="background-color: #eee"> </a-avatar>
|
||||
<a-avatar v-if="userInfo.avatar" size="large" :src="userAvatar" style="background-color: #eee"> </a-avatar>
|
||||
<a-avatar v-else size="large" style="background-color: #00b4f5">
|
||||
{{ userInfo.username }}
|
||||
</a-avatar>
|
||||
@@ -108,6 +108,17 @@ async function bind(type: string) {
|
||||
window.location.href = loginUrl;
|
||||
}
|
||||
|
||||
const userAvatar = computed(() => {
|
||||
if (isEmpty(userInfo.value.avatar)) {
|
||||
return "";
|
||||
}
|
||||
if (userInfo.value.avatar.startsWith("http")) {
|
||||
return userInfo.value.avatar;
|
||||
}
|
||||
|
||||
return "api/basic/file/download?&key=" + userInfo.value.avatar;
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await getUserInfo();
|
||||
await loadOauthBounds();
|
||||
|
||||
@@ -3,6 +3,16 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.6](https://github.com/certd/certd/compare/v1.38.5...v1.38.6) (2026-02-04)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复新网找错域名的bug ([bd511f9](https://github.com/certd/certd/commit/bd511f97cb7fbdcaeff7ac899f0460a5c7b41826))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* oauth支持github 和google, 修复头像显示问题 ([693a4a6](https://github.com/certd/certd/commit/693a4a663385ced3176286bf4b5f3566da83d90e))
|
||||
|
||||
## [1.38.5](https://github.com/certd/certd/compare/v1.38.4...v1.38.5) (2026-02-02)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -22,7 +22,9 @@ input:
|
||||
component:
|
||||
name: api-test
|
||||
action: TestRequest
|
||||
helper: 点击测试接口是否正常
|
||||
helper: |-
|
||||
测试前请务必先在新网后台关闭异地登录保护、关闭动态口令验证
|
||||
如果提示需要短信验证码,请等几个小时后再试
|
||||
pluginType: access
|
||||
type: builtIn
|
||||
scriptFilePath: /plugins/plugin-xinnet/access.js
|
||||
|
||||
19
packages/ui/certd-server/metadata/addon_oauth_github.yaml
Normal file
19
packages/ui/certd-server/metadata/addon_oauth_github.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
addonType: oauth
|
||||
name: github
|
||||
title: GitHub认证
|
||||
desc: GitHub OAuth2登录
|
||||
icon: simple-icons:github
|
||||
showTest: false
|
||||
input:
|
||||
clientId:
|
||||
title: ClientId
|
||||
helper: '[GitHub Developer Settings](https://github.com/settings/developers)创建应用后获取'
|
||||
required: true
|
||||
clientSecretKey:
|
||||
title: ClientSecretKey
|
||||
component:
|
||||
placeholder: ClientSecretKey / appSecretKey
|
||||
required: true
|
||||
pluginType: addon
|
||||
type: builtIn
|
||||
scriptFilePath: /plugins/plugin-oauth/oauth2/plugin-github.js
|
||||
21
packages/ui/certd-server/metadata/addon_oauth_google.yaml
Normal file
21
packages/ui/certd-server/metadata/addon_oauth_google.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
addonType: oauth
|
||||
name: google
|
||||
title: Google认证
|
||||
desc: Google OAuth2登录
|
||||
icon: simple-icons:google
|
||||
showTest: false
|
||||
input:
|
||||
clientId:
|
||||
title: ClientId
|
||||
helper: >-
|
||||
[Google Cloud
|
||||
Console](https://console.cloud.google.com/apis/credentials)创建应用后获取
|
||||
required: true
|
||||
clientSecretKey:
|
||||
title: ClientSecretKey
|
||||
component:
|
||||
placeholder: ClientSecretKey / appSecretKey
|
||||
required: true
|
||||
pluginType: addon
|
||||
type: builtIn
|
||||
scriptFilePath: /plugins/plugin-oauth/oauth2/plugin-google.js
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-server",
|
||||
"version": "1.38.5",
|
||||
"version": "1.38.6",
|
||||
"description": "fast-server base midway",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
@@ -48,20 +48,20 @@
|
||||
"@aws-sdk/client-iam": "^3.964.0",
|
||||
"@aws-sdk/client-route-53": "^3.964.0",
|
||||
"@aws-sdk/client-s3": "^3.964.0",
|
||||
"@certd/acme-client": "^1.38.5",
|
||||
"@certd/basic": "^1.38.5",
|
||||
"@certd/commercial-core": "^1.38.5",
|
||||
"@certd/acme-client": "^1.38.6",
|
||||
"@certd/basic": "^1.38.6",
|
||||
"@certd/commercial-core": "^1.38.6",
|
||||
"@certd/cv4pve-api-javascript": "^8.4.2",
|
||||
"@certd/jdcloud": "^1.38.5",
|
||||
"@certd/lib-huawei": "^1.38.5",
|
||||
"@certd/lib-k8s": "^1.38.5",
|
||||
"@certd/lib-server": "^1.38.5",
|
||||
"@certd/midway-flyway-js": "^1.38.5",
|
||||
"@certd/pipeline": "^1.38.5",
|
||||
"@certd/plugin-cert": "^1.38.5",
|
||||
"@certd/plugin-lib": "^1.38.5",
|
||||
"@certd/plugin-plus": "^1.38.5",
|
||||
"@certd/plus-core": "^1.38.5",
|
||||
"@certd/jdcloud": "^1.38.6",
|
||||
"@certd/lib-huawei": "^1.38.6",
|
||||
"@certd/lib-k8s": "^1.38.6",
|
||||
"@certd/lib-server": "^1.38.6",
|
||||
"@certd/midway-flyway-js": "^1.38.6",
|
||||
"@certd/pipeline": "^1.38.6",
|
||||
"@certd/plugin-cert": "^1.38.6",
|
||||
"@certd/plugin-lib": "^1.38.6",
|
||||
"@certd/plugin-plus": "^1.38.6",
|
||||
"@certd/plus-core": "^1.38.6",
|
||||
"@google-cloud/publicca": "^1.3.0",
|
||||
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.185",
|
||||
"@huaweicloud/huaweicloud-sdk-core": "^3.1.185",
|
||||
|
||||
@@ -84,5 +84,9 @@ export function startProxyServer(opts:{port:number}) {
|
||||
logger.info(`[proxy] 正向代理服务器运行在 http://0.0.0.0:${port}`);
|
||||
});
|
||||
|
||||
proxyServer.close(() => {
|
||||
logger.info('[proxy] 正向代理服务器已关闭');
|
||||
});
|
||||
|
||||
return proxyServer
|
||||
}
|
||||
@@ -113,6 +113,9 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
|
||||
async add(bean: PipelineEntity) {
|
||||
bean.status = ResultType.none;
|
||||
if (bean.order == null) {
|
||||
bean.order = 0;
|
||||
}
|
||||
await this.save(bean);
|
||||
return bean;
|
||||
}
|
||||
@@ -243,6 +246,9 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
if (!bean.status) {
|
||||
bean.status = ResultType.none;
|
||||
}
|
||||
if (bean.order == null) {
|
||||
bean.order = 0;
|
||||
}
|
||||
if (!isUpdate) {
|
||||
//如果是添加,先保存一下,获取到id,更新pipeline.id
|
||||
await this.addOrUpdate(bean);
|
||||
|
||||
@@ -147,7 +147,7 @@ export class AcmeService {
|
||||
externalAccountBinding: this.eab,
|
||||
backoffAttempts: this.options.maxCheckRetryCount || 20,
|
||||
backoffMin: 5000,
|
||||
backoffMax: 10000,
|
||||
backoffMax: 1000*1000,
|
||||
urlMapping,
|
||||
signal: this.options.signal,
|
||||
logger: this.logger,
|
||||
|
||||
@@ -264,7 +264,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
||||
name: "access-selector",
|
||||
type: "eab",
|
||||
},
|
||||
maybeNeed: true,
|
||||
maybeNeed: false,
|
||||
required: false,
|
||||
helper:
|
||||
"需要提供EAB授权" +
|
||||
@@ -291,7 +291,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
||||
name: "access-selector",
|
||||
type: "google",
|
||||
},
|
||||
maybeNeed: true,
|
||||
maybeNeed: false,
|
||||
required: false,
|
||||
helper: "google服务账号授权与EAB授权选填其中一个,[服务账号授权获取方法](https://certd.docmirror.cn/guide/use/google/)\n服务账号授权需要配置代理或者服务器本身在海外",
|
||||
mergeScript: `
|
||||
|
||||
@@ -2,4 +2,7 @@ export * from './api.js'
|
||||
export * from './oidc/plugin-oidc.js'
|
||||
export * from './wx/plugin-wx.js'
|
||||
export * from './oauth2/plugin-gitee.js'
|
||||
export * from './oauth2/plugin-clogin.js'
|
||||
export * from './oauth2/plugin-clogin.js'
|
||||
export * from './oauth2/plugin-github.js'
|
||||
export * from './oauth2/plugin-google.js'
|
||||
export * from './oauth2/plugin-microsoft.js'
|
||||
@@ -0,0 +1,103 @@
|
||||
import { AddonInput, BaseAddon, IsAddon } from "@certd/lib-server";
|
||||
import { BuildLoginUrlReq, BuildLogoutUrlReq, IOauthProvider, OnCallbackReq } from "../api.js";
|
||||
|
||||
@IsAddon({
|
||||
addonType: "oauth",
|
||||
name: 'github',
|
||||
title: 'GitHub认证',
|
||||
desc: 'GitHub OAuth2登录',
|
||||
icon:"simple-icons:github",
|
||||
showTest: false,
|
||||
})
|
||||
export class GithubOauthProvider extends BaseAddon implements IOauthProvider {
|
||||
|
||||
@AddonInput({
|
||||
title: "ClientId",
|
||||
helper: "[GitHub Developer Settings](https://github.com/settings/developers)创建应用后获取",
|
||||
required: true,
|
||||
})
|
||||
clientId = "";
|
||||
|
||||
@AddonInput({
|
||||
title: "ClientSecretKey",
|
||||
component: {
|
||||
placeholder: "ClientSecretKey / appSecretKey",
|
||||
},
|
||||
required: true,
|
||||
})
|
||||
clientSecretKey = "";
|
||||
|
||||
async buildLoginUrl(params: BuildLoginUrlReq) {
|
||||
|
||||
let scope = "user:email" // Scope of the access request
|
||||
let state:any = {
|
||||
forType: params.forType || 'login',
|
||||
}
|
||||
state = this.ctx.utils.hash.base64(JSON.stringify(state))
|
||||
|
||||
const authorizeEndpoint = "https://github.com/login/oauth/authorize"
|
||||
const redirectUrl = encodeURIComponent(params.redirectUri)
|
||||
const loginUrl = `${authorizeEndpoint}?client_id=${this.clientId}&redirect_uri=${redirectUrl}&response_type=code&scope=${scope}&state=${state}`
|
||||
return {
|
||||
loginUrl,
|
||||
ticketValue: {
|
||||
state,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
async onCallback(req: OnCallbackReq) {
|
||||
|
||||
const code = req.code || ""
|
||||
|
||||
const tokenEndpoint = "https://github.com/login/oauth/access_token"
|
||||
|
||||
const uri = new URL(req.currentURL)
|
||||
const redirectUri = `${uri.origin}${uri.pathname}`
|
||||
const res = await this.ctx.utils.http.request( {
|
||||
url: tokenEndpoint,
|
||||
method: "post",
|
||||
headers: {
|
||||
"Accept": "application/json"
|
||||
},
|
||||
data:{
|
||||
client_id: this.clientId,
|
||||
client_secret: this.clientSecretKey,
|
||||
code,
|
||||
redirect_uri: redirectUri
|
||||
}
|
||||
})
|
||||
|
||||
const tokens = res
|
||||
|
||||
const userInfoEndpoint = "https://api.github.com/user"
|
||||
|
||||
// 获取用户信息
|
||||
const userInfoRes = await this.ctx.utils.http.request( {
|
||||
url: userInfoEndpoint,
|
||||
method: "get",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${tokens.access_token}`,
|
||||
"Accept": "application/json"
|
||||
}
|
||||
})
|
||||
const userInfo = userInfoRes
|
||||
|
||||
return {
|
||||
token:{
|
||||
accessToken: tokens.access_token,
|
||||
refreshToken: tokens.refresh_token,
|
||||
expiresIn: tokens.expires_in,
|
||||
},
|
||||
userInfo: {
|
||||
openId: userInfo.id,
|
||||
nickName: userInfo.login || userInfo.name || "",
|
||||
avatar: userInfo.avatar_url,
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
async buildLogoutUrl(params: BuildLogoutUrlReq) {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
import { AddonInput, BaseAddon, IsAddon } from "@certd/lib-server";
|
||||
import { BuildLoginUrlReq, BuildLogoutUrlReq, IOauthProvider, OnCallbackReq } from "../api.js";
|
||||
|
||||
@IsAddon({
|
||||
addonType: "oauth",
|
||||
name: 'google',
|
||||
title: 'Google认证',
|
||||
desc: 'Google OAuth2登录',
|
||||
icon:"simple-icons:google",
|
||||
showTest: false,
|
||||
})
|
||||
export class GoogleOauthProvider extends BaseAddon implements IOauthProvider {
|
||||
|
||||
@AddonInput({
|
||||
title: "ClientId",
|
||||
helper: "[Google Cloud Console](https://console.cloud.google.com/apis/credentials)创建应用后获取",
|
||||
required: true,
|
||||
})
|
||||
clientId = "";
|
||||
|
||||
@AddonInput({
|
||||
title: "ClientSecretKey",
|
||||
component: {
|
||||
placeholder: "ClientSecretKey / appSecretKey",
|
||||
},
|
||||
required: true,
|
||||
})
|
||||
clientSecretKey = "";
|
||||
|
||||
async buildLoginUrl(params: BuildLoginUrlReq) {
|
||||
|
||||
let scope = "email profile" // Scope of the access request
|
||||
let state:any = {
|
||||
forType: params.forType || 'login',
|
||||
}
|
||||
state = this.ctx.utils.hash.base64(JSON.stringify(state))
|
||||
|
||||
const authorizeEndpoint = "https://accounts.google.com/o/oauth2/auth"
|
||||
const redirectUrl = encodeURIComponent(params.redirectUri)
|
||||
const loginUrl = `${authorizeEndpoint}?client_id=${this.clientId}&redirect_uri=${redirectUrl}&response_type=code&scope=${scope}&state=${state}`
|
||||
return {
|
||||
loginUrl,
|
||||
ticketValue: {
|
||||
state,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
async onCallback(req: OnCallbackReq) {
|
||||
|
||||
const code = req.code || ""
|
||||
|
||||
const tokenEndpoint = "https://oauth2.googleapis.com/token"
|
||||
|
||||
const uri = new URL(req.currentURL)
|
||||
const redirectUri = `${uri.origin}${uri.pathname}`
|
||||
const res = await this.ctx.utils.http.request( {
|
||||
url: tokenEndpoint,
|
||||
method: "post",
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
},
|
||||
data:{
|
||||
client_id: this.clientId,
|
||||
client_secret: this.clientSecretKey,
|
||||
code,
|
||||
redirect_uri: redirectUri,
|
||||
grant_type: "authorization_code"
|
||||
}
|
||||
})
|
||||
|
||||
const tokens = res
|
||||
|
||||
const userInfoEndpoint = "https://www.googleapis.com/oauth2/v3/userinfo"
|
||||
|
||||
// 获取用户信息
|
||||
const userInfoRes = await this.ctx.utils.http.request( {
|
||||
url: userInfoEndpoint,
|
||||
method: "get",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${tokens.access_token}`
|
||||
}
|
||||
})
|
||||
const userInfo = userInfoRes
|
||||
|
||||
return {
|
||||
token:{
|
||||
accessToken: tokens.access_token,
|
||||
refreshToken: tokens.refresh_token,
|
||||
expiresIn: tokens.expires_in,
|
||||
},
|
||||
userInfo: {
|
||||
openId: userInfo.sub,
|
||||
nickName: userInfo.name || userInfo.email || "",
|
||||
avatar: userInfo.picture,
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
async buildLogoutUrl(params: BuildLogoutUrlReq) {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
import { AddonInput, BaseAddon, IsAddon } from "@certd/lib-server";
|
||||
import { BuildLoginUrlReq, BuildLogoutUrlReq, IOauthProvider, OnCallbackReq } from "../api.js";
|
||||
|
||||
@IsAddon({
|
||||
addonType: "oauth",
|
||||
name: 'microsoft',
|
||||
title: 'Microsoft认证',
|
||||
desc: 'Microsoft OAuth2登录',
|
||||
icon:"simple-icons:microsoft",
|
||||
showTest: false,
|
||||
})
|
||||
export class MicrosoftOauthProvider extends BaseAddon implements IOauthProvider {
|
||||
|
||||
@AddonInput({
|
||||
title: "ClientId",
|
||||
helper: "[Azure Portal](https://portal.azure.com/)创建应用后获取",
|
||||
required: true,
|
||||
})
|
||||
clientId = "";
|
||||
|
||||
@AddonInput({
|
||||
title: "ClientSecretKey",
|
||||
component: {
|
||||
placeholder: "ClientSecretKey / appSecretKey",
|
||||
},
|
||||
required: true,
|
||||
})
|
||||
clientSecretKey = "";
|
||||
|
||||
@AddonInput({
|
||||
title: "TenantId",
|
||||
helper: "租户ID,留空使用/common端点(需要应用配置为多租户)",
|
||||
component: {
|
||||
placeholder: "common 或 租户ID",
|
||||
},
|
||||
value: "common",
|
||||
required: false,
|
||||
})
|
||||
tenantId = "common";
|
||||
|
||||
async buildLoginUrl(params: BuildLoginUrlReq) {
|
||||
|
||||
let scope = "openid profile email User.Read" // Scope of the access request
|
||||
let state:any = {
|
||||
forType: params.forType || 'login',
|
||||
}
|
||||
state = this.ctx.utils.hash.base64(JSON.stringify(state))
|
||||
|
||||
const authorizeEndpoint = `https://login.microsoftonline.com/${this.tenantId}/oauth2/v2.0/authorize`
|
||||
const redirectUrl = encodeURIComponent(params.redirectUri)
|
||||
const loginUrl = `${authorizeEndpoint}?client_id=${this.clientId}&redirect_uri=${redirectUrl}&response_type=code&scope=${scope}&state=${state}`
|
||||
return {
|
||||
loginUrl,
|
||||
ticketValue: {
|
||||
state,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
async onCallback(req: OnCallbackReq) {
|
||||
|
||||
const code = req.code || ""
|
||||
if (!code) {
|
||||
throw new Error("Missing code parameter");
|
||||
}
|
||||
|
||||
const tokenEndpoint = `https://login.microsoftonline.com/${this.tenantId}/oauth2/v2.0/token`
|
||||
|
||||
const uri = new URL(req.currentURL)
|
||||
const redirectUri = `${uri.origin}${uri.pathname}`
|
||||
|
||||
// 构建 form-urlencoded 格式的数据
|
||||
const formData = new URLSearchParams();
|
||||
formData.append('client_id', this.clientId);
|
||||
formData.append('client_secret', this.clientSecretKey);
|
||||
formData.append('code', code);
|
||||
formData.append('redirect_uri', redirectUri);
|
||||
formData.append('grant_type', 'authorization_code');
|
||||
|
||||
const res = await this.ctx.utils.http.request( {
|
||||
url: tokenEndpoint,
|
||||
method: "post",
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"Accept": "application/json"
|
||||
},
|
||||
data: formData.toString()
|
||||
})
|
||||
|
||||
const tokens = res
|
||||
|
||||
const userInfoEndpoint = "https://graph.microsoft.com/v1.0/me"
|
||||
|
||||
// 获取用户信息
|
||||
const userInfoRes = await this.ctx.utils.http.request( {
|
||||
url: userInfoEndpoint,
|
||||
method: "get",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${tokens.access_token}`,
|
||||
"Accept": "application/json"
|
||||
}
|
||||
})
|
||||
const userInfo = userInfoRes
|
||||
|
||||
return {
|
||||
token:{
|
||||
accessToken: tokens.access_token,
|
||||
refreshToken: tokens.refresh_token,
|
||||
expiresIn: tokens.expires_in,
|
||||
},
|
||||
userInfo: {
|
||||
openId: userInfo.id,
|
||||
nickName: userInfo.displayName || userInfo.userPrincipalName || "",
|
||||
avatar: userInfo.avatar || "",
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
async buildLogoutUrl(params: BuildLogoutUrlReq) {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
00:04
|
||||
01:18
|
||||
|
||||
@@ -1 +1 @@
|
||||
11
|
||||
16
|
||||
|
||||
@@ -1 +1 @@
|
||||
00:18
|
||||
01:33
|
||||
|
||||
Reference in New Issue
Block a user