diff --git a/src/api/modules/system.ts b/src/api/modules/system.ts index ecb07c0..2305dfb 100644 --- a/src/api/modules/system.ts +++ b/src/api/modules/system.ts @@ -168,4 +168,11 @@ export const upadteTaskData = data => { return http.request("post", "/adminapi/Tasks/task_open", { data }); +} + +// 二级密码校验 +export const checkPassWord = data => { + return http.request("post", "/adminapi/SysSet/check_second_pwd", { + data + }); } \ No newline at end of file diff --git a/src/views/Financial/Withdrawal/form.vue b/src/views/Financial/Withdrawal/form.vue index 7b69dda..5706103 100644 --- a/src/views/Financial/Withdrawal/form.vue +++ b/src/views/Financial/Withdrawal/form.vue @@ -45,14 +45,8 @@ defineExpose({ getRef }); - - + + diff --git a/src/views/Financial/Withdrawal/hook.tsx b/src/views/Financial/Withdrawal/hook.tsx index 6109ed5..0bd6439 100644 --- a/src/views/Financial/Withdrawal/hook.tsx +++ b/src/views/Financial/Withdrawal/hook.tsx @@ -106,18 +106,18 @@ export function useData() { label: "支付宝/微信账号", prop: "alipay_account" }, - { - label: "微信账号", - prop: "coin" - }, - { - label: "所属银行", - prop: "bank_card" - }, - { - label: "开户行", - prop: "open_bank" - }, + // { + // label: "微信账号", + // prop: "coin" + // }, + // { + // label: "所属银行", + // prop: "bank_card" + // }, + // { + // label: "开户行", + // prop: "open_bank" + // }, { label: "银行卡号", prop: "bank_card_number" @@ -137,7 +137,6 @@ export function useData() { { label: "操作", fixed: "right", - width: 210, slot: "operation" } ]); diff --git a/src/views/system/private/form.vue b/src/views/system/private/form.vue new file mode 100644 index 0000000..2838cf1 --- /dev/null +++ b/src/views/system/private/form.vue @@ -0,0 +1,27 @@ + + + diff --git a/src/views/system/private/hook.tsx b/src/views/system/private/hook.tsx index 469cbaa..5ce2586 100644 --- a/src/views/system/private/hook.tsx +++ b/src/views/system/private/hook.tsx @@ -1,10 +1,12 @@ import { ref, h } from "vue"; import { message } from "@/utils/message"; +import editForm from "./form.vue"; import { ElMessageBox } from "element-plus"; import { getConfigTypeList, getConfigSetInfo, - SetConfigData + SetConfigData, + checkPassWord } from "@/api/modules/system"; import { addDialog } from "@/components/ReDialog"; export function useData() { @@ -36,33 +38,76 @@ export function useData() { }) } } - console.log(formData.value) + } const tabClick = (event) => { const { name } = event.props getInfo(name) } + const saveConfigEvent = async () => { + const { code, msg } = await SetConfigData({ + ...formData.value, + type: activeId.value + }) + if (code) { + message("操作成功", { type: "success" }); + getInfo(activeId.value) + } else { + message(msg, { type: "error" }); + } + } const saveConfig = async () => { - ElMessageBox.confirm( - `该操作将覆盖之前的数据,是否继续?`, - "提示", - { - type: "warning" - } - ) - .then(async () => { - const { code, msg } = await SetConfigData({ - ...formData.value, - type: activeId.value - }) - if (code) { - message("操作成功", { type: "success" }); - getInfo(activeId.value) - } else { - message(msg, { type: "error" }); + // 输入二级密码 + addDialog({ + title: `输入二级密码`, + width: "40%", + props: { + formInline: { + password: "" } - }) - .catch(() => { }); + }, + closeOnClickModal: false, + contentRenderer: () => h(editForm, { ref: formRef, formInline: null }), + beforeSure: (done, { options }) => { + const FormRef = formRef.value.getRef(); + const curData = options.props.formInline; + const saveData = async form => { + const { data, code, msg } = await checkPassWord(form) + if (code) { + saveConfigEvent() + done() + } else { + message(msg, { type: "error" }); + } + + }; + FormRef.validate(valid => { + if (valid) { + saveData(curData); + } + }); + } + }); + // ElMessageBox.confirm( + // `该操作将覆盖之前的数据,是否继续?`, + // "提示", + // { + // type: "warning" + // } + // ) + // .then(async () => { + // const { code, msg } = await SetConfigData({ + // ...formData.value, + // type: activeId.value + // }) + // if (code) { + // message("操作成功", { type: "success" }); + // getInfo(activeId.value) + // } else { + // message(msg, { type: "error" }); + // } + // }) + // .catch(() => { }); } return { onSearch,