diff --git a/frontend/src/components/builtin/EditFileName.vue b/frontend/src/components/builtin/EditFileName.vue
index 07abd7e..ad80ccc 100644
--- a/frontend/src/components/builtin/EditFileName.vue
+++ b/frontend/src/components/builtin/EditFileName.vue
@@ -17,6 +17,7 @@ import {
useSystem,
OsFileWithoutContent,
} from "@/system";
+import { notifyError } from "@/util/msg";
const browserWindow: BrowserWindow = inject("browserWindow")!;
const name = ref(basename((browserWindow.config.content as OsFileWithoutContent).path));
@@ -29,10 +30,22 @@ function confirm() {
});
return;
}
- const newPath = join(browserWindow.config.content.path, name.value);
+ let oldPath = ''
+ if(browserWindow.config.content?.isShare) {
+ oldPath = browserWindow.config.content.parentPath
+ } else {
+ const temp = browserWindow.config.content.path.split('/')
+ temp.pop()
+ oldPath = temp.join('/')
+ }
+ const newPath = join(oldPath, name.value);
useSystem()
?.fs.rename(browserWindow.config.content.path, newPath)
- .then(() => {
+ .then((res: any) => {
+ if(!res || res.code === -1) {
+ notifyError(res.message || '改名失败')
+ return
+ }
emitEvent("file.props.edit");
browserWindow.emit("file.props.edit", newPath);
browserWindow.close();
diff --git a/frontend/src/components/builtin/FileIcon.vue b/frontend/src/components/builtin/FileIcon.vue
index 25755f5..cec926a 100644
--- a/frontend/src/components/builtin/FileIcon.vue
+++ b/frontend/src/components/builtin/FileIcon.vue
@@ -7,7 +7,7 @@
-
diff --git a/frontend/src/components/builtin/FileList.vue b/frontend/src/components/builtin/FileList.vue
index 9e969c7..9a6dffd 100644
--- a/frontend/src/components/builtin/FileList.vue
+++ b/frontend/src/components/builtin/FileList.vue
@@ -161,7 +161,7 @@ function doubleTouch(e: TouchEvent, item: OsFileWithoutContent) {
const editIndex = ref(-1);
const editName = ref('');
-function onEditNameEnd() {
+async function onEditNameEnd() {
const editEndName = editName.value.trim();
if (editEndName && editIndex.value >= 0) {
const editpath: any = props.fileList[editIndex.value].path.toString()
@@ -174,7 +174,7 @@ function onEditNameEnd() {
newPath.pop()
newPath.push(editEndName)
newPath = newPath.join(sp)
- sys?.fs.rename(
+ await sys?.fs.rename(
editpath,
newPath
);
@@ -384,6 +384,17 @@ function handleRightClick(mouse: MouseEvent, item: OsFileWithoutContent, index:
},
})
}
+ if (!item.isShare) {
+ fileMenus.push({
+ label: t('create.shortcut'),
+ click: () => {
+ createLink(item.path)?.then(() => {
+ chosenIndexs.value = [];
+ props.onRefresh();
+ });
+ },
+ },)
+ }
const userType = sys.getConfig('userType');
if (userType == 'member' && !item.isShare && !item.isDirectory) {
@@ -428,16 +439,6 @@ function handleRightClick(mouse: MouseEvent, item: OsFileWithoutContent, index:
menuArr.push.apply(menuArr, fileMenus)
}
const sysEndMenu = [
-
- {
- label: t('create.shortcut'),
- click: () => {
- createLink(item.path)?.then(() => {
- chosenIndexs.value = [];
- props.onRefresh();
- });
- },
- },
{
label: t('props'),
click: () => {
diff --git a/frontend/src/components/builtin/FileProps.vue b/frontend/src/components/builtin/FileProps.vue
index 86be739..facf440 100644
--- a/frontend/src/components/builtin/FileProps.vue
+++ b/frontend/src/components/builtin/FileProps.vue
@@ -85,8 +85,8 @@ if(path.indexOf('/F') === 0) {
}
// file.value = await useSystem()?.fs.stat(window?.config.content);
function localName(currentPath:T){
- if(isShareFile(path)) {
- const arr = path.split('/')
+ if(isShareFile(path) && file.value && file.value.path) {
+ const arr = file?.value.path.split('/')
const url = '/' + arr[1] + '/' + arr[2] + '/' + arr[arr.length-1]
return arr.length >3 ? url : currentPath
}
@@ -109,7 +109,17 @@ function editFileName() {
resizable: false,
});
win.on("file.props.edit", async (_: string, data: string) => {
- file.value = await useSystem()?.fs.stat(data);
+ //console.log('文件信息:', file.value, data);
+ if(data.indexOf('data/userData') === 0) {
+ const newPathArr = data.split('/')
+ const pathArr = file.value?.path.split('/') || []
+ pathArr.pop()
+ pathArr.push(newPathArr.pop() || '')
+ const shareInfo = await useSystem()?.fs.getShareInfo(pathArr.join('/'))
+ file.value = shareInfo?.fi
+ } else {
+ file.value = await useSystem()?.fs.stat(data);
+ }
});
win.show();
diff --git a/frontend/src/components/chat/ChatUserSetting.vue b/frontend/src/components/chat/ChatUserSetting.vue
index 9be4aa9..dba1730 100644
--- a/frontend/src/components/chat/ChatUserSetting.vue
+++ b/frontend/src/components/chat/ChatUserSetting.vue
@@ -1,29 +1,34 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 保存
-
-
-
-
-
-
+
+ 修改资料
+ 修改密码
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/components/desktop/ScreenContent.vue b/frontend/src/components/desktop/ScreenContent.vue
index f55f0d1..ec0630d 100644
--- a/frontend/src/components/desktop/ScreenContent.vue
+++ b/frontend/src/components/desktop/ScreenContent.vue
@@ -31,6 +31,7 @@ defineProps<{
rootState: RootState;
}>();
onMounted(() => {
+ //console.log('rootState:', RootState.state);
useSystem().rootRef = screenref.value;
});
diff --git a/frontend/src/components/window/IframeFile.vue b/frontend/src/components/window/IframeFile.vue
index 7688b60..0a4a2db 100644
--- a/frontend/src/components/window/IframeFile.vue
+++ b/frontend/src/components/window/IframeFile.vue
@@ -67,7 +67,6 @@ const eventHandler = async (e: MessageEvent) => {
const isWrite = ref(0)
if (isShareFile(path)) {
const file = await sys?.fs.getShareInfo(path)
- console.log('文件信息:',file);
isShare.value = true
isWrite.value = file.fs.is_write
if (!isWrite.value) {
diff --git a/frontend/src/hook/useContextMenu.ts b/frontend/src/hook/useContextMenu.ts
index ec22b8f..d67d6e3 100644
--- a/frontend/src/hook/useContextMenu.ts
+++ b/frontend/src/hook/useContextMenu.ts
@@ -215,6 +215,7 @@ function useContextMenu() {
newPath = fspath.join(parentPath, `${file.title}(${i}).${file.ext}`)
}
}
+
//console.log(newPath)
return system?.fs.rename(file.path, newPath)
diff --git a/frontend/src/system/core/FileOs.ts b/frontend/src/system/core/FileOs.ts
index d0a7d94..4a73968 100644
--- a/frontend/src/system/core/FileOs.ts
+++ b/frontend/src/system/core/FileOs.ts
@@ -2,7 +2,7 @@ import { getFileUrl,fetchGet,fetchPost } from "../config.ts";
const API_BASE_URL = getFileUrl()
import { OsFileMode } from '../core/FileMode';
import { getSystemConfig } from "@/system/config";
-import { turnServePath, turnLocalPath, isRootShare } from "@/util/sharePath.ts";
+import { turnServePath, turnLocalPath, isRootShare, isShareFile } from "@/util/sharePath.ts";
import { OsFile } from "./FileSystem.ts";
// import { notifyError } from "@/util/msg";
export async function handleReadDir(path: any): Promise {
@@ -137,7 +137,17 @@ export async function handleClear(): Promise {
}
export async function handleRename(oldPath: string, newPath: string): Promise {
- const res = await fetchGet(`${API_BASE_URL}/rename?oldPath=${encodeURIComponent(oldPath)}&newPath=${encodeURIComponent(newPath)}`);
+ const url = isShareFile(oldPath) ? 'sharerename' : 'rename'
+ let params = ''
+ if (isShareFile(oldPath)) {
+ const optionID = oldPath.indexOf('/F/myshare') === 0 ? 0 : 1
+ oldPath = turnServePath(oldPath)
+ newPath = turnServePath(newPath)
+ params = `oldpath=${encodeURIComponent(oldPath)}&newpath=${encodeURIComponent(newPath)}&userID=${getSystemConfig()?.userInfo.id}&optionID=${optionID}`
+ } else {
+ params = `oldPath=${encodeURIComponent(oldPath)}&newPath=${encodeURIComponent(newPath)}`
+ }
+ const res = await fetchGet(`${API_BASE_URL}/${url}?${params}`);
if (!res.ok) {
return false;
}
@@ -298,6 +308,8 @@ export const useOsFile = () => {
async getShareInfo(path: string) {
const response = await handleShareDetail(path, getSystemConfig().userInfo.id);
if (response && response.data) {
+ response.data.fi.isShare = true
+ response.data.fi.path = turnLocalPath(response.data.fi.path, path, 1)
return response.data;
}
return [];
@@ -357,7 +369,7 @@ export const useOsFile = () => {
return false;
},
async rename(oldPath: string, newPath: string) {
- const response = await handleRename(turnServePath(oldPath), turnServePath(newPath));
+ const response = await handleRename(oldPath, newPath);
if (response) {
return response;
}