mirror of
https://github.com/certd/certd.git
synced 2026-04-14 20:40:53 +08:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ecfcada802 | ||
|
|
f8ec5ae253 | ||
|
|
832ba5c8fb | ||
|
|
fa8e91cdcd | ||
|
|
e5d902663b | ||
|
|
042535536e | ||
|
|
6d3063437c | ||
|
|
3db4d04e4c | ||
|
|
96f9eab5cd | ||
|
|
1e641b83c1 | ||
|
|
3791d92d67 | ||
|
|
2bcab76f5a | ||
|
|
f5493c542b |
@@ -3,6 +3,10 @@
|
|||||||
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.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package root
|
||||||
|
|
||||||
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
**Note:** Version bump only for package root
|
**Note:** Version bump only for package root
|
||||||
|
|||||||
@@ -6,9 +6,10 @@ CertD 是一个帮助你全自动申请和部署SSL证书的工具。
|
|||||||
## 特性
|
## 特性
|
||||||
本项目不仅支持证书申请过程自动化,还可以自动化部署证书,让你的证书永不过期。
|
本项目不仅支持证书申请过程自动化,还可以自动化部署证书,让你的证书永不过期。
|
||||||
|
|
||||||
* 全自动申请证书
|
* 全自动申请证书(支持阿里云、腾讯云、华为云注册的域名)
|
||||||
* 全自动部署证书(目前支持服务器上传部署、阿里云、腾讯云等)
|
* 全自动部署证书(目前支持服务器上传部署、阿里云、腾讯云等)
|
||||||
* 可与CI/DI工具结合使用
|
* 支持通配符域名
|
||||||
|
* 支持多个域名打到一个证书上
|
||||||
|
|
||||||
## 免费证书申请说明
|
## 免费证书申请说明
|
||||||
* 本项目ssl证书提供商为letencrypt
|
* 本项目ssl证书提供商为letencrypt
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import fs from 'fs'
|
|||||||
|
|
||||||
//读取 packages/core/pipline/package.json的版本号
|
//读取 packages/core/pipline/package.json的版本号
|
||||||
import { default as packageJson } from './packages/core/pipeline/package.json' assert { type: "json" };
|
import { default as packageJson } from './packages/core/pipeline/package.json' assert { type: "json" };
|
||||||
console.log("certdVersion", packageJson.version)
|
const certdVersion = packageJson.version
|
||||||
|
console.log("certdVersion",certdVersion)
|
||||||
|
|
||||||
// 同步npmmirror的包
|
// 同步npmmirror的包
|
||||||
async function getPackages(directoryPath) {
|
async function getPackages(directoryPath) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
FROM registry.cn-shenzhen.aliyuncs.com/handsfree/node:16-alpine
|
FROM registry.cn-shenzhen.aliyuncs.com/handsfree/node:16-alpine
|
||||||
EXPOSE 7001
|
EXPOSE 7001
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV production
|
||||||
|
ENV MIDWAY_SERVER_ENV production
|
||||||
WORKDIR /app/
|
WORKDIR /app/
|
||||||
#RUN npm install cross-env -g --registry=https://registry.npmmirror.com
|
#RUN npm install cross-env -g --registry=https://registry.npmmirror.com
|
||||||
#RUN npm install pm2 -g --registry=https://registry.npmmirror.com
|
#RUN npm install pm2 -g --registry=https://registry.npmmirror.com
|
||||||
|
|||||||
@@ -9,5 +9,5 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"npmClient": "pnpm",
|
"npmClient": "pnpm",
|
||||||
"version": "1.1.1"
|
"version": "1.1.2"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,12 +11,12 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "lerna bootstrap --hoist",
|
"start": "lerna bootstrap --hoist",
|
||||||
"i-all": "lerna link && lerna exec npm install ",
|
"i-all": "lerna link && lerna exec npm install ",
|
||||||
"publish": "npm run proxy && npm run prepublishOnly1 && lerna publish --conventional-commits && npm run afterpublishOnly && npm run deploy",
|
"publish": "npm run proxy && npm run prepublishOnly1 && lerna publish --conventional-commits && npm run afterpublishOnly && node deploy.js",
|
||||||
"afterpublishOnly": "",
|
"afterpublishOnly": "",
|
||||||
"proxy": "npm config set proxy=http://127.0.0.1:10809",
|
"proxy": "npm config set proxy=http://127.0.0.1:10809",
|
||||||
"prepublishOnly1": "npm run before-build && lerna run build ",
|
"prepublishOnly1": "npm run before-build && lerna run build ",
|
||||||
"before-build": "cd ./packages/core/acme-client && time /t >build.md && git add ./build.md && git commit -m \"build: prepare to build\"",
|
"before-build": "cd ./packages/core/acme-client && time /t >build.md && git add ./build.md && git commit -m \"build: prepare to build\"",
|
||||||
"deploy": "node deploy.js"
|
"deploy1": "node deploy.js"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
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.1.2](https://github.com/publishlab/node-acme-client/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
## [1.1.1](https://github.com/publishlab/node-acme-client/compare/v1.1.0...v1.1.1) (2023-06-28)
|
## [1.1.1](https://github.com/publishlab/node-acme-client/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/acme-client
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
15:46
|
09:16
|
||||||
|
|||||||
@@ -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.1.1",
|
"version": "1.1.2",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"types": "types",
|
"types": "types",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
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.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
**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.1.1",
|
"version": "1.1.2",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
@@ -20,11 +20,10 @@
|
|||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"node-forge": "^1.3.1",
|
"node-forge": "^1.3.1",
|
||||||
"nodemailer": "^6.9.3",
|
"nodemailer": "^6.9.3",
|
||||||
"qs": "^6.11.2",
|
"qs": "^6.11.2"
|
||||||
"uuid": "^8.3.2"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/acme-client": "^1.1.1",
|
"@certd/acme-client": "^1.1.2",
|
||||||
"@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",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { IAccessService } from "../access";
|
|||||||
import { IEmailService } from "../service";
|
import { IEmailService } from "../service";
|
||||||
import { IContext } from "../core";
|
import { IContext } from "../core";
|
||||||
import { AxiosInstance } from "axios";
|
import { AxiosInstance } from "axios";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
|
||||||
export enum ContextScope {
|
export enum ContextScope {
|
||||||
global,
|
global,
|
||||||
pipeline,
|
pipeline,
|
||||||
@@ -78,16 +78,19 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
|
|||||||
this.ctx = ctx;
|
this.ctx = ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
randomFileId() {
|
||||||
|
return Math.random().toString(36).substring(2, 9);
|
||||||
|
}
|
||||||
linkFile(file: FileItem) {
|
linkFile(file: FileItem) {
|
||||||
this._result.files!.push({
|
this._result.files!.push({
|
||||||
...file,
|
...file,
|
||||||
id: uuidv4(),
|
id: this.randomFileId(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
saveFile(filename: string, file: Buffer) {
|
saveFile(filename: string, file: Buffer) {
|
||||||
const filePath = this.ctx.fileStore.writeFile(filename, file);
|
const filePath = this.ctx.fileStore.writeFile(filename, file);
|
||||||
this._result.files!.push({
|
this._result.files!.push({
|
||||||
id: uuidv4(),
|
id: this.randomFileId(),
|
||||||
filename,
|
filename,
|
||||||
path: filePath,
|
path: filePath,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import "reflect-metadata";
|
|||||||
export const PLUGIN_CLASS_KEY = "pipeline:plugin";
|
export const PLUGIN_CLASS_KEY = "pipeline:plugin";
|
||||||
|
|
||||||
export function IsTaskPlugin(define: PluginDefine): ClassDecorator {
|
export function IsTaskPlugin(define: PluginDefine): ClassDecorator {
|
||||||
console.log("IsTaskPlugin");
|
|
||||||
return (target: any) => {
|
return (target: any) => {
|
||||||
target = Decorator.target(target);
|
target = Decorator.target(target);
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
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.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-aliyun
|
||||||
|
|
||||||
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-aliyun
|
**Note:** Version bump only for package @certd/plugin-aliyun
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-aliyun",
|
"name": "@certd/plugin-aliyun",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
@@ -23,10 +23,10 @@
|
|||||||
"node-forge": "^0.10.0"
|
"node-forge": "^0.10.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/acme-client": "^1.1.1",
|
"@certd/acme-client": "^1.1.2",
|
||||||
"@certd/pipeline": "^1.1.1",
|
"@certd/pipeline": "^1.1.2",
|
||||||
"@certd/plugin-cert": "^1.1.1",
|
"@certd/plugin-cert": "^1.1.2",
|
||||||
"@certd/plugin-util": "^1.1.1",
|
"@certd/plugin-util": "^1.1.2",
|
||||||
"@midwayjs/core": "^3.0.0",
|
"@midwayjs/core": "^3.0.0",
|
||||||
"@midwayjs/decorator": "^3.0.0",
|
"@midwayjs/decorator": "^3.0.0",
|
||||||
"@rollup/plugin-commonjs": "^23.0.4",
|
"@rollup/plugin-commonjs": "^23.0.4",
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
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.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-all
|
||||||
|
|
||||||
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-all
|
**Note:** Version bump only for package @certd/plugin-all
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-all",
|
"name": "@certd/plugin-all",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
@@ -17,12 +17,12 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/pipeline": "^1.1.1",
|
"@certd/pipeline": "^1.1.2",
|
||||||
"@certd/plugin-aliyun": "^1.1.1",
|
"@certd/plugin-aliyun": "^1.1.2",
|
||||||
"@certd/plugin-cert": "^1.1.1",
|
"@certd/plugin-cert": "^1.1.2",
|
||||||
"@certd/plugin-host": "^1.1.1",
|
"@certd/plugin-host": "^1.1.2",
|
||||||
"@certd/plugin-huawei": "^1.1.1",
|
"@certd/plugin-huawei": "^1.1.2",
|
||||||
"@certd/plugin-tencent": "^1.1.1",
|
"@certd/plugin-tencent": "^1.1.2",
|
||||||
"@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",
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
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.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
**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.1.1",
|
"version": "1.1.2",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/acme-client": "^1.1.1",
|
"@certd/acme-client": "^1.1.2",
|
||||||
"@certd/pipeline": "^1.1.1",
|
"@certd/pipeline": "^1.1.2",
|
||||||
"jszip": "^3.10.1",
|
"jszip": "^3.10.1",
|
||||||
"node-forge": "^0.10.0"
|
"node-forge": "^0.10.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
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.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-host
|
||||||
|
|
||||||
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-host
|
**Note:** Version bump only for package @certd/plugin-host
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-host",
|
"name": "@certd/plugin-host",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/pipeline": "^1.1.1",
|
"@certd/pipeline": "^1.1.2",
|
||||||
"@certd/plugin-cert": "^1.1.1",
|
"@certd/plugin-cert": "^1.1.2",
|
||||||
"ssh2": "^0.8.9"
|
"ssh2": "^0.8.9"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
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.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-huawei
|
||||||
|
|
||||||
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-huawei
|
**Note:** Version bump only for package @certd/plugin-huawei
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-huawei",
|
"name": "@certd/plugin-huawei",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
@@ -17,10 +17,10 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/acme-client": "^1.1.1",
|
"@certd/acme-client": "^1.1.2",
|
||||||
"@certd/pipeline": "^1.1.1",
|
"@certd/pipeline": "^1.1.2",
|
||||||
"@certd/plugin-cert": "^1.1.1",
|
"@certd/plugin-cert": "^1.1.2",
|
||||||
"@certd/plugin-util": "^1.1.1",
|
"@certd/plugin-util": "^1.1.2",
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
"dayjs": "^1.11.6",
|
"dayjs": "^1.11.6",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
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.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-tencent
|
||||||
|
|
||||||
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-tencent
|
**Note:** Version bump only for package @certd/plugin-tencent
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-tencent",
|
"name": "@certd/plugin-tencent",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
@@ -17,9 +17,9 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/pipeline": "^1.1.1",
|
"@certd/pipeline": "^1.1.2",
|
||||||
"@certd/plugin-cert": "^1.1.1",
|
"@certd/plugin-cert": "^1.1.2",
|
||||||
"@certd/plugin-util": "^1.1.1",
|
"@certd/plugin-util": "^1.1.2",
|
||||||
"tencentcloud-sdk-nodejs": "^4.0.44"
|
"tencentcloud-sdk-nodejs": "^4.0.44"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
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.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-util
|
||||||
|
|
||||||
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-util
|
**Note:** Version bump only for package @certd/plugin-util
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-util",
|
"name": "@certd/plugin-util",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"shelljs": "^0.8.5"
|
"shelljs": "^0.8.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/pipeline": "^1.1.1",
|
"@certd/pipeline": "^1.1.2",
|
||||||
"@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",
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
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.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/ui-client
|
||||||
|
|
||||||
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/ui-client
|
**Note:** Version bump only for package @certd/ui-client
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/ui-client",
|
"name": "@certd/ui-client",
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -22,12 +22,11 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ant-design/colors": "^6.0.0",
|
"@ant-design/colors": "^6.0.0",
|
||||||
"@ant-design/icons-vue": "^6.0.1",
|
"@ant-design/icons-vue": "^6.0.1",
|
||||||
"@certd/acme-client": "^1.1.1",
|
"@certd/acme-client": "^1.1.2",
|
||||||
"@certd/pipeline": "^1.1.1",
|
"@fast-crud/fast-crud": "^1.14.4",
|
||||||
"@fast-crud/fast-crud": "^1.13.8",
|
"@fast-crud/fast-extends": "^1.14.4",
|
||||||
"@fast-crud/fast-extends": "^1.13.8",
|
"@fast-crud/ui-antdv": "^1.14.4",
|
||||||
"@fast-crud/ui-antdv": "^1.13.8",
|
"@fast-crud/ui-interface": "^1.14.4",
|
||||||
"@fast-crud/ui-interface": "^1.13.8",
|
|
||||||
"@iconify/iconify": "^3.0.1",
|
"@iconify/iconify": "^3.0.1",
|
||||||
"@iconify/json": "^2.1.151",
|
"@iconify/json": "^2.1.151",
|
||||||
"@purge-icons/generated": "^0.9.0",
|
"@purge-icons/generated": "^0.9.0",
|
||||||
@@ -60,10 +59,11 @@
|
|||||||
"vuedraggable": "^4.0.1"
|
"vuedraggable": "^4.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@certd/pipeline": "^1.1.2",
|
||||||
"@rollup/plugin-commonjs": "^23.0.4",
|
"@rollup/plugin-commonjs": "^23.0.4",
|
||||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||||
"@types/chai": "^4.3.4",
|
"@types/chai": "^4.3.4",
|
||||||
"@types/lodash": "^4.14.195",
|
"@types/lodash-es": "^4.17.7",
|
||||||
"@types/mocha": "^10.0.1",
|
"@types/mocha": "^10.0.1",
|
||||||
"@types/node": "^18.11.15",
|
"@types/node": "^18.11.15",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.46.1",
|
"@typescript-eslint/eslint-plugin": "^5.46.1",
|
||||||
@@ -107,10 +107,8 @@
|
|||||||
"vite-plugin-package-config": "^0.1.1",
|
"vite-plugin-package-config": "^0.1.1",
|
||||||
"vite-plugin-purge-icons": "^0.9.2",
|
"vite-plugin-purge-icons": "^0.9.2",
|
||||||
"vite-plugin-theme": "^0.8.1",
|
"vite-plugin-theme": "^0.8.1",
|
||||||
"vite-plugin-windicss": "^1.8.10",
|
|
||||||
"vue-eslint-parser": "^9.1.0",
|
"vue-eslint-parser": "^9.1.0",
|
||||||
"vue-tsc": "^0.40.13",
|
"vue-tsc": "^0.40.13"
|
||||||
"windicss": "^3.5.6"
|
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { get } from "lodash";
|
import { get } from "lodash-es";
|
||||||
import Adapter from "axios-mock-adapter";
|
import Adapter from "axios-mock-adapter";
|
||||||
import { errorLog, errorCreate } from "./tools";
|
import { errorLog, errorCreate } from "./tools";
|
||||||
import { env } from "/src/utils/util.env";
|
import { env } from "/src/utils/util.env";
|
||||||
|
|||||||
@@ -1,20 +1,13 @@
|
|||||||
import { createI18n } from "vue-i18n";
|
import { createI18n } from "vue-i18n";
|
||||||
//
|
|
||||||
import enFsLocale from "@fast-crud/fast-crud/dist/locale/lang/en.js";
|
|
||||||
import zhFsLocale from "@fast-crud/fast-crud/dist/locale/lang/zh-cn.js";
|
|
||||||
import en from "./locale/en";
|
import en from "./locale/en";
|
||||||
import zh from "./locale/zh_CN";
|
import zh from "./locale/zh_CN";
|
||||||
const messages = {
|
const messages = {
|
||||||
en: {
|
en: {
|
||||||
label: "English",
|
label: "English",
|
||||||
// 定义您自己的字典,但是请不要和 `fs` 重复,这样会导致 fast-crud 内部组件的翻译失效.
|
|
||||||
fs: enFsLocale.fs,
|
|
||||||
...en
|
...en
|
||||||
},
|
},
|
||||||
"zh-cn": {
|
"zh-cn": {
|
||||||
label: "简体中文",
|
label: "简体中文",
|
||||||
// 定义您自己的字典,但是请不要和 `fs` 重复,这样会导致 fast-crud 内部组件的翻译失效.
|
|
||||||
fs: zhFsLocale.fs,
|
|
||||||
...zh
|
...zh
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import i18n from "../../../i18n";
|
import i18n from "../../../i18n";
|
||||||
import { computed, inject } from "vue";
|
import { computed, inject } from "vue";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
export default {
|
export default {
|
||||||
name: "FsLocale",
|
name: "FsLocale",
|
||||||
setup() {
|
setup() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { ref, watch, onMounted, onUnmounted, resolveComponent, nextTick, defineComponent } from "vue";
|
import { ref, watch, onMounted, onUnmounted, resolveComponent, nextTick, defineComponent } from "vue";
|
||||||
import getEachDeep from "deepdash-es/getEachDeep";
|
import getEachDeep from "deepdash-es/getEachDeep";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
import BScroll from "better-scroll";
|
import BScroll from "better-scroll";
|
||||||
import "./index.less";
|
import "./index.less";
|
||||||
const eachDeep = getEachDeep(_);
|
const eachDeep = getEachDeep(_);
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import App from "./App.vue";
|
|||||||
import router from "./router";
|
import router from "./router";
|
||||||
import Antd from "ant-design-vue";
|
import Antd from "ant-design-vue";
|
||||||
import "./style/common.less";
|
import "./style/common.less";
|
||||||
import "./mock";
|
|
||||||
import i18n from "./i18n";
|
import i18n from "./i18n";
|
||||||
import store from "./store";
|
import store from "./store";
|
||||||
import components from "./components";
|
import components from "./components";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
function copyList(originList, newList, options, parentId) {
|
function copyList(originList, newList, options, parentId) {
|
||||||
for (const item of originList) {
|
for (const item of originList) {
|
||||||
const newItem = { ...item, parentId };
|
const newItem = { ...item, parentId };
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
export async function getPcasData() {
|
export async function getPcasData() {
|
||||||
const pcasData = () => import("china-division/dist/pcas-code.json");
|
const pcasData = () => import("china-division/dist/pcas-code.json");
|
||||||
const ret = await pcasData();
|
const ret = await pcasData();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { mock } from "../api/service";
|
import { mock } from "../api/service";
|
||||||
import * as tools from "../api/tools";
|
import * as tools from "../api/tools";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
const commonMocks = import.meta.globEager("./common/mock.*.js");
|
const commonMocks = import.meta.globEager("./common/mock.*.js");
|
||||||
const apiMocks = import.meta.globEager("../api/modules/*.mock.ts");
|
const apiMocks = import.meta.globEager("../api/modules/*.mock.ts");
|
||||||
const viewMocks = import.meta.globEager("../views/**/mock.js");
|
const viewMocks = import.meta.globEager("../views/**/mock.js");
|
||||||
|
|||||||
@@ -1,225 +0,0 @@
|
|||||||
import { request, requestForMock } from "/src/api/service";
|
|
||||||
import "/src/mock";
|
|
||||||
import UiAntdv from "@fast-crud/ui-antdv";
|
|
||||||
import { FastCrud, UseCrudProps, useTypes, setLogger } from "@fast-crud/fast-crud";
|
|
||||||
import "@fast-crud/fast-crud/dist/style.css";
|
|
||||||
import { FsExtendsUploader, FsExtendsEditor, FsExtendsJson, FsExtendsCopyable, FsExtendsTime } from "@fast-crud/fast-extends";
|
|
||||||
import "@fast-crud/fast-extends/dist/style.css";
|
|
||||||
|
|
||||||
import { useCrudPermission } from "../permission";
|
|
||||||
|
|
||||||
function install(app, options: any = {}) {
|
|
||||||
app.use(UiAntdv);
|
|
||||||
//设置日志级别
|
|
||||||
setLogger({ level: "debug" });
|
|
||||||
app.use(FastCrud, {
|
|
||||||
i18n: options.i18n,
|
|
||||||
async dictRequest({ url }) {
|
|
||||||
if (url && url.startsWith("/mock")) {
|
|
||||||
//如果是crud开头的dict请求视为mock
|
|
||||||
return await requestForMock({ url, method: "post" });
|
|
||||||
}
|
|
||||||
return await request({ url, method: "post" });
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* useCrud时会被执行
|
|
||||||
* @param context,useCrud的参数
|
|
||||||
*/
|
|
||||||
commonOptions(context: UseCrudProps) {
|
|
||||||
const crudBinding = context.expose?.crudBinding;
|
|
||||||
const opts = {
|
|
||||||
table: {
|
|
||||||
size: "small",
|
|
||||||
pagination: false,
|
|
||||||
onResizeColumn: (w, col) => {
|
|
||||||
crudBinding.value.table.columnsMap[col.key].width = w;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
rowHandle: {
|
|
||||||
buttons: {
|
|
||||||
view: { type: "link", text: null, icon: "ion:eye-outline" },
|
|
||||||
edit: { type: "link", text: null, icon: "ion:create-outline" },
|
|
||||||
remove: { type: "link", style: { color: "red" }, text: null, icon: "ion:trash-outline" }
|
|
||||||
},
|
|
||||||
dropdown: {
|
|
||||||
more: {
|
|
||||||
type: "link"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
request: {
|
|
||||||
transformQuery: ({ page, form, sort }) => {
|
|
||||||
const limit = page.pageSize;
|
|
||||||
const currentPage = page.currentPage ?? 1;
|
|
||||||
const offset = limit * (currentPage - 1);
|
|
||||||
|
|
||||||
sort = sort == null ? {} : sort;
|
|
||||||
|
|
||||||
return {
|
|
||||||
page: {
|
|
||||||
limit,
|
|
||||||
offset
|
|
||||||
},
|
|
||||||
query: form,
|
|
||||||
sort
|
|
||||||
};
|
|
||||||
},
|
|
||||||
transformRes: ({ res }) => {
|
|
||||||
const pageSize = res.limit;
|
|
||||||
let currentPage = res.offset / pageSize;
|
|
||||||
if (res.offset % pageSize === 0) {
|
|
||||||
currentPage++;
|
|
||||||
}
|
|
||||||
return { currentPage, pageSize, ...res };
|
|
||||||
}
|
|
||||||
},
|
|
||||||
form: {
|
|
||||||
display: "flex",
|
|
||||||
labelCol: {
|
|
||||||
//固定label宽度
|
|
||||||
span: null,
|
|
||||||
style: {
|
|
||||||
width: "120px"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
wrapperCol: {
|
|
||||||
span: null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 从 useCrud({permission}) 里获取permission参数,去设置各个按钮的权限
|
|
||||||
const crudPermission = useCrudPermission({ permission: context.permission });
|
|
||||||
return crudPermission.merge(opts);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// fast-extends里面的扩展组件均为异步组件,只有在使用时才会被加载,并不会影响首页加载速度
|
|
||||||
//安装uploader 公共参数
|
|
||||||
app.use(FsExtendsUploader, {
|
|
||||||
defaultType: "cos",
|
|
||||||
cos: {
|
|
||||||
domain: "https://d2p-demo-1251260344.cos.ap-guangzhou.myqcloud.com",
|
|
||||||
bucket: "d2p-demo-1251260344",
|
|
||||||
region: "ap-guangzhou",
|
|
||||||
secretId: "", //
|
|
||||||
secretKey: "", // 传了secretKey 和secretId 代表使用本地签名模式(不安全,生产环境不推荐)
|
|
||||||
getAuthorization(custom) {
|
|
||||||
// 不传secretKey代表使用临时签名模式,此时此参数必传(安全,生产环境推荐)
|
|
||||||
return request({
|
|
||||||
url: "http://www.docmirror.cn:7070/api/upload/cos/getAuthorization",
|
|
||||||
method: "get"
|
|
||||||
}).then((ret) => {
|
|
||||||
// 返回结构如下
|
|
||||||
// ret.data:{
|
|
||||||
// TmpSecretId,
|
|
||||||
// TmpSecretKey,
|
|
||||||
// XCosSecurityToken,
|
|
||||||
// ExpiredTime, // SDK 在 ExpiredTime 时间前,不会再次调用 getAuthorization
|
|
||||||
// }
|
|
||||||
return ret;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
successHandle(ret) {
|
|
||||||
// 上传完成后可以在此处处理结果,修改url什么的
|
|
||||||
console.log("success handle:", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
alioss: {
|
|
||||||
domain: "https://d2p-demo.oss-cn-shenzhen.aliyuncs.com",
|
|
||||||
bucket: "d2p-demo",
|
|
||||||
region: "oss-cn-shenzhen",
|
|
||||||
accessKeyId: "",
|
|
||||||
accessKeySecret: "",
|
|
||||||
async getAuthorization(custom, context) {
|
|
||||||
// 不传accessKeySecret代表使用临时签名模式,此时此参数必传(安全,生产环境推荐)
|
|
||||||
const ret = await request({
|
|
||||||
url: "http://www.docmirror.cn:7070/api/upload/alioss/getAuthorization",
|
|
||||||
method: "get"
|
|
||||||
});
|
|
||||||
console.log("ret", ret);
|
|
||||||
return ret;
|
|
||||||
},
|
|
||||||
sdkOpts: {
|
|
||||||
// sdk配置
|
|
||||||
secure: true // 默认为非https上传,为了安全,设置为true
|
|
||||||
},
|
|
||||||
successHandle(ret) {
|
|
||||||
// 上传完成后可以在此处处理结果,修改url什么的
|
|
||||||
console.log("success handle:", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
qiniu: {
|
|
||||||
bucket: "d2p-demo",
|
|
||||||
async getToken(options) {
|
|
||||||
const ret = await request({
|
|
||||||
url: "http://www.docmirror.cn:7070/api/upload/qiniu/getToken",
|
|
||||||
method: "get"
|
|
||||||
});
|
|
||||||
return ret; // {token:xxx,expires:xxx}
|
|
||||||
},
|
|
||||||
successHandle(ret) {
|
|
||||||
// 上传完成后可以在此处处理结果,修改url什么的
|
|
||||||
console.log("success handle:", ret);
|
|
||||||
return ret;
|
|
||||||
},
|
|
||||||
domain: "http://d2p.file.handsfree.work/"
|
|
||||||
},
|
|
||||||
form: {
|
|
||||||
action: "http://www.docmirror.cn:7070/api/upload/form/upload",
|
|
||||||
name: "file",
|
|
||||||
withCredentials: false,
|
|
||||||
uploadRequest: async ({ action, file, onProgress }) => {
|
|
||||||
// @ts-ignore
|
|
||||||
const data = new FormData();
|
|
||||||
data.append("file", file);
|
|
||||||
return await request({
|
|
||||||
url: action,
|
|
||||||
method: "post",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "multipart/form-data"
|
|
||||||
},
|
|
||||||
timeout: 60000,
|
|
||||||
data,
|
|
||||||
onUploadProgress: (p) => {
|
|
||||||
onProgress({ percent: Math.round((p.loaded / p.total) * 100) });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
successHandle(ret) {
|
|
||||||
// 上传完成后的结果处理, 此处应返回格式为{url:xxx}
|
|
||||||
return {
|
|
||||||
url: "http://www.docmirror.cn:7070" + ret,
|
|
||||||
key: ret.replace("/api/upload/form/download?key=", "")
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
//安装editor
|
|
||||||
app.use(FsExtendsEditor, {
|
|
||||||
//编辑器的公共配置
|
|
||||||
wangEditor: {}
|
|
||||||
});
|
|
||||||
app.use(FsExtendsJson);
|
|
||||||
app.use(FsExtendsTime);
|
|
||||||
app.use(FsExtendsCopyable);
|
|
||||||
|
|
||||||
const { addTypes } = useTypes();
|
|
||||||
addTypes({
|
|
||||||
time2: {
|
|
||||||
//如果与官方字段类型同名,将会覆盖官方的字段类型
|
|
||||||
form: { component: { name: "a-date-picker" } },
|
|
||||||
column: { component: { name: "fs-date-format", format: "YYYY-MM-DD" } },
|
|
||||||
valueBuilder(context) {
|
|
||||||
console.log("time2,valueBuilder", context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export default {
|
|
||||||
install
|
|
||||||
};
|
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
import { request, requestForMock } from "/src/api/service";
|
import { request, requestForMock } from "/src/api/service";
|
||||||
import "/src/mock";
|
import { ColumnCompositionProps, CrudOptions, FastCrud, setLogger, useColumns, UseCrudProps, useTypes } from "@fast-crud/fast-crud";
|
||||||
import { FastCrud, UseCrudProps, useTypes, setLogger, useColumns, ColumnCompositionProps, MergeColumnPlugin, CrudOptions } from "@fast-crud/fast-crud";
|
|
||||||
import "@fast-crud/fast-crud/dist/style.css";
|
import "@fast-crud/fast-crud/dist/style.css";
|
||||||
import { FsExtendsUploader, FsExtendsEditor, FsExtendsJson, FsExtendsCopyable, FsExtendsTime } from "@fast-crud/fast-extends";
|
import { FsExtendsCopyable, FsExtendsEditor, FsExtendsJson, FsExtendsTime, FsExtendsUploader } from "@fast-crud/fast-extends";
|
||||||
import "@fast-crud/fast-extends/dist/style.css";
|
import "@fast-crud/fast-extends/dist/style.css";
|
||||||
import UiAntdv from "@fast-crud/ui-antdv";
|
import UiAntdv from "@fast-crud/ui-antdv";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
import { useCrudPermission } from "../permission";
|
import { useCrudPermission } from "../permission";
|
||||||
|
import { App } from "vue";
|
||||||
|
|
||||||
function install(app, options: any = {}) {
|
function install(app: App, options: any = {}) {
|
||||||
app.use(UiAntdv);
|
app.use(UiAntdv);
|
||||||
//设置日志级别
|
//设置日志级别
|
||||||
setLogger({ level: "debug" });
|
setLogger({ level: "info" });
|
||||||
app.use(FastCrud, {
|
app.use(FastCrud, {
|
||||||
i18n: options.i18n,
|
i18n: options.i18n,
|
||||||
async dictRequest({ url }) {
|
async dictRequest({ url }) {
|
||||||
@@ -31,7 +31,7 @@ function install(app, options: any = {}) {
|
|||||||
table: {
|
table: {
|
||||||
size: "small",
|
size: "small",
|
||||||
pagination: false,
|
pagination: false,
|
||||||
onResizeColumn: (w, col) => {
|
onResizeColumn: (w: any, col: any) => {
|
||||||
crudBinding.value.table.columnsMap[col.key].width = w;
|
crudBinding.value.table.columnsMap[col.key].width = w;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -70,7 +70,7 @@ function install(app, options: any = {}) {
|
|||||||
if (res.offset % pageSize === 0) {
|
if (res.offset % pageSize === 0) {
|
||||||
currentPage++;
|
currentPage++;
|
||||||
}
|
}
|
||||||
return { currentPage, pageSize, ...res };
|
return { currentPage, pageSize, total: res.total, records: res.records };
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
@@ -96,7 +96,9 @@ function install(app, options: any = {}) {
|
|||||||
|
|
||||||
// fast-extends里面的扩展组件均为异步组件,只有在使用时才会被加载,并不会影响首页加载速度
|
// fast-extends里面的扩展组件均为异步组件,只有在使用时才会被加载,并不会影响首页加载速度
|
||||||
//安装uploader 公共参数
|
//安装uploader 公共参数
|
||||||
|
|
||||||
app.use(FsExtendsUploader, {
|
app.use(FsExtendsUploader, {
|
||||||
|
// @ts-ignore
|
||||||
defaultType: "cos",
|
defaultType: "cos",
|
||||||
cos: {
|
cos: {
|
||||||
domain: "https://d2p-demo-1251260344.cos.ap-guangzhou.myqcloud.com",
|
domain: "https://d2p-demo-1251260344.cos.ap-guangzhou.myqcloud.com",
|
||||||
@@ -109,7 +111,7 @@ function install(app, options: any = {}) {
|
|||||||
return request({
|
return request({
|
||||||
url: "http://www.docmirror.cn:7070/api/upload/cos/getAuthorization",
|
url: "http://www.docmirror.cn:7070/api/upload/cos/getAuthorization",
|
||||||
method: "get"
|
method: "get"
|
||||||
}).then((ret) => {
|
}).then((ret: any) => {
|
||||||
// 返回结构如下
|
// 返回结构如下
|
||||||
// ret.data:{
|
// ret.data:{
|
||||||
// TmpSecretId,
|
// TmpSecretId,
|
||||||
@@ -132,7 +134,7 @@ function install(app, options: any = {}) {
|
|||||||
region: "oss-cn-shenzhen",
|
region: "oss-cn-shenzhen",
|
||||||
accessKeyId: "",
|
accessKeyId: "",
|
||||||
accessKeySecret: "",
|
accessKeySecret: "",
|
||||||
async getAuthorization(custom, context) {
|
async getAuthorization(custom: any, context: any) {
|
||||||
// 不传accessKeySecret代表使用临时签名模式,此时此参数必传(安全,生产环境推荐)
|
// 不传accessKeySecret代表使用临时签名模式,此时此参数必传(安全,生产环境推荐)
|
||||||
const ret = await request({
|
const ret = await request({
|
||||||
url: "http://www.docmirror.cn:7070/api/upload/alioss/getAuthorization",
|
url: "http://www.docmirror.cn:7070/api/upload/alioss/getAuthorization",
|
||||||
@@ -183,7 +185,7 @@ function install(app, options: any = {}) {
|
|||||||
},
|
},
|
||||||
timeout: 60000,
|
timeout: 60000,
|
||||||
data,
|
data,
|
||||||
onUploadProgress: (p) => {
|
onUploadProgress: (p: any) => {
|
||||||
onProgress({ percent: Math.round((p.loaded / p.total) * 100) });
|
onProgress({ percent: Math.round((p.loaded / p.total) * 100) });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -214,7 +216,7 @@ function install(app, options: any = {}) {
|
|||||||
//如果与官方字段类型同名,将会覆盖官方的字段类型
|
//如果与官方字段类型同名,将会覆盖官方的字段类型
|
||||||
form: { component: { name: "a-date-picker" } },
|
form: { component: { name: "a-date-picker" } },
|
||||||
column: { component: { name: "fs-date-format", format: "YYYY-MM-DD" } },
|
column: { component: { name: "fs-date-format", format: "YYYY-MM-DD" } },
|
||||||
valueBuilder(context) {
|
valueBuilder(context: any) {
|
||||||
console.log("time2,valueBuilder", context);
|
console.log("time2,valueBuilder", context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
import "./iconfont.js"
|
import "./iconfont.js";
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import "./iconify";
|
import "./iconify";
|
||||||
import "./iconfont";
|
import "./iconfont";
|
||||||
import FastCrud from "./fast-crud";
|
import FastCrud from "./fast-crud/index";
|
||||||
import permission from "./permission";
|
import permission from "./permission";
|
||||||
function install(app, options: any = {}) {
|
import { App } from "vue";
|
||||||
|
function install(app: App, options: any = {}) {
|
||||||
app.use(FastCrud, options);
|
app.use(FastCrud, options);
|
||||||
app.use(permission);
|
app.use(permission);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { usePermission } from "/@/plugin/permission";
|
import { usePermission } from "/@/plugin/permission";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置按钮动作权限
|
* 设置按钮动作权限
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import LayoutPass from "/src/layout/layout-pass.vue";
|
import LayoutPass from "/src/layout/layout-pass.vue";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
import { outsideResource } from "./source/outside";
|
import { outsideResource } from "./source/outside";
|
||||||
import { headerResource } from "./source/header";
|
import { headerResource } from "./source/header";
|
||||||
import { frameworkResource } from "./source/framework";
|
import { frameworkResource } from "./source/framework";
|
||||||
|
|||||||
@@ -55,6 +55,16 @@ export const certdResources = [
|
|||||||
icon: "ion:mail-outline",
|
icon: "ion:mail-outline",
|
||||||
auth: true
|
auth: true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "账号信息",
|
||||||
|
name: "userProfile",
|
||||||
|
path: "/certd/mine/user-profile",
|
||||||
|
component: "/certd/mine/user-profile.vue",
|
||||||
|
meta: {
|
||||||
|
icon: "ion:person-outline",
|
||||||
|
auth: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { cloneDeep, get, uniq } from "lodash";
|
import { cloneDeep, get, uniq } from "lodash-es";
|
||||||
import router from "/src/router";
|
import router from "/src/router";
|
||||||
import { frameworkRoutes } from "/src/router/resolve";
|
import { frameworkRoutes } from "/src/router/resolve";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@@ -21,7 +21,7 @@ interface PageState {
|
|||||||
inited: boolean;
|
inited: boolean;
|
||||||
}
|
}
|
||||||
// 判定是否需要缓存
|
// 判定是否需要缓存
|
||||||
const isKeepAlive = (data) => get(data, "meta.cache", false);
|
const isKeepAlive = (data: any) => get(data, "meta.cache", false);
|
||||||
|
|
||||||
export const usePageStore = defineStore({
|
export const usePageStore = defineStore({
|
||||||
id: "app.page",
|
id: "app.page",
|
||||||
@@ -48,6 +48,7 @@ export const usePageStore = defineStore({
|
|||||||
inited: false
|
inited: false
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
|
// @ts-ignore
|
||||||
getOpened() {
|
getOpened() {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
return this.opened;
|
return this.opened;
|
||||||
@@ -91,7 +92,7 @@ export const usePageStore = defineStore({
|
|||||||
const valid: Array<number> = [];
|
const valid: Array<number> = [];
|
||||||
// 处理数据
|
// 处理数据
|
||||||
this.opened = value
|
this.opened = value
|
||||||
.map((opened) => {
|
.map((opened: any) => {
|
||||||
// 忽略首页
|
// 忽略首页
|
||||||
if (opened.fullPath === "/index") {
|
if (opened.fullPath === "/index") {
|
||||||
valid.push(1);
|
valid.push(1);
|
||||||
@@ -105,7 +106,7 @@ export const usePageStore = defineStore({
|
|||||||
// 新的数据中一般不会携带 params 和 query, 所以旧的参数会留存
|
// 新的数据中一般不会携带 params 和 query, 所以旧的参数会留存
|
||||||
return Object.assign({}, opened, find);
|
return Object.assign({}, opened, find);
|
||||||
})
|
})
|
||||||
.filter((opened, index) => valid[index] === 1);
|
.filter((opened: any, index: any) => valid[index] === 1);
|
||||||
// 标记已经加载多标签页数据 https://github.com/d2-projects/d2-admin/issues/201
|
// 标记已经加载多标签页数据 https://github.com/d2-projects/d2-admin/issues/201
|
||||||
this.openedLoaded = true;
|
this.openedLoaded = true;
|
||||||
// 根据 opened 数据生成缓存设置
|
// 根据 opened 数据生成缓存设置
|
||||||
@@ -132,7 +133,7 @@ export const usePageStore = defineStore({
|
|||||||
* @param {Object} context
|
* @param {Object} context
|
||||||
* @param {Object} payload { index, params, query, fullPath } 路由信息
|
* @param {Object} payload { index, params, query, fullPath } 路由信息
|
||||||
*/
|
*/
|
||||||
async openedUpdate({ index, params, query, fullPath }) {
|
async openedUpdate({ index, params, query, fullPath }: any) {
|
||||||
// 更新页面列表某一项
|
// 更新页面列表某一项
|
||||||
const page = this.opened[index];
|
const page = this.opened[index];
|
||||||
page.params = params || page.params;
|
page.params = params || page.params;
|
||||||
@@ -148,7 +149,7 @@ export const usePageStore = defineStore({
|
|||||||
* @param {Object} context
|
* @param {Object} context
|
||||||
* @param {Object} payload { oldIndex, newIndex } 位置信息
|
* @param {Object} payload { oldIndex, newIndex } 位置信息
|
||||||
*/
|
*/
|
||||||
async openedSort({ oldIndex, newIndex }) {
|
async openedSort({ oldIndex, newIndex }: any) {
|
||||||
// 重排页面列表某一项
|
// 重排页面列表某一项
|
||||||
const page = this.opened[oldIndex];
|
const page = this.opened[oldIndex];
|
||||||
this.opened.splice(oldIndex, 1);
|
this.opened.splice(oldIndex, 1);
|
||||||
@@ -162,7 +163,7 @@ export const usePageStore = defineStore({
|
|||||||
* @param {Object} context
|
* @param {Object} context
|
||||||
* @param {Object} payload new tag info
|
* @param {Object} payload new tag info
|
||||||
*/
|
*/
|
||||||
async add({ tag, params, query, fullPath }) {
|
async add({ tag, params, query, fullPath }: any) {
|
||||||
// 设置新的 tag 在新打开一个以前没打开过的页面时使用
|
// 设置新的 tag 在新打开一个以前没打开过的页面时使用
|
||||||
const newTag = tag;
|
const newTag = tag;
|
||||||
newTag.params = params || newTag.params;
|
newTag.params = params || newTag.params;
|
||||||
@@ -183,7 +184,7 @@ export const usePageStore = defineStore({
|
|||||||
* @param {Object} context
|
* @param {Object} context
|
||||||
* @param {Object} payload 从路由钩子的 to 对象上获取 { name, params, query, fullPath, meta } 路由信息
|
* @param {Object} payload 从路由钩子的 to 对象上获取 { name, params, query, fullPath, meta } 路由信息
|
||||||
*/
|
*/
|
||||||
async open({ name, params, query, fullPath, meta }) {
|
async open({ name, params, query, fullPath, meta }: any) {
|
||||||
// 已经打开的页面
|
// 已经打开的页面
|
||||||
const opened = this.opened;
|
const opened = this.opened;
|
||||||
// 判断此页面是否已经打开 并且记录位置
|
// 判断此页面是否已经打开 并且记录位置
|
||||||
@@ -227,7 +228,7 @@ export const usePageStore = defineStore({
|
|||||||
* @param {Object} context
|
* @param {Object} context
|
||||||
* @param {Object} payload { tagName: 要关闭的标签名字 }
|
* @param {Object} payload { tagName: 要关闭的标签名字 }
|
||||||
*/
|
*/
|
||||||
async close({ tagName }) {
|
async close({ tagName }: any) {
|
||||||
// 预定下个新页面
|
// 预定下个新页面
|
||||||
let newPage = {};
|
let newPage = {};
|
||||||
const isCurrent = this.current === tagName;
|
const isCurrent = this.current === tagName;
|
||||||
@@ -267,7 +268,7 @@ export const usePageStore = defineStore({
|
|||||||
*/
|
*/
|
||||||
async closeLeft(opts = {}) {
|
async closeLeft(opts = {}) {
|
||||||
await this.closeByCondition({
|
await this.closeByCondition({
|
||||||
condition({ i, currentIndex }) {
|
condition({ i, currentIndex }: any) {
|
||||||
return i >= currentIndex;
|
return i >= currentIndex;
|
||||||
},
|
},
|
||||||
...opts
|
...opts
|
||||||
@@ -280,7 +281,7 @@ export const usePageStore = defineStore({
|
|||||||
*/
|
*/
|
||||||
async closeRight(opts = {}) {
|
async closeRight(opts = {}) {
|
||||||
await this.closeByCondition({
|
await this.closeByCondition({
|
||||||
condition({ i, currentIndex }) {
|
condition({ i, currentIndex }: any) {
|
||||||
return currentIndex >= i;
|
return currentIndex >= i;
|
||||||
},
|
},
|
||||||
...opts
|
...opts
|
||||||
@@ -321,7 +322,7 @@ export const usePageStore = defineStore({
|
|||||||
*/
|
*/
|
||||||
async closeOther(opts = {}) {
|
async closeOther(opts = {}) {
|
||||||
await this.closeByCondition({
|
await this.closeByCondition({
|
||||||
condition({ i, currentIndex }) {
|
condition({ i, currentIndex }: any) {
|
||||||
return currentIndex === i;
|
return currentIndex === i;
|
||||||
},
|
},
|
||||||
...opts
|
...opts
|
||||||
@@ -364,7 +365,7 @@ export const usePageStore = defineStore({
|
|||||||
* @param {Object} state state
|
* @param {Object} state state
|
||||||
* @param {String} name name
|
* @param {String} name name
|
||||||
*/
|
*/
|
||||||
keepAliveRemove(name) {
|
keepAliveRemove(name: any) {
|
||||||
const list = cloneDeep(this.keepAlive);
|
const list = cloneDeep(this.keepAlive);
|
||||||
const index = list.findIndex((item) => item === name);
|
const index = list.findIndex((item) => item === name);
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
@@ -377,7 +378,7 @@ export const usePageStore = defineStore({
|
|||||||
* @param {Object} state state
|
* @param {Object} state state
|
||||||
* @param {String} name name
|
* @param {String} name name
|
||||||
*/
|
*/
|
||||||
keepAlivePush(name) {
|
keepAlivePush(name: any) {
|
||||||
const keep = cloneDeep(this.keepAlive);
|
const keep = cloneDeep(this.keepAlive);
|
||||||
keep.push(name);
|
keep.push(name);
|
||||||
this.keepAlive = uniq(keep);
|
this.keepAlive = uniq(keep);
|
||||||
@@ -395,7 +396,7 @@ export const usePageStore = defineStore({
|
|||||||
* @param {Object} state state
|
* @param {Object} state state
|
||||||
* @param {String} fullPath new fullPath
|
* @param {String} fullPath new fullPath
|
||||||
*/
|
*/
|
||||||
currentSet(fullPath) {
|
currentSet(fullPath: any) {
|
||||||
this.current = fullPath;
|
this.current = fullPath;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -404,7 +405,7 @@ export const usePageStore = defineStore({
|
|||||||
* @param {Object} state state
|
* @param {Object} state state
|
||||||
* @param {Array} routes routes
|
* @param {Array} routes routes
|
||||||
*/
|
*/
|
||||||
async init(routes) {
|
async init(routes: any) {
|
||||||
if (this.inited) {
|
if (this.inited) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -414,9 +415,9 @@ export const usePageStore = defineStore({
|
|||||||
routes = frameworkRoutes;
|
routes = frameworkRoutes;
|
||||||
}
|
}
|
||||||
|
|
||||||
const pool = [];
|
const pool: any = [];
|
||||||
const push = function (routes) {
|
const push = function (routes: any) {
|
||||||
routes.forEach((route) => {
|
routes.forEach((route: any) => {
|
||||||
if (route.children && route.children.length > 0) {
|
if (route.children && route.children.length > 0) {
|
||||||
push(route.children);
|
push(route.children);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { frameworkMenus, headerMenus, filterMenus, findMenus } from "/src/router/resolve";
|
import { frameworkMenus, headerMenus, filterMenus, findMenus } from "/src/router/resolve";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
import { mitter } from "/src/utils/util.mitt";
|
import { mitter } from "/src/utils/util.mitt";
|
||||||
//监听注销事件
|
//监听注销事件
|
||||||
mitter.on("app.logout", () => {
|
mitter.on("app.logout", () => {
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
@import './scroll.less';
|
@import './scroll.less';
|
||||||
@import './transition.less';
|
@import './transition.less';
|
||||||
@import './fix-windicss.less';
|
@import './fix-windicss.less';
|
||||||
|
|
||||||
|
|
||||||
svg { vertical-align: baseline; }
|
svg { vertical-align: baseline; }
|
||||||
|
|
||||||
html, body {
|
html, body {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
export default {
|
export default {
|
||||||
arrayToMap(array: any) {
|
arrayToMap(array: any) {
|
||||||
if (!array) {
|
if (!array) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
export function getEnvValue(key: string) {
|
export function getEnvValue(key: string) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
return import.meta.env["VITE_APP_" + key];
|
return import.meta.env["VITE_APP_" + key];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { env } from "./util.env";
|
import { env } from "./util.env";
|
||||||
function isNullOrUnDef(value) {
|
function isNullOrUnDef(value: any) {
|
||||||
return value == null;
|
return value == null;
|
||||||
}
|
}
|
||||||
const DEFAULT_CACHE_TIME = 60 * 60 * 24 * 7;
|
const DEFAULT_CACHE_TIME = 60 * 60 * 24 * 7;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { ColumnCompositionProps, dict } from "@fast-crud/fast-crud";
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import * as api from "./api";
|
import * as api from "./api";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
import { toRef } from "vue";
|
import { toRef } from "vue";
|
||||||
|
|
||||||
export function getCommonColumnDefine(crudExpose: any, typeRef: any) {
|
export function getCommonColumnDefine(crudExpose: any, typeRef: any) {
|
||||||
|
|||||||
16
packages/ui/certd-client/src/views/certd/mine/api.ts
Normal file
16
packages/ui/certd-client/src/views/certd/mine/api.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { request } from "/src/api/service";
|
||||||
|
|
||||||
|
export async function getMineInfo() {
|
||||||
|
return request({
|
||||||
|
url: "/mine/info",
|
||||||
|
method: "POST"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function changePassword(form: any) {
|
||||||
|
return request({
|
||||||
|
url: "/mine/changePassword",
|
||||||
|
method: "POST",
|
||||||
|
data: form
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
<template>
|
||||||
|
<fs-page>
|
||||||
|
<div class="p-4">
|
||||||
|
<a-descriptions title="我的信息" bordered>
|
||||||
|
<a-descriptions-item label="用户名">{{ userInfo.userInfoname }}</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.phoneCode }}{{ userInfo.mobile }}</a-descriptions-item>
|
||||||
|
<a-descriptions-item label="修改密码">
|
||||||
|
<a-button type="primary" @click="changePassword">修改密码</a-button>
|
||||||
|
</a-descriptions-item>
|
||||||
|
</a-descriptions>
|
||||||
|
</div>
|
||||||
|
</fs-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import * as api from "./api";
|
||||||
|
import { Ref, ref } from "vue";
|
||||||
|
import { CrudOptions, useColumns, useFormWrapper } from "@fast-crud/fast-crud";
|
||||||
|
|
||||||
|
const userInfo: Ref = ref({});
|
||||||
|
|
||||||
|
const getUserInfo = async () => {
|
||||||
|
userInfo.value = await api.getMineInfo();
|
||||||
|
};
|
||||||
|
getUserInfo();
|
||||||
|
|
||||||
|
let passwordFormRef = ref();
|
||||||
|
|
||||||
|
const validatePass1 = async (rule: any, value: any) => {
|
||||||
|
if (value === "") {
|
||||||
|
throw new Error("请输入密码");
|
||||||
|
}
|
||||||
|
if (passwordFormRef.value.getFormData().confirmNewPassword !== "") {
|
||||||
|
passwordFormRef.value.formRef.formRef.validateFields(["confirmNewPassword"]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const validatePass2 = async (rule: any, value: any) => {
|
||||||
|
if (value === "") {
|
||||||
|
throw new Error("请再次输入密码");
|
||||||
|
} else if (value !== passwordFormRef.value.getFormData().newPassword) {
|
||||||
|
throw new Error("两次输入密码不一致!");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const { openDialog } = useFormWrapper();
|
||||||
|
const { buildFormOptions } = useColumns();
|
||||||
|
const passwordFormOptions: CrudOptions = {
|
||||||
|
form: {
|
||||||
|
col: {
|
||||||
|
span: 24
|
||||||
|
},
|
||||||
|
wrapper: {
|
||||||
|
width: "500px"
|
||||||
|
},
|
||||||
|
async doSubmit({ form }) {
|
||||||
|
await api.changePassword(form);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns: {
|
||||||
|
password: {
|
||||||
|
title: "旧密码",
|
||||||
|
type: "password",
|
||||||
|
form: {
|
||||||
|
rules: [{ required: true, message: "请输入旧密码" }]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
newPassword: {
|
||||||
|
title: "新密码",
|
||||||
|
type: "password",
|
||||||
|
form: {
|
||||||
|
rules: [
|
||||||
|
{ required: true, message: "请输入确认密码" },
|
||||||
|
//@ts-ignore
|
||||||
|
{ validator: validatePass1, trigger: "blur" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
confirmNewPassword: {
|
||||||
|
title: "确认新密码",
|
||||||
|
type: "password",
|
||||||
|
form: {
|
||||||
|
rules: [
|
||||||
|
{ required: true, message: "请输入确认密码" },
|
||||||
|
//@ts-ignore
|
||||||
|
{ validator: validatePass2, trigger: "blur" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
async function changePassword() {
|
||||||
|
const formOptions = buildFormOptions(passwordFormOptions);
|
||||||
|
formOptions.newInstance = true; //新实例打开
|
||||||
|
passwordFormRef.value = await openDialog(formOptions);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
|
import { RunHistory } from "./pipeline/type";
|
||||||
import { request } from "/src/api/service";
|
import { request } from "/src/api/service";
|
||||||
import { RunHistory } from "/@/views/certd/pipeline/pipeline/type";
|
|
||||||
|
|
||||||
const apiPrefix = "/pi/history";
|
const apiPrefix = "/pi/history";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { request } from "/src/api/service";
|
import { request } from "/src/api/service";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
const apiPrefix = "/pi/plugin";
|
const apiPrefix = "/pi/plugin";
|
||||||
|
|
||||||
const defaultInputDefine = {
|
const defaultInputDefine = {
|
||||||
@@ -9,7 +9,7 @@ const defaultInputDefine = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function GetList(query) {
|
export async function GetList(query: any) {
|
||||||
const plugins = await request({
|
const plugins = await request({
|
||||||
url: apiPrefix + "/list",
|
url: apiPrefix + "/list",
|
||||||
method: "post",
|
method: "post",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
import { useColumns, useExpose } from "@fast-crud/fast-crud";
|
import { useColumns, useExpose } from "@fast-crud/fast-crud";
|
||||||
import createCrudOptions from "./crud.jsx";
|
import createCrudOptions from "./crud.jsx";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
export default {
|
export default {
|
||||||
name: "PiCertdForm",
|
name: "PiCertdForm",
|
||||||
setup(props, ctx) {
|
setup(props, ctx) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import * as pluginApi from "./api.plugin";
|
|||||||
import * as historyApi from "./api.history";
|
import * as historyApi from "./api.history";
|
||||||
import * as api from "./api";
|
import * as api from "./api";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { PipelineDetail, PipelineOptions, RunHistory, Pipeline } from "/@/views/certd/pipeline/pipeline/type";
|
import { PipelineDetail, PipelineOptions, RunHistory } from "./pipeline/type";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "PipelineDetail",
|
name: "PipelineDetail",
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Modal } from "ant-design-vue";
|
import { Modal } from "ant-design-vue";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
import { nanoid } from "nanoid";
|
import { nanoid } from "nanoid";
|
||||||
import PiNotificationFormEmail from "./pi-notification-form-email.vue";
|
import PiNotificationFormEmail from "./pi-notification-form-email.vue";
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, ref, provide, Ref, watch, computed } from "vue";
|
import { computed, defineComponent } from "vue";
|
||||||
import { statusUtil } from "/@/views/certd/pipeline/pipeline/utils/util.status";
|
import { statusUtil } from "/@/views/certd/pipeline/pipeline/utils/util.status";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "PiStatusShow",
|
name: "PiStatusShow",
|
||||||
props: {
|
props: {
|
||||||
@@ -26,7 +27,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
setup(props, ctx) {
|
setup(props, ctx) {
|
||||||
const statusRef = computed(() => {
|
const statusRef = computed(() => {
|
||||||
return statusUtil.get(props.status);
|
return statusUtil.get(props.status as string);
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
<script lang="tsx">
|
<script lang="tsx">
|
||||||
import { message, Modal } from "ant-design-vue";
|
import { message, Modal } from "ant-design-vue";
|
||||||
import { computed, inject, Ref, ref } from "vue";
|
import { computed, inject, Ref, ref } from "vue";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
import { nanoid } from "nanoid";
|
import { nanoid } from "nanoid";
|
||||||
import { compute } from "@fast-crud/fast-crud";
|
import { compute } from "@fast-crud/fast-crud";
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { provide, Ref, ref } from "vue";
|
import { provide, Ref, ref } from "vue";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
import { nanoid } from "nanoid";
|
import { nanoid } from "nanoid";
|
||||||
import PiStepForm from "../step-form/index.vue";
|
import PiStepForm from "../step-form/index.vue";
|
||||||
import { message, Modal } from "ant-design-vue";
|
import { message, Modal } from "ant-design-vue";
|
||||||
|
|||||||
@@ -1,11 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-modal
|
<a-modal v-model:visible="taskModal.visible" class="pi-task-view" title="任务日志" style="width: 80%" v-bind="taskModal">
|
||||||
v-model:visible="taskModal.visible"
|
|
||||||
class="pi-task-view"
|
|
||||||
title="任务日志"
|
|
||||||
style="width: 80%"
|
|
||||||
v-bind="taskModal"
|
|
||||||
>
|
|
||||||
<a-tabs v-model:activeKey="activeKey" tab-position="left" animated>
|
<a-tabs v-model:activeKey="activeKey" tab-position="left" animated>
|
||||||
<a-tab-pane v-for="item of detail.nodes" :key="item.node.id">
|
<a-tab-pane v-for="item of detail.nodes" :key="item.node.id">
|
||||||
<template #tab>
|
<template #tab>
|
||||||
@@ -14,9 +8,7 @@
|
|||||||
<pi-status-show :status="item.node.status?.result" type="icon"></pi-status-show>
|
<pi-status-show :status="item.node.status?.result" type="icon"></pi-status-show>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<pre
|
<pre class="pi-task-view-logs"><template v-for="(text, index) of item.logs" :key="index">{{ text }}</template></pre>
|
||||||
class="pi-task-view-logs"
|
|
||||||
><template v-for="(text, index) of item.logs" :key="index">{{ text }}</template></pre>
|
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
@@ -24,14 +16,14 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { inject, provide, Ref, ref } from "vue";
|
import { inject, provide, Ref, ref } from "vue";
|
||||||
import { RunHistory } from "/@/views/certd/pipeline/pipeline/type";
|
import { RunHistory } from "../../type";
|
||||||
import PiStatusShow from "/@/views/certd/pipeline/pipeline/component/status-show.vue";
|
import PiStatusShow from "/@/views/certd/pipeline/pipeline/component/status-show.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "PiTaskView",
|
name: "PiTaskView",
|
||||||
components: { PiStatusShow },
|
components: { PiStatusShow },
|
||||||
props: {},
|
props: {},
|
||||||
setup(props, ctx) {
|
setup(props: any, ctx: any) {
|
||||||
const taskModal = ref({
|
const taskModal = ref({
|
||||||
visible: false,
|
visible: false,
|
||||||
onOk() {
|
onOk() {
|
||||||
@@ -43,7 +35,7 @@ export default {
|
|||||||
const detail = ref({ nodes: [] });
|
const detail = ref({ nodes: [] });
|
||||||
const activeKey = ref();
|
const activeKey = ref();
|
||||||
const currentHistory: Ref<RunHistory> | undefined = inject("currentHistory");
|
const currentHistory: Ref<RunHistory> | undefined = inject("currentHistory");
|
||||||
const taskViewOpen = (task) => {
|
const taskViewOpen = (task: any) => {
|
||||||
taskModal.value.visible = true;
|
taskModal.value.visible = true;
|
||||||
const nodes: any = [];
|
const nodes: any = [];
|
||||||
// nodes.push({
|
// nodes.push({
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { message, Modal } from "ant-design-vue";
|
import { message, Modal } from "ant-design-vue";
|
||||||
import { inject, ref } from "vue";
|
import { inject, ref } from "vue";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
import { nanoid } from "nanoid";
|
import { nanoid } from "nanoid";
|
||||||
export default {
|
export default {
|
||||||
name: "PiTriggerForm",
|
name: "PiTriggerForm",
|
||||||
|
|||||||
@@ -207,11 +207,12 @@ import PiTriggerForm from "./component/trigger-form/index.vue";
|
|||||||
import PiNotificationForm from "./component/notification-form/index.vue";
|
import PiNotificationForm from "./component/notification-form/index.vue";
|
||||||
import PiTaskView from "./component/task-view/index.vue";
|
import PiTaskView from "./component/task-view/index.vue";
|
||||||
import PiStatusShow from "./component/status-show.vue";
|
import PiStatusShow from "./component/status-show.vue";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
import { message, Modal, notification } from "ant-design-vue";
|
import { message, Modal, notification } from "ant-design-vue";
|
||||||
import { pluginManager } from "/@/views/certd/pipeline/pipeline/plugin";
|
import { pluginManager } from "/@/views/certd/pipeline/pipeline/plugin";
|
||||||
import { nanoid } from "nanoid";
|
import { nanoid } from "nanoid";
|
||||||
import { PipelineDetail, PipelineOptions, RunHistory, Runnable } from "/@/views/certd/pipeline/pipeline/type";
|
import { PipelineDetail, PipelineOptions, RunHistory } from "./type";
|
||||||
|
import type { Runnable } from "@certd/pipeline";
|
||||||
import PiHistoryTimelineItem from "/@/views/certd/pipeline/pipeline/component/history-timeline-item.vue";
|
import PiHistoryTimelineItem from "/@/views/certd/pipeline/pipeline/component/history-timeline-item.vue";
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "PipelineEdit",
|
name: "PipelineEdit",
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Pipeline } from "@certd/pipeline";
|
import type { Pipeline } from "@certd/pipeline";
|
||||||
export * from "@certd/pipeline";
|
|
||||||
export type PipelineDetail = {
|
export type PipelineDetail = {
|
||||||
pipeline: Pipeline;
|
pipeline: Pipeline;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ const StatusEnum: StatusEnumType = {
|
|||||||
value: "success",
|
value: "success",
|
||||||
label: "成功",
|
label: "成功",
|
||||||
color: "green",
|
color: "green",
|
||||||
|
spin: true,
|
||||||
icon: "ant-design:check-circle-outlined"
|
icon: "ant-design:check-circle-outlined"
|
||||||
},
|
},
|
||||||
error: {
|
error: {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { defineComponent, ref, onMounted } from "vue";
|
|||||||
import { useCrud, dict, useExpose } from "@fast-crud/fast-crud";
|
import { useCrud, dict, useExpose } from "@fast-crud/fast-crud";
|
||||||
import createCrudOptions from "./crud";
|
import createCrudOptions from "./crud";
|
||||||
import { GetCrud } from "./api";
|
import { GetCrud } from "./api";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "AdvancedFromBackend",
|
name: "AdvancedFromBackend",
|
||||||
setup() {
|
setup() {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import mockUtil from "/src/mock/base";
|
import mockUtil from "/src/mock/base";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
const options = {
|
const options = {
|
||||||
name: "FormLinkage",
|
name: "FormLinkage",
|
||||||
idGenerator: 0
|
idGenerator: 0
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as api from "./api";
|
import * as api from "./api";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
import { dict } from "@fast-crud/fast-crud";
|
import { dict } from "@fast-crud/fast-crud";
|
||||||
export default function ({ expose, localDataRef }) {
|
export default function ({ expose, localDataRef }) {
|
||||||
const pageRequest = async ({ page, query }) => {
|
const pageRequest = async ({ page, query }) => {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
import { defineComponent, ref, onMounted } from "vue";
|
import { defineComponent, ref, onMounted } from "vue";
|
||||||
import { dict, useCrud } from "@fast-crud/fast-crud";
|
import { dict, useCrud } from "@fast-crud/fast-crud";
|
||||||
import { useExpose } from "@fast-crud/fast-crud";
|
import { useExpose } from "@fast-crud/fast-crud";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
|
|
||||||
//此处为crudOptions配置
|
//此处为crudOptions配置
|
||||||
const createCrudOptions = function ({ expose }) {
|
const createCrudOptions = function ({ expose }) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import * as api from "./api";
|
|||||||
import { requestForMock } from "/src/api/service";
|
import { requestForMock } from "/src/api/service";
|
||||||
import { dict } from "@fast-crud/fast-crud";
|
import { dict } from "@fast-crud/fast-crud";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
function useSearchRemote() {
|
function useSearchRemote() {
|
||||||
let lastFetchId = 0;
|
let lastFetchId = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
import { defineComponent, ref, onMounted } from "vue";
|
import { defineComponent, ref, onMounted } from "vue";
|
||||||
import { useCrud, useExpose, useColumns } from "@fast-crud/fast-crud";
|
import { useCrud, useExpose, useColumns } from "@fast-crud/fast-crud";
|
||||||
import createCrudOptions from "./crud";
|
import createCrudOptions from "./crud";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "FormCustomForm",
|
name: "FormCustomForm",
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import { defineComponent, ref, onMounted } from "vue";
|
|||||||
import { useCrud, useExpose, useColumns } from "@fast-crud/fast-crud";
|
import { useCrud, useExpose, useColumns } from "@fast-crud/fast-crud";
|
||||||
import createCrudOptions from "./crud";
|
import createCrudOptions from "./crud";
|
||||||
import * as api from "./api";
|
import * as api from "./api";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
import { usePageStore } from "/@/store/modules/page";
|
import { usePageStore } from "/@/store/modules/page";
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
import { defineComponent, ref, onMounted } from "vue";
|
import { defineComponent, ref, onMounted } from "vue";
|
||||||
import { useCrud, useExpose, useColumns } from "@fast-crud/fast-crud";
|
import { useCrud, useExpose, useColumns } from "@fast-crud/fast-crud";
|
||||||
import createCrudOptions from "./crud";
|
import createCrudOptions from "./crud";
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "FormNewPage",
|
name: "FormNewPage",
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
import getEachDeep from "deepdash-es/getEachDeep";
|
import getEachDeep from "deepdash-es/getEachDeep";
|
||||||
const eachDeep = getEachDeep(_);
|
const eachDeep = getEachDeep(_);
|
||||||
import { defineComponent, ref, computed } from "vue";
|
import { defineComponent, ref, computed } from "vue";
|
||||||
|
|||||||
@@ -4,11 +4,6 @@ import visualizer from "rollup-plugin-visualizer";
|
|||||||
import viteCompression from "vite-plugin-compression";
|
import viteCompression from "vite-plugin-compression";
|
||||||
import PurgeIcons from "vite-plugin-purge-icons";
|
import PurgeIcons from "vite-plugin-purge-icons";
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
// import { generateModifyVars } from "./build/modify-vars";
|
|
||||||
// import { configThemePlugin } from "./build/theme-plugin";
|
|
||||||
// import OptimizationPersist from "vite-plugin-optimize-persist";
|
|
||||||
// import PkgConfig from "vite-plugin-package-config";
|
|
||||||
// https://vitejs.dev/config/
|
|
||||||
// 增加环境变量 _
|
// 增加环境变量 _
|
||||||
process.env.VITE_APP_VERSION = require("./package.json").version;
|
process.env.VITE_APP_VERSION = require("./package.json").version;
|
||||||
process.env.VITE_APP_BUILD_TIME = require("dayjs")().format("YYYY-M-D HH:mm:ss");
|
process.env.VITE_APP_BUILD_TIME = require("dayjs")().format("YYYY-M-D HH:mm:ss");
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
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.1.2](https://github.com/fast-crud/fast-server-js/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/ui-server
|
||||||
|
|
||||||
## [1.1.1](https://github.com/fast-crud/fast-server-js/compare/v1.1.0...v1.1.1) (2023-06-28)
|
## [1.1.1](https://github.com/fast-crud/fast-server-js/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
**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.1.1",
|
"version": "1.1.2",
|
||||||
"description": "fast-server base midway",
|
"description": "fast-server base midway",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -21,15 +21,15 @@
|
|||||||
"mig": "typeorm migration:create -n name"
|
"mig": "typeorm migration:create -n name"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/acme-client": "^1.1.1",
|
"@certd/acme-client": "^1.1.2",
|
||||||
"@certd/pipeline": "^1.1.1",
|
"@certd/pipeline": "^1.1.2",
|
||||||
"@certd/plugin-aliyun": "^1.1.1",
|
"@certd/plugin-aliyun": "^1.1.2",
|
||||||
"@certd/plugin-all": "^1.1.1",
|
"@certd/plugin-all": "^1.1.2",
|
||||||
"@certd/plugin-cert": "^1.1.1",
|
"@certd/plugin-cert": "^1.1.2",
|
||||||
"@certd/plugin-host": "^1.1.1",
|
"@certd/plugin-host": "^1.1.2",
|
||||||
"@certd/plugin-huawei": "^1.1.1",
|
"@certd/plugin-huawei": "^1.1.2",
|
||||||
"@certd/plugin-tencent": "^1.1.1",
|
"@certd/plugin-tencent": "^1.1.2",
|
||||||
"@certd/plugin-util": "^1.1.1",
|
"@certd/plugin-util": "^1.1.2",
|
||||||
"@koa/cors": "^3.4.3",
|
"@koa/cors": "^3.4.3",
|
||||||
"@midwayjs/bootstrap": "^3.9.1",
|
"@midwayjs/bootstrap": "^3.9.1",
|
||||||
"@midwayjs/cache": "^3.9.0",
|
"@midwayjs/cache": "^3.9.0",
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ const development = {
|
|||||||
port: 7001,
|
port: 7001,
|
||||||
},
|
},
|
||||||
staticFile: {
|
staticFile: {
|
||||||
|
usePrecompiledGzip: true,
|
||||||
|
buffer: true,
|
||||||
|
maxAge: 60 * 60 * 24 * 30 * 1000,
|
||||||
|
gzip: true,
|
||||||
dirs: {
|
dirs: {
|
||||||
default: {
|
default: {
|
||||||
prefix: '/',
|
prefix: '/',
|
||||||
@@ -68,7 +72,7 @@ const development = {
|
|||||||
auth: {
|
auth: {
|
||||||
jwt: {
|
jwt: {
|
||||||
secret: 'certd666',
|
secret: 'certd666',
|
||||||
expire: 7 * 24 * 60, //单位秒
|
expire: 7 * 24 * 60 * 60, //单位秒
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
certd: {
|
certd: {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { PreviewMiddleware } from './middleware/preview';
|
|||||||
import { AuthorityMiddleware } from './middleware/authority';
|
import { AuthorityMiddleware } from './middleware/authority';
|
||||||
import * as staticFile from '@midwayjs/static-file';
|
import * as staticFile from '@midwayjs/static-file';
|
||||||
import * as cron from './plugins/cron';
|
import * as cron from './plugins/cron';
|
||||||
|
import { logger } from './utils/logger';
|
||||||
|
|
||||||
@Configuration({
|
@Configuration({
|
||||||
imports: [koa, orm, cache, flyway, validateComp, cron, staticFile],
|
imports: [koa, orm, cache, flyway, validateComp, cron, staticFile],
|
||||||
@@ -54,5 +55,7 @@ export class ContainerLifeCycle {
|
|||||||
//授权处理
|
//授权处理
|
||||||
AuthorityMiddleware,
|
AuthorityMiddleware,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
logger.info('当前环境:', this.app.getEnv()); // prod
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
import { Controller, Get, Provide } from '@midwayjs/decorator';
|
import { MidwayEnvironmentService } from '@midwayjs/core';
|
||||||
|
import { Controller, Get, Inject, Provide } from '@midwayjs/decorator';
|
||||||
|
import { logger } from '../utils/logger';
|
||||||
|
import { Constants } from '../basic/constants';
|
||||||
|
|
||||||
@Provide()
|
@Provide()
|
||||||
@Controller('/hello')
|
@Controller('/hello')
|
||||||
export class HomeController {
|
export class HomeController {
|
||||||
@Get('/')
|
@Inject()
|
||||||
|
environmentService: MidwayEnvironmentService;
|
||||||
|
@Get('/', { summary: Constants.per.guest })
|
||||||
async home(): Promise<string> {
|
async home(): Promise<string> {
|
||||||
|
logger.info('当前环境:', this.environmentService.getCurrentEnvironment()); // prod
|
||||||
return 'Hello Midwayjs!';
|
return 'Hello Midwayjs!';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,4 +142,17 @@ export class UserService extends BaseService<UserEntity> {
|
|||||||
delete newUser.password;
|
delete newUser.password;
|
||||||
return newUser;
|
return newUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async changePassword(userId: any, form: any) {
|
||||||
|
const user = await this.info(userId);
|
||||||
|
if (!this.checkPassword(form.password, user.password)) {
|
||||||
|
throw new CommonException('原密码错误');
|
||||||
|
}
|
||||||
|
const param = {
|
||||||
|
id: userId,
|
||||||
|
password: form.newPassword,
|
||||||
|
};
|
||||||
|
|
||||||
|
await this.update(param);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import {
|
||||||
|
ALL,
|
||||||
|
Body,
|
||||||
|
Controller,
|
||||||
|
Inject,
|
||||||
|
Post,
|
||||||
|
Provide,
|
||||||
|
} from '@midwayjs/decorator';
|
||||||
|
import { BaseController } from '../../../basic/base-controller';
|
||||||
|
import { Constants } from '../../../basic/constants';
|
||||||
|
import { UserService } from '../../authority/service/user-service';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
@Provide()
|
||||||
|
@Controller('/api/mine')
|
||||||
|
export class MineController extends BaseController {
|
||||||
|
@Inject()
|
||||||
|
userService: UserService;
|
||||||
|
@Post('/info', { summary: Constants.per.authOnly })
|
||||||
|
public async info() {
|
||||||
|
const userId = this.getUserId();
|
||||||
|
const user = await this.userService.info(userId);
|
||||||
|
delete user.password;
|
||||||
|
return this.ok(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Post('/changePassword', { summary: Constants.per.authOnly })
|
||||||
|
public async changePassword(@Body(ALL) body: any) {
|
||||||
|
const userId = this.getUserId();
|
||||||
|
await this.userService.changePassword(userId, body);
|
||||||
|
return this.ok({});
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user