mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-15 09:48:14 +08:00
🐛 修复导出路径异常
This commit is contained in:
@@ -909,19 +909,16 @@ class TGClient {
|
|||||||
var buffer = new Uint8Array(atob('${image}'.split(',')[1]).split('').map(function(item) {
|
var buffer = new Uint8Array(atob('${image}'.split(',')[1]).split('').map(function(item) {
|
||||||
return item.charCodeAt(0);
|
return item.charCodeAt(0);
|
||||||
}));
|
}));
|
||||||
var _t = window.__TAURI__;
|
var _path = window.__TAURI__.path;
|
||||||
var savePath = await _t.path.downloadDir() + Date.now() + '.png';
|
var saveDefault = await _path.downloadDir() + _path.sep() + Date.now() + ".png";
|
||||||
var save = await _t.dialog.save({
|
var savePath = await window.__TAURI_PLUGIN_DIALOG__.save({
|
||||||
title: '保存图片',
|
title: "保存图片",
|
||||||
filters: [{ name: '图片', extensions: ['png'] }],
|
filters: [{ name: "图片", extensions: ["png"] }],
|
||||||
defaultPath: savePath,
|
defaultPath: saveDefault,
|
||||||
});
|
});
|
||||||
if (save) {
|
if (savePath !== null) {
|
||||||
await _t.fs.writeBinaryFile({
|
await window.__TAURI_PLUGIN_FS__.writeFile(savePath, buffer);
|
||||||
contents: buffer,
|
alert("保存成功");
|
||||||
path: save,
|
|
||||||
});
|
|
||||||
alert('保存成功');
|
|
||||||
}
|
}
|
||||||
mhyWebBridge('${arg.callback}', {});
|
mhyWebBridge('${arg.callback}', {});
|
||||||
})();`;
|
})();`;
|
||||||
|
|||||||
Reference in New Issue
Block a user