登录页面和文件打开方式

This commit is contained in:
2026-07-31 16:38:01 +08:00
parent 09f4d3ba52
commit 314a714248
8 changed files with 413 additions and 297 deletions

View File

@@ -121,6 +121,7 @@
workspaceUploadFileByURL,
updateWorkspaceFileName
} from '@/utils/cloud-api.js'
import { openFile as openFileNative } from '@/utils/fileOpener.js'
const UserToken = ref('')
const workspaceId = ref('')
@@ -435,40 +436,10 @@
}
};
// 使用系统默认应用打开
// 打开文件(弹出应用选择菜单)
const openFile = (filePath) => {
uni.openDocument({
filePath: filePath,
success: () => uni.showToast({
title: '打开成功',
icon: 'success'
}),
fail: (err) => {
console.error('打开文件失败:', err);
uni.showToast({
title: '无法打开此文件',
icon: 'error'
});
}
});
};
// 选择其他应用打开
const openFileWithMenu = (filePath) => {
uni.openDocument({
filePath: filePath,
showMenu: true,
success: () => uni.showToast({
title: '打开成功',
icon: 'success'
}),
fail: (err) => {
console.error('打开文件失败:', err);
uni.showToast({
title: '无法打开此文件',
icon: 'error'
});
}
openFileNative(filePath, () => {
uni.showToast({ title: '无法打开此文件', icon: 'error' });
});
};