登录页面和文件打开方式
This commit is contained in:
@@ -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' });
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user