|
|
@ -4,6 +4,7 @@ |
|
|
|
import { getSplit, getSystemConfig } from "@/system/config"; |
|
|
|
import { decodeBase64, isBase64 } from "@/util/file"; |
|
|
|
import { notifyError, notifySuccess } from "@/util/msg"; |
|
|
|
import { isShareFile } from "@/util/sharePath.ts"; |
|
|
|
import { getMdOption } from "@/util/vditor"; |
|
|
|
import { saveAs } from "file-saver"; |
|
|
|
import moment from "moment"; |
|
|
@ -112,20 +113,19 @@ |
|
|
|
} else { |
|
|
|
refreshDesktop = true; |
|
|
|
} |
|
|
|
let res |
|
|
|
if (isShareFile(filepath.value)) { |
|
|
|
const file = await sys?.fs.getShareInfo(filepath.value); |
|
|
|
const isWrite = |
|
|
|
file.fs.sender === getSystemConfig().userInfo.id |
|
|
|
? 1 |
|
|
|
: file.fs.is_write; |
|
|
|
//console.log(path) |
|
|
|
const res = file.fi.isShare |
|
|
|
? await sys?.fs.writeShareFile( |
|
|
|
const isWrite = file.fs.sender === getSystemConfig().userInfo.id ? 1 : file.fs.is_write; |
|
|
|
res = await sys?.fs.writeShareFile( |
|
|
|
filepath.value, |
|
|
|
vditor.value.getValue(), |
|
|
|
isWrite |
|
|
|
) |
|
|
|
: await sys?.fs.writeFile(filepath.value, vditor.value.getValue()); |
|
|
|
if (res.success) { |
|
|
|
} else { |
|
|
|
res = await sys?.fs.writeFile(filepath.value, vditor.value.getValue()); |
|
|
|
} |
|
|
|
if (res && res.code !== -1) { |
|
|
|
notifySuccess(res.message || "保存成功!"); |
|
|
|
} else { |
|
|
|
notifyError(res.message || "保存失败"); |
|
|
|