mirror of
https://github.com/certd/certd.git
synced 2026-04-26 05:37:25 +08:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7a1c6d2918 | |||
| 9fcc0dc8e7 | |||
| 286f244caf | |||
| 52ebeab90b | |||
| 6be7591332 | |||
| 73325aaefb | |||
| 0adcc6a8d1 | |||
| 93fb6acd1d |
@@ -3,6 +3,17 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.37.12](https://github.com/certd/certd/compare/v1.37.11...v1.37.12) (2025-11-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复waf tls版本号小写 ([0adcc6a](https://github.com/certd/certd/commit/0adcc6a8d194469be0c26940ed4837fb34929b68))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持微信扫码登录 ([73325aa](https://github.com/certd/certd/commit/73325aaefb0e750a22aaac40929e7bf3f5864996))
|
||||
* 支持证书颁发机构 LiteSSL ([6be7591](https://github.com/certd/certd/commit/6be75913324e2828d9016eb307ff2d0abbbb2191))
|
||||
|
||||
## [1.37.11](https://github.com/certd/certd/compare/v1.37.10...v1.37.11) (2025-11-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
+1
-1
@@ -9,5 +9,5 @@
|
||||
}
|
||||
},
|
||||
"npmClient": "pnpm",
|
||||
"version": "1.37.11"
|
||||
"version": "1.37.12"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.37.12](https://github.com/publishlab/node-acme-client/compare/v1.37.11...v1.37.12) (2025-11-29)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持证书颁发机构 LiteSSL ([6be7591](https://github.com/publishlab/node-acme-client/commit/6be75913324e2828d9016eb307ff2d0abbbb2191))
|
||||
|
||||
## [1.37.11](https://github.com/publishlab/node-acme-client/compare/v1.37.10...v1.37.11) (2025-11-28)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"description": "Simple and unopinionated ACME client",
|
||||
"private": false,
|
||||
"author": "nmorsman",
|
||||
"version": "1.37.11",
|
||||
"version": "1.37.12",
|
||||
"type": "module",
|
||||
"module": "scr/index.js",
|
||||
"main": "src/index.js",
|
||||
@@ -18,7 +18,7 @@
|
||||
"types"
|
||||
],
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.37.11",
|
||||
"@certd/basic": "^1.37.12",
|
||||
"@peculiar/x509": "^1.11.0",
|
||||
"asn1js": "^3.0.5",
|
||||
"axios": "^1.7.2",
|
||||
|
||||
@@ -32,7 +32,11 @@ export const directory = {
|
||||
staging: 'https://acme.ssl.com/sslcom-dv-rsa',
|
||||
production: 'https://acme.ssl.com/sslcom-dv-rsa',
|
||||
ec: 'https://acme.ssl.com/sslcom-dv-ecc',
|
||||
}
|
||||
},
|
||||
litessl: {
|
||||
staging: 'https://acme.litessl.com/acme/v2/directory',
|
||||
production: 'https://acme.litessl.com/acme/v2/directory',
|
||||
},
|
||||
};
|
||||
|
||||
export function getDirectoryUrl(opts) {
|
||||
|
||||
@@ -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.37.12](https://github.com/certd/certd/compare/v1.37.11...v1.37.12) (2025-11-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
## [1.37.11](https://github.com/certd/certd/compare/v1.37.10...v1.37.11) (2025-11-28)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -1 +1 @@
|
||||
04:13
|
||||
02:28
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/basic",
|
||||
"private": false,
|
||||
"version": "1.37.11",
|
||||
"version": "1.37.12",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -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.37.12](https://github.com/certd/certd/compare/v1.37.11...v1.37.12) (2025-11-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
## [1.37.11](https://github.com/certd/certd/compare/v1.37.10...v1.37.11) (2025-11-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/pipeline",
|
||||
"private": false,
|
||||
"version": "1.37.11",
|
||||
"version": "1.37.12",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -18,8 +18,8 @@
|
||||
"compile": "tsc --skipLibCheck --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.37.11",
|
||||
"@certd/plus-core": "^1.37.11",
|
||||
"@certd/basic": "^1.37.12",
|
||||
"@certd/plus-core": "^1.37.12",
|
||||
"dayjs": "^1.11.7",
|
||||
"lodash-es": "^4.17.21",
|
||||
"reflect-metadata": "^0.1.13"
|
||||
|
||||
@@ -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.37.12](https://github.com/certd/certd/compare/v1.37.11...v1.37.12) (2025-11-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.37.11](https://github.com/certd/certd/compare/v1.37.10...v1.37.11) (2025-11-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-huawei",
|
||||
"private": false,
|
||||
"version": "1.37.11",
|
||||
"version": "1.37.12",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
"types": "./dist/d/index.d.ts",
|
||||
|
||||
@@ -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.37.12](https://github.com/certd/certd/compare/v1.37.11...v1.37.12) (2025-11-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.37.11](https://github.com/certd/certd/compare/v1.37.10...v1.37.11) (2025-11-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-iframe",
|
||||
"private": false,
|
||||
"version": "1.37.11",
|
||||
"version": "1.37.12",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -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.37.12](https://github.com/certd/certd/compare/v1.37.11...v1.37.12) (2025-11-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
## [1.37.11](https://github.com/certd/certd/compare/v1.37.10...v1.37.11) (2025-11-28)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/jdcloud",
|
||||
"version": "1.37.11",
|
||||
"version": "1.37.12",
|
||||
"description": "jdcloud openApi sdk",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
|
||||
@@ -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.37.12](https://github.com/certd/certd/compare/v1.37.11...v1.37.12) (2025-11-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.37.11](https://github.com/certd/certd/compare/v1.37.10...v1.37.11) (2025-11-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-k8s",
|
||||
"private": false,
|
||||
"version": "1.37.11",
|
||||
"version": "1.37.12",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -17,7 +17,7 @@
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.37.11",
|
||||
"@certd/basic": "^1.37.12",
|
||||
"@kubernetes/client-node": "0.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -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.37.12](https://github.com/certd/certd/compare/v1.37.11...v1.37.12) (2025-11-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-server
|
||||
|
||||
## [1.37.11](https://github.com/certd/certd/compare/v1.37.10...v1.37.11) (2025-11-28)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/lib-server",
|
||||
"version": "1.37.11",
|
||||
"version": "1.37.12",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -28,11 +28,11 @@
|
||||
],
|
||||
"license": "AGPL",
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.37.11",
|
||||
"@certd/basic": "^1.37.11",
|
||||
"@certd/pipeline": "^1.37.11",
|
||||
"@certd/plugin-lib": "^1.37.11",
|
||||
"@certd/plus-core": "^1.37.11",
|
||||
"@certd/acme-client": "^1.37.12",
|
||||
"@certd/basic": "^1.37.12",
|
||||
"@certd/pipeline": "^1.37.12",
|
||||
"@certd/plugin-lib": "^1.37.12",
|
||||
"@certd/plus-core": "^1.37.12",
|
||||
"@midwayjs/cache": "3.14.0",
|
||||
"@midwayjs/core": "3.20.11",
|
||||
"@midwayjs/i18n": "3.20.13",
|
||||
|
||||
@@ -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.37.12](https://github.com/certd/certd/compare/v1.37.11...v1.37.12) (2025-11-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.37.11](https://github.com/certd/certd/compare/v1.37.10...v1.37.11) (2025-11-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/midway-flyway-js",
|
||||
"version": "1.37.11",
|
||||
"version": "1.37.12",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.37.12](https://github.com/certd/certd/compare/v1.37.11...v1.37.12) (2025-11-29)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持证书颁发机构 LiteSSL ([6be7591](https://github.com/certd/certd/commit/6be75913324e2828d9016eb307ff2d0abbbb2191))
|
||||
|
||||
## [1.37.11](https://github.com/certd/certd/compare/v1.37.10...v1.37.11) (2025-11-28)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-cert",
|
||||
"private": false,
|
||||
"version": "1.37.11",
|
||||
"version": "1.37.12",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -17,10 +17,10 @@
|
||||
"compile": "tsc --skipLibCheck --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.37.11",
|
||||
"@certd/basic": "^1.37.11",
|
||||
"@certd/pipeline": "^1.37.11",
|
||||
"@certd/plugin-lib": "^1.37.11",
|
||||
"@certd/acme-client": "^1.37.12",
|
||||
"@certd/basic": "^1.37.12",
|
||||
"@certd/pipeline": "^1.37.12",
|
||||
"@certd/plugin-lib": "^1.37.12",
|
||||
"@google-cloud/publicca": "^1.3.0",
|
||||
"dayjs": "^1.11.7",
|
||||
"jszip": "^3.10.1",
|
||||
|
||||
@@ -136,6 +136,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
||||
{ value: "letsencrypt", label: "Let's Encrypt(免费,新手推荐)", icon: "simple-icons:letsencrypt" },
|
||||
{ value: "google", label: "Google(免费)", icon: "flat-color-icons:google" },
|
||||
{ value: "zerossl", label: "ZeroSSL(免费)", icon: "emojione:digit-zero" },
|
||||
{ value: "litessl", label: "litessl(免费)", icon: "roentgen:free" },
|
||||
{ value: "sslcom", label: "SSL.com(仅主域名和www免费)", icon: "la:expeditedssl" },
|
||||
{ value: "letsencrypt_staging", label: "Let's Encrypt测试环境(IP证书)", icon: "simple-icons:letsencrypt" },
|
||||
],
|
||||
@@ -250,6 +251,13 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
||||
})
|
||||
sslcomCommonEabAccessId!: number;
|
||||
|
||||
@TaskInput({
|
||||
title: "litessl公共EAB授权",
|
||||
isSys: true,
|
||||
show: false,
|
||||
})
|
||||
litesslCommonEabAccessId!: number;
|
||||
|
||||
@TaskInput({
|
||||
title: "EAB授权",
|
||||
component: {
|
||||
@@ -262,13 +270,15 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
||||
"需要提供EAB授权" +
|
||||
"\nZeroSSL:请前往[zerossl开发者中心](https://app.zerossl.com/developer),生成 'EAB Credentials'" +
|
||||
"\nGoogle:请查看[google获取eab帮助文档](https://certd.docmirror.cn/guide/use/google/),用过一次后会绑定邮箱,后续复用EAB要用同一个邮箱" +
|
||||
"\nSSL.com:[SSL.com账号页面](https://secure.ssl.com/account),然后点击api credentials链接,然后点击编辑按钮,查看Secret key和HMAC key",
|
||||
"\nSSL.com:[SSL.com账号页面](https://secure.ssl.com/account),然后点击api credentials链接,然后点击编辑按钮,查看Secret key和HMAC key" +
|
||||
"\nlitessl:[litesslEAB页面](https://freessl.cn/automation/eab-manager),然后点击新增EAB",
|
||||
mergeScript: `
|
||||
return {
|
||||
show: ctx.compute(({form})=>{
|
||||
return (form.sslProvider === 'zerossl' && !form.zerosslCommonEabAccessId)
|
||||
|| (form.sslProvider === 'google' && !form.googleCommonEabAccessId)
|
||||
|| (form.sslProvider === 'sslcom' && !form.sslcomCommonEabAccessId)
|
||||
|| (form.sslProvider === 'litessl' && !form.litesslCommonEabAccessId)
|
||||
})
|
||||
}
|
||||
`,
|
||||
|
||||
@@ -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.37.12](https://github.com/certd/certd/compare/v1.37.11...v1.37.12) (2025-11-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-lib
|
||||
|
||||
## [1.37.11](https://github.com/certd/certd/compare/v1.37.10...v1.37.11) (2025-11-28)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-lib",
|
||||
"private": false,
|
||||
"version": "1.37.11",
|
||||
"version": "1.37.12",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -22,8 +22,8 @@
|
||||
"@alicloud/pop-core": "^1.7.10",
|
||||
"@alicloud/tea-util": "^1.4.10",
|
||||
"@aws-sdk/client-s3": "^3.787.0",
|
||||
"@certd/basic": "^1.37.11",
|
||||
"@certd/pipeline": "^1.37.11",
|
||||
"@certd/basic": "^1.37.12",
|
||||
"@certd/pipeline": "^1.37.12",
|
||||
"@kubernetes/client-node": "0.21.0",
|
||||
"ali-oss": "^6.22.0",
|
||||
"basic-ftp": "^5.0.5",
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.37.12](https://github.com/certd/certd/compare/v1.37.11...v1.37.12) (2025-11-29)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持微信扫码登录 ([73325aa](https://github.com/certd/certd/commit/73325aaefb0e750a22aaac40929e7bf3f5864996))
|
||||
* 支持证书颁发机构 LiteSSL ([6be7591](https://github.com/certd/certd/commit/6be75913324e2828d9016eb307ff2d0abbbb2191))
|
||||
|
||||
## [1.37.11](https://github.com/certd/certd/compare/v1.37.10...v1.37.11) (2025-11-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-client",
|
||||
"version": "1.37.11",
|
||||
"version": "1.37.12",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --open",
|
||||
@@ -106,8 +106,8 @@
|
||||
"zod-defaults": "^0.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@certd/lib-iframe": "^1.37.11",
|
||||
"@certd/pipeline": "^1.37.11",
|
||||
"@certd/lib-iframe": "^1.37.12",
|
||||
"@certd/pipeline": "^1.37.12",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@types/chai": "^4.3.12",
|
||||
|
||||
@@ -766,7 +766,10 @@ export default {
|
||||
oauthProviders: "OAuth2 Login Providers",
|
||||
oauthType: "OAuth2 Login Type",
|
||||
oauthConfig: "OAuth2 Login Config",
|
||||
oauthProviderSelectorPlaceholder: "Please select OAuth2 login provider",
|
||||
oauthProviderSelectorPlaceholder: "Not Configured",
|
||||
oauthCallback: "Callback URL",
|
||||
oauthCallbackHelper: "Copy this URL to the callback address of the OAuth2 login provider",
|
||||
oauthCallbackCopy: "Copy Callback URL",
|
||||
},
|
||||
},
|
||||
modal: {
|
||||
|
||||
@@ -767,7 +767,10 @@ export default {
|
||||
oauthProviders: "第三方登录提供商",
|
||||
oauthType: "第三方登录类型",
|
||||
oauthConfig: "第三方登录配置",
|
||||
oauthProviderSelectorPlaceholder: "请选择第三方登录提供商",
|
||||
oauthProviderSelectorPlaceholder: "未配置",
|
||||
oauthCallback: "回调地址",
|
||||
oauthCallbackHelper: "复制回调地址,配置到对应提供商的回调地址中",
|
||||
oauthCallbackCopy: "复制回调地址",
|
||||
},
|
||||
},
|
||||
modal: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="addon-selector">
|
||||
<div class="flex-o w-100">
|
||||
<div class="flex-o w-100 inner">
|
||||
<!-- <fs-dict-select class="flex-1" :value="modelValue" :dict="optionsDictRef" :disabled="disabled" :render-label="renderLabel" :slots="selectSlots" :allow-clear="true" v-bind="select" @update:value="onChange" />-->
|
||||
<span v-if="modelValue" class="mr-5 cd-flex-inline">
|
||||
<a-tag class="mr-5" color="green">{{ target?.name || modelValue }}</a-tag>
|
||||
@@ -175,5 +175,9 @@ async function doRefresh() {
|
||||
<style lang="less">
|
||||
.addon-selector {
|
||||
width: 100%;
|
||||
.inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -121,7 +121,14 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any, a
|
||||
},
|
||||
editForm: {
|
||||
component: {
|
||||
disabled: false,
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
addForm: {
|
||||
component: {
|
||||
disabled: compute(({ form }) => {
|
||||
return form.type ? true : false;
|
||||
}),
|
||||
},
|
||||
},
|
||||
form: {
|
||||
|
||||
@@ -40,6 +40,12 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
editRequest,
|
||||
delRequest,
|
||||
},
|
||||
search: {
|
||||
initialForm: {
|
||||
addonType: addonType,
|
||||
type: type,
|
||||
},
|
||||
},
|
||||
form: {
|
||||
labelCol: {
|
||||
//固定label宽度
|
||||
|
||||
@@ -15,8 +15,9 @@ import GroupSelector from "/@/views/certd/pipeline/group/group-selector.vue";
|
||||
import { useCertViewer } from "/@/views/certd/pipeline/use";
|
||||
import { useI18n } from "/src/locales";
|
||||
import { GetDetail, GetObj } from "./api";
|
||||
import { groupDictRef } from "./group/dicts";
|
||||
|
||||
export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
export default function ({ crudExpose, context: { selectedRowKeys } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const router = useRouter();
|
||||
const lastResRef = ref();
|
||||
|
||||
@@ -495,6 +496,11 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
|
||||
component: {
|
||||
name: GroupSelector,
|
||||
vModel: "modelValue",
|
||||
on: {
|
||||
refresh: async () => {
|
||||
await groupDictRef.reloadDict();
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
column: {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { dict } from "@fast-crud/fast-crud";
|
||||
|
||||
export const groupDictRef = dict({
|
||||
url: "/pi/pipeline/group/all",
|
||||
value: "id",
|
||||
label: "name",
|
||||
});
|
||||
@@ -35,6 +35,7 @@
|
||||
<script setup lang="ts">
|
||||
import createCrudOptions from "./crud";
|
||||
import { dict, FsDictSelect } from "@fast-crud/fast-crud";
|
||||
import { groupDictRef } from "./dicts";
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue?: number;
|
||||
@@ -43,11 +44,7 @@ const props = defineProps<{
|
||||
defineOptions({
|
||||
name: "GroupSelector",
|
||||
});
|
||||
const groupDictRef = dict({
|
||||
url: "/pi/pipeline/group/all",
|
||||
value: "id",
|
||||
label: "name",
|
||||
});
|
||||
|
||||
const emit = defineEmits(["refresh", "update:modelValue"]);
|
||||
function doRefresh() {
|
||||
emit("refresh");
|
||||
|
||||
@@ -35,19 +35,14 @@ import { useI18n } from "/src/locales";
|
||||
const { t } = useI18n();
|
||||
import ChangeNotification from "/@/views/certd/pipeline/components/change-notification.vue";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { groupDictRef } from "./group/dicts";
|
||||
|
||||
defineOptions({
|
||||
name: "PipelineManager",
|
||||
});
|
||||
|
||||
const groupDictRef = dict({
|
||||
url: "/pi/pipeline/group/all",
|
||||
value: "id",
|
||||
label: "name",
|
||||
});
|
||||
const selectedRowKeys = ref([]);
|
||||
const context: any = {
|
||||
groupDictRef,
|
||||
selectedRowKeys,
|
||||
};
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });
|
||||
|
||||
@@ -2,13 +2,14 @@ import { request } from "/src/api/service";
|
||||
|
||||
const apiPrefix = "/oauth";
|
||||
|
||||
export async function OauthLogin(type: string, forType?: string) {
|
||||
export async function OauthLogin(type: string, forType?: string, from?: string) {
|
||||
return await request({
|
||||
url: apiPrefix + `/login`,
|
||||
method: "post",
|
||||
data: {
|
||||
type,
|
||||
forType: forType || "login",
|
||||
from: from || "web",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
<div class="oauth-title">
|
||||
<div class="oauth-title-text">其他方式登录</div>
|
||||
</div>
|
||||
<div v-for="item in oauthList" :key="item.type">
|
||||
<div class="oauth-icon-button pointer" @click="goOauthLogin(item.name)">
|
||||
<div><fs-icon :icon="item.icon" class="text-blue-600 text-40" /></div>
|
||||
<div>{{ item.title }}</div>
|
||||
</div>
|
||||
<div class="flex justify-center items-center gap-4">
|
||||
<template v-for="item in oauthProviderList" :key="item.type">
|
||||
<div v-if="item.addonId" class="oauth-icon-button pointer" @click="goOauthLogin(item.name)">
|
||||
<div><fs-icon :icon="item.icon" class="text-blue-600 text-40" /></div>
|
||||
<div>{{ item.addonTitle || item.title }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -15,15 +17,16 @@
|
||||
import { onMounted, ref } from "vue";
|
||||
import * as api from "./api";
|
||||
|
||||
const oauthList = ref([]);
|
||||
const oauthProviderList = ref([]);
|
||||
|
||||
onMounted(async () => {
|
||||
oauthList.value = await api.GetOauthProviders();
|
||||
oauthProviderList.value = await api.GetOauthProviders();
|
||||
});
|
||||
|
||||
async function goOauthLogin(type: string) {
|
||||
//获取第三方登录URL
|
||||
const res = await api.OauthLogin(type);
|
||||
const from = "web";
|
||||
const res = await api.OauthLogin(type, from);
|
||||
const loginUrl = res.loginUrl;
|
||||
window.location.href = loginUrl;
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ export type PluginConfigBean = {
|
||||
export type CertApplyPluginSysInput = {
|
||||
googleCommonEabAccessId?: number;
|
||||
zerosslCommonEabAccessId?: number;
|
||||
litesslCommonEabAccessId?: number;
|
||||
};
|
||||
export type PluginSysSetting<T> = {
|
||||
sysSetting: {
|
||||
|
||||
@@ -26,6 +26,16 @@
|
||||
</div>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="公共litessl EAB授权" :name="['CertApply', 'sysSetting', 'input', 'litesslCommonEabAccessId']">
|
||||
<access-selector v-model:model-value="formState.CertApply.sysSetting.input.litesslCommonEabAccessId" type="eab" from="sys"></access-selector>
|
||||
<div class="helper">
|
||||
<div>设置公共litessl EAB授权给用户使用,避免用户自己获取litessl EAB授权</div>
|
||||
<div>
|
||||
<a href="https://freessl.cn/automation/eab-manager">litessl EAB授权管理 </a>
|
||||
</div>
|
||||
</div>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item :wrapper-col="{ offset: 8, span: 16 }">
|
||||
<a-button :loading="saveLoading" type="primary" html-type="submit">保存</a-button>
|
||||
</a-form-item>
|
||||
|
||||
@@ -114,7 +114,7 @@ export async function GetSmsTypeDefine(type: string) {
|
||||
|
||||
export async function GetOauthProviders() {
|
||||
return await request({
|
||||
url: apiPrefix + "/oauth/providers",
|
||||
url: "/oauth/providers",
|
||||
method: "post",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -67,8 +67,9 @@
|
||||
<table class="w-full table-auto border-collapse border border-gray-400">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="border border-gray-300 px-4 py-2 w-1/2">{{ t("certd.sys.setting.oauthType") }}</th>
|
||||
<th class="border border-gray-300 px-4 py-2 w-1/2">{{ t("certd.sys.setting.oauthConfig") }}</th>
|
||||
<th class="border border-gray-300 px-4 py-2 w-1/3">{{ t("certd.sys.setting.oauthType") }}</th>
|
||||
<th class="border border-gray-300 px-4 py-2 w-1/3">{{ t("certd.sys.setting.oauthCallback") }}</th>
|
||||
<th class="border border-gray-300 px-4 py-2 w-1/3">{{ t("certd.sys.setting.oauthConfig") }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -79,6 +80,11 @@
|
||||
{{ item.title }}
|
||||
</div>
|
||||
</td>
|
||||
<td class="border border-gray-300 px-4 py-2 overflow-ellipsis" :title="t('certd.sys.setting.oauthCallbackHelper')">
|
||||
<fs-copyable :model-value="buildCallbackUrl(item.name)">
|
||||
{{ t("certd.sys.setting.oauthCallbackCopy") }}
|
||||
</fs-copyable>
|
||||
</td>
|
||||
<td class="border border-gray-300 px-4 py-2">
|
||||
<AddonSelector v-model:model-value="item.addonId" addon-type="oauth" from="sys" :type="item.name" :placeholder="t('certd.sys.setting.oauthProviderSelectorPlaceholder')" />
|
||||
</td>
|
||||
@@ -96,14 +102,14 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="tsx">
|
||||
import { computed, reactive, ref, Ref } from "vue";
|
||||
import { GetSmsTypeDefine, SysSettings } from "/@/views/sys/settings/api";
|
||||
import * as api from "/@/views/sys/settings/api";
|
||||
import { merge } from "lodash-es";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { useI18n } from "/src/locales";
|
||||
import { merge } from "lodash-es";
|
||||
import { reactive, ref, Ref } from "vue";
|
||||
import AddonSelector from "../../../certd/addon/addon-selector/index.vue";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import * as api from "/@/views/sys/settings/api";
|
||||
import { SysSettings } from "/@/views/sys/settings/api";
|
||||
import { useI18n } from "/src/locales";
|
||||
const { t } = useI18n();
|
||||
|
||||
defineOptions({
|
||||
@@ -192,15 +198,7 @@ async function loadTypeDefine(type: string) {
|
||||
|
||||
const oauthProviders = ref([]);
|
||||
async function loadOauthProviders() {
|
||||
let list: any = await api.GetOauthProviders();
|
||||
oauthProviders.value = list;
|
||||
for (const item of list) {
|
||||
const type = item.name;
|
||||
const provider = formState.public.oauthProviders?.[type];
|
||||
if (provider) {
|
||||
item.addonId = provider.addonId;
|
||||
}
|
||||
}
|
||||
oauthProviders.value = await api.GetOauthProviders();
|
||||
}
|
||||
|
||||
function fillOauthProviders(form: any) {
|
||||
@@ -251,8 +249,19 @@ const onFinish = async (form: any) => {
|
||||
saveLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
function buildCallbackUrl(type: string) {
|
||||
return `${window.location.origin}/api/oauth/callback/${type}`;
|
||||
}
|
||||
</script>
|
||||
<style lang="less">
|
||||
.sys-settings-site {
|
||||
.sys-settings-register {
|
||||
width: 1000px !important;
|
||||
|
||||
.addon-selector {
|
||||
.inner {
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -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.37.12](https://github.com/certd/certd/compare/v1.37.11...v1.37.12) (2025-11-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复waf tls版本号小写 ([0adcc6a](https://github.com/certd/certd/commit/0adcc6a8d194469be0c26940ed4837fb34929b68))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持微信扫码登录 ([73325aa](https://github.com/certd/certd/commit/73325aaefb0e750a22aaac40929e7bf3f5864996))
|
||||
|
||||
## [1.37.11](https://github.com/certd/certd/compare/v1.37.10...v1.37.11) (2025-11-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-server",
|
||||
"version": "1.37.11",
|
||||
"version": "1.37.12",
|
||||
"description": "fast-server base midway",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
@@ -45,20 +45,20 @@
|
||||
"@aws-sdk/client-cloudfront": "^3.699.0",
|
||||
"@aws-sdk/client-iam": "^3.699.0",
|
||||
"@aws-sdk/client-s3": "^3.705.0",
|
||||
"@certd/acme-client": "^1.37.11",
|
||||
"@certd/basic": "^1.37.11",
|
||||
"@certd/commercial-core": "^1.37.11",
|
||||
"@certd/acme-client": "^1.37.12",
|
||||
"@certd/basic": "^1.37.12",
|
||||
"@certd/commercial-core": "^1.37.12",
|
||||
"@certd/cv4pve-api-javascript": "^8.4.2",
|
||||
"@certd/jdcloud": "^1.37.11",
|
||||
"@certd/lib-huawei": "^1.37.11",
|
||||
"@certd/lib-k8s": "^1.37.11",
|
||||
"@certd/lib-server": "^1.37.11",
|
||||
"@certd/midway-flyway-js": "^1.37.11",
|
||||
"@certd/pipeline": "^1.37.11",
|
||||
"@certd/plugin-cert": "^1.37.11",
|
||||
"@certd/plugin-lib": "^1.37.11",
|
||||
"@certd/plugin-plus": "^1.37.11",
|
||||
"@certd/plus-core": "^1.37.11",
|
||||
"@certd/jdcloud": "^1.37.12",
|
||||
"@certd/lib-huawei": "^1.37.12",
|
||||
"@certd/lib-k8s": "^1.37.12",
|
||||
"@certd/lib-server": "^1.37.12",
|
||||
"@certd/midway-flyway-js": "^1.37.12",
|
||||
"@certd/pipeline": "^1.37.12",
|
||||
"@certd/plugin-cert": "^1.37.12",
|
||||
"@certd/plugin-lib": "^1.37.12",
|
||||
"@certd/plugin-plus": "^1.37.12",
|
||||
"@certd/plus-core": "^1.37.12",
|
||||
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
|
||||
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120",
|
||||
"@koa/cors": "^5.0.0",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { addonRegistry, BaseController, Constants, SysInstallInfo, SysSettingsService } from "@certd/lib-server";
|
||||
import { addonRegistry, AddonService, BaseController, Constants, SysInstallInfo, SysSettingsService } from "@certd/lib-server";
|
||||
import { ALL, Body, Controller, Get, Inject, Param, Post, Provide, Query } from "@midwayjs/core";
|
||||
import { AddonGetterService } from "../../../modules/pipeline/service/addon-getter-service.js";
|
||||
import { IOauthProvider } from "../../../plugins/plugin-oauth/api.js";
|
||||
@@ -31,6 +31,9 @@ export class ConnectController extends BaseController {
|
||||
@Inject()
|
||||
oauthBoundService: OauthBoundService;
|
||||
|
||||
@Inject()
|
||||
addonService: AddonService;
|
||||
|
||||
|
||||
|
||||
private async getOauthProvider(type: string) {
|
||||
@@ -51,14 +54,14 @@ export class ConnectController extends BaseController {
|
||||
}
|
||||
|
||||
@Post('/login', { summary: Constants.per.guest })
|
||||
public async login(@Body(ALL) body: { type: string, forType?:string }) {
|
||||
public async login(@Body(ALL) body: { type: string, forType?:string ,from?:string }) {
|
||||
|
||||
const addon = await this.getOauthProvider(body.type);
|
||||
const installInfo = await this.sysSettingsService.getSetting<SysInstallInfo>(SysInstallInfo);
|
||||
const bindUrl = installInfo?.bindUrl || "";
|
||||
//构造登录url
|
||||
const redirectUrl = `${bindUrl}api/oauth/callback/${body.type}`;
|
||||
const { loginUrl, ticketValue } = await addon.buildLoginUrl({ redirectUri: redirectUrl, forType: body.forType });
|
||||
const { loginUrl, ticketValue } = await addon.buildLoginUrl({ redirectUri: redirectUrl, forType: body.forType ,from: body.from || "web" });
|
||||
const ticket = this.codeService.setValidationValue(ticketValue)
|
||||
this.ctx.cookies.set("oauth_ticket", ticket, {
|
||||
httpOnly: true,
|
||||
@@ -217,10 +220,32 @@ export class ConnectController extends BaseController {
|
||||
return this.ok(bounds);
|
||||
}
|
||||
|
||||
@Post('/providers', { summary: Constants.per.guest })
|
||||
|
||||
@Post('/providers', { summary: Constants.per.guest })
|
||||
public async providers() {
|
||||
const list = addonRegistry.getDefineList("oauth");
|
||||
const defineList = addonRegistry.getDefineList("oauth");
|
||||
|
||||
const publicSetting = await this.sysSettingsService.getPublicSettings();
|
||||
const oauthProviders = publicSetting.oauthProviders || {};
|
||||
const list = [];
|
||||
|
||||
for (const item of defineList) {
|
||||
const type = item.name
|
||||
const conf = oauthProviders[type];
|
||||
const provider:any = {
|
||||
...item,
|
||||
}
|
||||
delete provider.input
|
||||
if (conf && conf.addonId) {
|
||||
const addonEntity = await this.addonService.info(conf.addonId);
|
||||
if (addonEntity) {
|
||||
provider.addonId = conf.addonId;
|
||||
provider.addonTitle = addonEntity.name;
|
||||
}
|
||||
}
|
||||
list.push(provider);
|
||||
}
|
||||
|
||||
return this.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -93,13 +93,13 @@ export class AliyunDeployCertToWaf extends AbstractTaskPlugin {
|
||||
|
||||
@TaskInput({
|
||||
title: 'TLS版本',
|
||||
value: 'TLSv1.2',
|
||||
value: 'tlsv1.2',
|
||||
component: {
|
||||
name: 'a-select',
|
||||
options: [
|
||||
{ value: 'TLSv1', label: 'TLSv1' },
|
||||
{ value: 'TLSv1.1', label: 'TLSv1.1' },
|
||||
{ value: 'TLSv1.2', label: 'TLSv1.2' },
|
||||
{ value: 'tlsv1', label: 'TLSv1' },
|
||||
{ value: 'tlsv1.1', label: 'TLSv1.1' },
|
||||
{ value: 'tlsv1.2', label: 'TLSv1.2' },
|
||||
],
|
||||
},
|
||||
required: true,
|
||||
@@ -192,7 +192,7 @@ export class AliyunDeployCertToWaf extends AbstractTaskPlugin {
|
||||
Redirect: JSON.stringify(redirect),
|
||||
Listen: JSON.stringify(listen),
|
||||
Domain: siteDomain,
|
||||
TLSVersion: this.tlsVersion || 'TLSv1.2',
|
||||
TLSVersion: this.tlsVersion || 'tlsv1.2',
|
||||
EnableTLSv3: this.enableTLSv3 ?? true,
|
||||
};
|
||||
const res = await client.request('ModifyDomain', updateParams);
|
||||
|
||||
@@ -37,7 +37,13 @@ export type LoginUrlReply = {
|
||||
ticketValue: any;
|
||||
}
|
||||
|
||||
export type BuildLoginUrlReq = {
|
||||
redirectUri: string;
|
||||
forType?: string;
|
||||
from?:string;
|
||||
}
|
||||
|
||||
export interface IOauthProvider {
|
||||
buildLoginUrl: (params: { redirectUri: string, forType?: string }) => Promise<LoginUrlReply>;
|
||||
buildLoginUrl: (params: BuildLoginUrlReq) => Promise<LoginUrlReply>;
|
||||
onCallback: (params: OnCallbackReq) => Promise<OauthToken>;
|
||||
}
|
||||
@@ -1,2 +1,3 @@
|
||||
export * from './api.js'
|
||||
export * from './oidc/plugin-oidc.js'
|
||||
export * from './wx/plugin-wx.js'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AddonInput, BaseAddon, IsAddon } from "@certd/lib-server";
|
||||
import { IOauthProvider, OnCallbackReq } from "../api.js";
|
||||
import { BuildLoginUrlReq, IOauthProvider, OnCallbackReq } from "../api.js";
|
||||
|
||||
@IsAddon({
|
||||
addonType: "oauth",
|
||||
@@ -56,7 +56,7 @@ export class OidcOauthProvider extends BaseAddon implements IOauthProvider {
|
||||
}
|
||||
}
|
||||
|
||||
async buildLoginUrl(params: { redirectUri: string, forType?: string }) {
|
||||
async buildLoginUrl(params: BuildLoginUrlReq) {
|
||||
const { config, client } = await this.getClient()
|
||||
|
||||
let redirect_uri = new URL(params.redirectUri)
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
import { AddonInput, BaseAddon, IsAddon } from "@certd/lib-server";
|
||||
import { BuildLoginUrlReq, IOauthProvider, OnCallbackReq } from "../api.js";
|
||||
|
||||
@IsAddon({
|
||||
addonType: "oauth",
|
||||
name: 'wx',
|
||||
title: '微信登录',
|
||||
desc: '微信网站应用登录',
|
||||
icon: "mdi:wechat",
|
||||
showTest: false,
|
||||
})
|
||||
export class WxOauthProvider extends BaseAddon implements IOauthProvider {
|
||||
|
||||
@AddonInput({
|
||||
title: "AppId",
|
||||
required: true,
|
||||
helper: "在[微信开放平台](https://open.weixin.qq.com/cgi-bin/index)注册网站应用后获取",
|
||||
})
|
||||
appId = "";
|
||||
|
||||
@AddonInput({
|
||||
title: "AppSecretKey",
|
||||
component: {
|
||||
placeholder: "AppSecretKey",
|
||||
},
|
||||
required: true,
|
||||
})
|
||||
appSecretKey = "";
|
||||
|
||||
|
||||
wxAccessToken?: { access_token: string, expires_at: number }
|
||||
|
||||
async buildLoginUrl(params: BuildLoginUrlReq) {
|
||||
|
||||
const from = params.from || "web";
|
||||
const appId = this.appId;
|
||||
const redirect_uri = encodeURIComponent(params.redirectUri);
|
||||
let state: any = {
|
||||
forType: params.forType,
|
||||
from
|
||||
}
|
||||
state = this.ctx.utils.hash.base64(JSON.stringify(state))
|
||||
let scope = "snsapi_userinfo";
|
||||
let loginUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirect_uri}&response_type=code&scope=${scope}&state=${state}#wechat_redirect`
|
||||
if (from === "web") {
|
||||
scope = "snsapi_login";
|
||||
loginUrl = `https://open.weixin.qq.com/connect/qrconnect?appid=${appId}&redirect_uri=${redirect_uri}&response_type=code&scope=${scope}&state=${state}#wechat_redirect`
|
||||
}
|
||||
|
||||
return {
|
||||
loginUrl,
|
||||
ticketValue: {
|
||||
state,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
// async getWxAccessToken() {
|
||||
// if (this.wxAccessToken && this.wxAccessToken.expires_at > Date.now()) {
|
||||
// return this.wxAccessToken
|
||||
// }
|
||||
// const res = await this.http.request({
|
||||
// url: "https://api.weixin.qq.com/cgi-bin/token",
|
||||
// method: "GET",
|
||||
// params: {
|
||||
// appid: this.appId,
|
||||
// secret: this.appSecretKey,
|
||||
// grant_type: "client_credential",
|
||||
// },
|
||||
// })
|
||||
// this.checkRet(res)
|
||||
// this.wxAccessToken = {
|
||||
// access_token: res.access_token,
|
||||
// expires_at: Date.now() + res.expires_in * 1000,
|
||||
// }
|
||||
// return this.wxAccessToken
|
||||
// }
|
||||
|
||||
checkRet(res: any) {
|
||||
if (res.errcode) {
|
||||
throw new Error(res.errmsg)
|
||||
}
|
||||
}
|
||||
|
||||
async onCallback(req: OnCallbackReq) {
|
||||
|
||||
|
||||
// GET https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx520c15f417810387&secret=SECRET&code=CODE&grant_type=authorization_code
|
||||
const res = await this.http.request({
|
||||
url: "https://api.weixin.qq.com/sns/oauth2/access_token",
|
||||
method: "GET",
|
||||
params: {
|
||||
appid: this.appId,
|
||||
secret: this.appSecretKey,
|
||||
code: req.code,
|
||||
grant_type: "authorization_code",
|
||||
},
|
||||
})
|
||||
this.checkRet(res)
|
||||
const accessToken = res.access_token
|
||||
|
||||
|
||||
// GET https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN
|
||||
const userInfoRes = await this.http.request({
|
||||
url: "https://api.weixin.qq.com/sns/userinfo",
|
||||
method: "GET",
|
||||
params: {
|
||||
access_token:accessToken,
|
||||
openid: res.openid,
|
||||
lang: "zh_CN",
|
||||
},
|
||||
})
|
||||
this.checkRet(userInfoRes)
|
||||
|
||||
return {
|
||||
token: {
|
||||
accessToken: res.access_token,
|
||||
refreshToken: res.refresh_token,
|
||||
expiresIn: res.expires_in,
|
||||
},
|
||||
userInfo: {
|
||||
openId: res.unionid || res.openid,
|
||||
nickName: userInfoRes.nickname || "",
|
||||
avatar: userInfoRes.headimgurl,
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
23:57
|
||||
04:30
|
||||
|
||||
Reference in New Issue
Block a user