From cc0657aaa8e5662fc8ce5b8af5d3867d3af703b4 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Sat, 12 Apr 2025 23:59:03 +0800 Subject: [PATCH] =?UTF-8?q?pref:=20=E4=BC=98=E5=8C=96=E6=8F=92=E4=BB=B6sto?= =?UTF-8?q?re?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/basic/src/utils/util.log.ts | 3 + .../src/api/modules/api.user.mock.ts | 31 - packages/ui/certd-client/src/api/service.ts | 24 +- .../certd-client/src/components/editable.vue | 18 +- .../src/components/vip-button/directive.ts | 2 +- .../src/components/vip-button/index.vue | 4 +- .../src/layout/components/footer/index.vue | 2 +- .../src/layout/components/theme/index.vue | 2 +- .../src/layout/components/theme/mode-set.vue | 2 +- .../src/layout/components/user-info/index.vue | 2 +- .../certd-client/src/layout/layout-basic.vue | 4 +- .../src/layout/layout-framework.vue | 4 +- .../src/layout/layout-outside.vue | 2 +- .../src/plugin/fast-crud/index.tsx | 6 +- .../src/plugin/permission/hook.ts | 2 +- packages/ui/certd-client/src/router/guard.ts | 4 +- .../src/router/source/modules/about.tsx | 2 +- .../src/router/source/modules/certd.ts | 2 +- .../src/router/source/modules/sys.ts | 2 +- packages/ui/certd-client/src/store/index.ts | 9 - .../pipeline => store/plugin}/api.plugin.ts | 10 +- .../ui/certd-client/src/store/plugin/index.ts | 161 +++++ .../modules => store/settings}/api.basic.ts | 2 +- .../settings.ts => settings/index.ts} | 6 +- .../{api/modules => store/user}/api.user.ts | 26 +- .../store/{modules/user.ts => user/index.ts} | 16 +- packages/ui/certd-client/src/vben/index.ts | 2 +- .../src/vben/stores/modules/access.ts | 8 +- .../src/vben/stores/modules/lock.ts | 8 +- .../src/vben/stores/modules/user.ts | 6 +- .../src/views/certd/cname/record/crud.tsx | 4 +- .../src/views/certd/history/crud.tsx | 4 +- .../certd/mine/change-password-button.vue | 2 +- .../src/views/certd/monitor/site/crud.tsx | 2 +- .../src/views/certd/monitor/site/index.vue | 2 - .../views/certd/pipeline/cert-upload/use.tsx | 6 +- .../views/certd/pipeline/certd-form/crud.tsx | 5 +- .../views/certd/pipeline/certd-form/index.vue | 102 ++- .../src/views/certd/pipeline/crud.tsx | 4 +- .../src/views/certd/pipeline/detail.vue | 17 +- .../pi-notification-form-email.vue | 4 +- .../component/shortcut/task-shortcuts.vue | 8 +- .../pipeline/component/step-form/index.vue | 624 +++++++++--------- .../pipeline/component/task-form/index.vue | 45 +- .../views/certd/pipeline/pipeline/index.vue | 11 +- .../src/views/certd/pipeline/pipeline/type.ts | 117 +--- .../src/views/certd/pipeline/utils.ts | 2 +- .../src/views/certd/trade/crud.tsx | 4 +- .../views/framework/home/content/index.vue | 2 +- .../src/views/framework/home/dashboard/api.ts | 4 +- .../views/framework/home/dashboard/index.vue | 16 +- .../src/views/framework/home/index.vue | 2 +- .../src/views/framework/login/index.vue | 4 +- .../src/views/framework/register/index.vue | 4 +- .../src/views/sys/account/index.vue | 4 +- .../src/views/sys/authority/user/crud.tsx | 2 +- .../src/views/sys/cname/provider/crud.tsx | 4 +- .../src/views/sys/plugin/crud.tsx | 4 - .../src/views/sys/plugin/edit.vue | 2 + .../src/views/sys/settings/email/index.vue | 26 +- .../views/sys/settings/header-menus/crud.tsx | 2 +- .../views/sys/settings/header-menus/index.vue | 2 +- .../src/views/sys/settings/index.vue | 2 +- .../src/views/sys/settings/tabs/base.vue | 2 +- .../src/views/sys/settings/tabs/register.vue | 2 +- .../certd-client/src/views/sys/site/index.vue | 4 +- .../src/views/sys/suite/setting/index.vue | 2 +- .../src/views/sys/suite/trade/crud.tsx | 4 +- .../modules/plugin/service/plugin-service.ts | 15 +- pnpm-lock.yaml | 82 +-- start.sh | 5 +- 71 files changed, 764 insertions(+), 767 deletions(-) delete mode 100644 packages/ui/certd-client/src/api/modules/api.user.mock.ts delete mode 100644 packages/ui/certd-client/src/store/index.ts rename packages/ui/certd-client/src/{views/certd/pipeline => store/plugin}/api.plugin.ts (83%) create mode 100644 packages/ui/certd-client/src/store/plugin/index.ts rename packages/ui/certd-client/src/{api/modules => store/settings}/api.basic.ts (98%) rename packages/ui/certd-client/src/store/{modules/settings.ts => settings/index.ts} (97%) rename packages/ui/certd-client/src/{api/modules => store/user}/api.user.ts (70%) rename packages/ui/certd-client/src/store/{modules/user.ts => user/index.ts} (94%) diff --git a/packages/core/basic/src/utils/util.log.ts b/packages/core/basic/src/utils/util.log.ts index 0e1ec149..b6dc1de2 100644 --- a/packages/core/basic/src/utils/util.log.ts +++ b/packages/core/basic/src/utils/util.log.ts @@ -38,6 +38,9 @@ export function buildLogger(write: (text: string) => void) { logger.addContext("outputHandler", { write: (text: string) => { for (const item of _secrets) { + if (item == null) { + continue; + } //换成同长度的*号, item可能有多行 const reg = new RegExp(item, "g"); text = text.replaceAll(reg, "*".repeat(item.length)); diff --git a/packages/ui/certd-client/src/api/modules/api.user.mock.ts b/packages/ui/certd-client/src/api/modules/api.user.mock.ts deleted file mode 100644 index 53411901..00000000 --- a/packages/ui/certd-client/src/api/modules/api.user.mock.ts +++ /dev/null @@ -1,31 +0,0 @@ -export default [ - { - path: "/login", - method: "post", - handle() { - return { - code: 0, - msg: "success", - data: { - token: "faker token", - expire: 10000 - } - }; - } - }, - { - path: "/sys/authority/user/mine", - method: "get", - handle() { - return { - code: 0, - msg: "success", - data: { - id: 1, - username: "username", - nickName: "admin" - } - }; - } - } -]; diff --git a/packages/ui/certd-client/src/api/service.ts b/packages/ui/certd-client/src/api/service.ts index f81229e6..0378cce7 100644 --- a/packages/ui/certd-client/src/api/service.ts +++ b/packages/ui/certd-client/src/api/service.ts @@ -1,9 +1,8 @@ import axios from "axios"; import { get } from "lodash-es"; -import Adapter from "axios-mock-adapter"; -import { errorLog, errorCreate, response } from "./tools"; +import { errorLog, errorCreate } from "./tools"; import { env } from "/src/utils/util.env"; -import { useUserStore } from "../store/modules/user"; +import { useUserStore } from "/@/store/user"; /** * @description 创建请求实例 */ @@ -12,8 +11,8 @@ function createService() { const service = axios.create(); // 请求拦截 service.interceptors.request.use( - (config) => config, - (error) => { + config => config, + error => { // 发送失败 console.log(error); return Promise.reject(error); @@ -21,7 +20,7 @@ function createService() { ); // 响应拦截 service.interceptors.response.use( - (response) => { + response => { if (response.config.responseType === "blob") { return response; } @@ -67,7 +66,7 @@ function createService() { } } }, - (error) => { + error => { const status = get(error, "response.status"); switch (status) { case 400: @@ -130,11 +129,11 @@ function createRequestFunction(service: any) { return function (config: any) { const configDefault = { headers: { - "Content-Type": get(config, "headers.Content-Type", "application/json") + "Content-Type": get(config, "headers.Content-Type", "application/json"), }, timeout: 20000, baseURL: env.API, - data: {} + data: {}, }; const userStore = useUserStore(); const token = userStore.getToken; @@ -149,10 +148,3 @@ function createRequestFunction(service: any) { // 用于真实网络请求的实例和请求方法 export const service = createService(); export const request = createRequestFunction(service); - -// 用于模拟网络请求的实例和请求方法 -export const serviceForMock = createService(); -export const requestForMock = createRequestFunction(serviceForMock); - -// 网络请求数据模拟工具 -export const mock = new Adapter(serviceForMock, { delayResponse: 200 }); diff --git a/packages/ui/certd-client/src/components/editable.vue b/packages/ui/certd-client/src/components/editable.vue index 26a47a04..7f6ae803 100644 --- a/packages/ui/certd-client/src/components/editable.vue +++ b/packages/ui/certd-client/src/components/editable.vue @@ -8,7 +8,7 @@
- {{ modelValue }} + {{ modelValue }}
@@ -22,19 +22,19 @@ export default { props: { modelValue: { type: String, - default: "" + default: "", }, input: { - type: Object + type: Object, }, disabled: { type: Boolean, - default: false + default: false, }, hoverShow: { type: Boolean, - default: false - } + default: false, + }, }, emits: ["update:modelValue"], setup(props, ctx) { @@ -44,7 +44,7 @@ export default { () => { return props.modelValue; }, - (value) => { + value => { valueRef.value = value; } ); @@ -66,9 +66,9 @@ export default { isEdit, save, edit, - inputRef + inputRef, }; - } + }, }; diff --git a/packages/ui/certd-client/src/components/vip-button/directive.ts b/packages/ui/certd-client/src/components/vip-button/directive.ts index c502aaaf..2978ef9a 100644 --- a/packages/ui/certd-client/src/components/vip-button/directive.ts +++ b/packages/ui/certd-client/src/components/vip-button/directive.ts @@ -1,5 +1,5 @@ import { notification } from "ant-design-vue"; -import { useSettingStore } from "/@/store/modules/settings"; +import { useSettingStore } from "/@/store/settings"; export default { mounted(el: any, binding: any, vnode: any) { diff --git a/packages/ui/certd-client/src/components/vip-button/index.vue b/packages/ui/certd-client/src/components/vip-button/index.vue index 7c9b0d8e..731aba3c 100644 --- a/packages/ui/certd-client/src/components/vip-button/index.vue +++ b/packages/ui/certd-client/src/components/vip-button/index.vue @@ -16,9 +16,9 @@ import { computed, onMounted, reactive } from "vue"; import dayjs from "dayjs"; import { message, Modal } from "ant-design-vue"; import * as api from "./api"; -import { useSettingStore } from "/@/store/modules/settings"; +import { useSettingStore } from "/@/store/settings"; import { useRouter } from "vue-router"; -import { useUserStore } from "/@/store/modules/user"; +import { useUserStore } from "/@/store/user"; import { mitter } from "/@/utils/util.mitt"; const settingStore = useSettingStore(); diff --git a/packages/ui/certd-client/src/layout/components/footer/index.vue b/packages/ui/certd-client/src/layout/components/footer/index.vue index fec318d0..1644f596 100644 --- a/packages/ui/certd-client/src/layout/components/footer/index.vue +++ b/packages/ui/certd-client/src/layout/components/footer/index.vue @@ -23,7 +23,7 @@ diff --git a/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx b/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx index 29bb0f80..1a967bf8 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx @@ -6,9 +6,9 @@ import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, Edi import { statusUtil } from "/@/views/certd/pipeline/pipeline/utils/util.status"; import { Modal, notification } from "ant-design-vue"; import { env } from "/@/utils/util.env"; -import { useUserStore } from "/@/store/modules/user"; +import { useUserStore } from "/@/store/user"; import dayjs from "dayjs"; -import { useSettingStore } from "/@/store/modules/settings"; +import { useSettingStore } from "/@/store/settings"; import { cloneDeep } from "lodash-es"; import { useModal } from "/@/use/use-modal"; import CertView from "./cert-view.vue"; diff --git a/packages/ui/certd-client/src/views/certd/pipeline/detail.vue b/packages/ui/certd-client/src/views/certd/pipeline/detail.vue index 06ab5ccf..c3beb6b1 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/detail.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/detail.vue @@ -6,23 +6,23 @@