fix: 客户端无法下载文件

This commit is contained in:
kuaifan 2022-02-25 00:05:12 +08:00
parent 9d89af37be
commit 81132ecab0

View File

@ -366,7 +366,11 @@
return return
} }
if ($A.Electron) { if ($A.Electron) {
$A.Electron.sendMessage('openExternal', url); $A.Electron.request({action: 'openExternal', url}, () => {
// 成功
}, () => {
// 失败
});
} else { } else {
window.open(url) window.open(url)
} }
@ -422,6 +426,22 @@
} }
if (typeof config === "string") config = {title:config}; if (typeof config === "string") config = {title:config};
let inputId = "modalInput_" + $A.randomString(6); let inputId = "modalInput_" + $A.randomString(6);
const onOk = () => {
if (typeof config.onOk === "function") {
if (config.onOk(config.value, () => {
$A.Modal.remove();
}) === true) {
$A.Modal.remove();
}
} else {
$A.Modal.remove();
}
};
const onCancel = () => {
if (typeof config.onCancel === "function") {
config.onCancel();
}
};
$A.Modal.confirm({ $A.Modal.confirm({
render: (h) => { render: (h) => {
return h('div', [ return h('div', [
@ -441,27 +461,16 @@
on: { on: {
input: (val) => { input: (val) => {
config.value = val; config.value = val;
},
'on-enter': (e) => {
$A(e.target).parents(".ivu-modal-body").find(".ivu-btn-primary").click();
} }
} }
}) })
]) ])
}, },
onOk: () => { onOk,
if (typeof config.onOk === "function") { onCancel,
if (config.onOk(config.value, () => {
$A.Modal.remove();
}) === true) {
$A.Modal.remove();
}
} else {
$A.Modal.remove();
}
},
onCancel: () => {
if (typeof config.onCancel === "function") {
config.onCancel();
}
},
loading: true, loading: true,
okText: $A.L(config.okText || '确定'), okText: $A.L(config.okText || '确定'),
cancelText: $A.L(config.cancelText || '取消'), cancelText: $A.L(config.cancelText || '取消'),