diff --git a/packages/ui/certd-client/src/plugin/directive/comm-show.ts b/packages/ui/certd-client/src/plugin/directive/comm-show.ts new file mode 100644 index 00000000..ce4938aa --- /dev/null +++ b/packages/ui/certd-client/src/plugin/directive/comm-show.ts @@ -0,0 +1,12 @@ +import { useSettingStore } from "/@/store/settings"; + +export default { + mounted(el: any, binding: any, vnode: any) { + const settingStore = useSettingStore(); + const isComm = settingStore.isComm; + const { value } = binding; + if ((value === false && isComm) || (value === true && !isComm)) { + el.parentNode && el.parentNode.removeChild(el); + } + }, +}; diff --git a/packages/ui/certd-client/src/plugin/directive/index.ts b/packages/ui/certd-client/src/plugin/directive/index.ts new file mode 100644 index 00000000..e23116b0 --- /dev/null +++ b/packages/ui/certd-client/src/plugin/directive/index.ts @@ -0,0 +1,8 @@ +import comm from "./comm-show.js"; +const install = function (app: any) { + app.directive("comm", comm); +}; + +export default { + install, +}; diff --git a/packages/ui/certd-client/src/plugin/index.ts b/packages/ui/certd-client/src/plugin/index.ts index 11c6a6aa..8f87fe4a 100644 --- a/packages/ui/certd-client/src/plugin/index.ts +++ b/packages/ui/certd-client/src/plugin/index.ts @@ -4,9 +4,12 @@ import FastCrud from "./fast-crud"; import permission from "./permission"; import { App } from "vue"; import "./validator/index.js"; +import directives from "./directive/index"; + function install(app: App, options: any = {}) { app.use(FastCrud, options); app.use(permission); + app.use(directives); } export default { diff --git a/packages/ui/certd-client/src/views/certd/cname/record/index.vue b/packages/ui/certd-client/src/views/certd/cname/record/index.vue index 4ed382d3..833ba547 100644 --- a/packages/ui/certd-client/src/views/certd/cname/record/index.vue +++ b/packages/ui/certd-client/src/views/certd/cname/record/index.vue @@ -4,7 +4,7 @@
{{ t("certd.cnameRecord") }} - + {{ t("certd.cname_feature_guide") }} diff --git a/packages/ui/certd-client/src/views/framework/forgot-password/index.vue b/packages/ui/certd-client/src/views/framework/forgot-password/index.vue index 7923de31..32b01d29 100644 --- a/packages/ui/certd-client/src/views/framework/forgot-password/index.vue +++ b/packages/ui/certd-client/src/views/framework/forgot-password/index.vue @@ -11,7 +11,7 @@ @finish="handleFinish" @finish-failed="handleFinishFailed" > - + @@ -21,13 +21,7 @@ - + @@ -72,7 +66,7 @@ 找回密码 -
+ @@ -87,7 +81,7 @@ import EmailCode from "/@/views/framework/register/email-code.vue"; import SmsCode from "/@/views/framework/login/sms-code.vue"; import { utils } from "@fast-crud/fast-crud"; import { useUserStore } from "/@/store/user"; - +import { useSettingStore } from "/@/store/settings"; defineOptions({ name: "ForgotPasswordPage", }); @@ -123,6 +117,7 @@ const layout = { const forgotPasswordType = ref(); const userStore = useUserStore(); +const settingStore = useSettingStore(); const formRef = ref(); const imageCodeRef = ref();