登录页面和文件打开方式

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

@@ -475,6 +475,7 @@
uploadCloudDbFile,
deleteCloudDb
} from '@/utils/cloud-api.js';
import { openFile as openFileNative } from '@/utils/fileOpener.js'
const userToken = ref('');
const userId = ref('');
@@ -826,19 +827,10 @@
}
};
// 使用系统默认应用打开
// 打开文件(弹出应用选择菜单)
const openFile = (filePath) => {
uni.openDocument({
filePath: filePath,
success: () => uni.showToast({
title: '打开成功',
icon: 'success'
}),
fail: (err) => {
console.error('打开文件失败:', err);
// 如果默认应用打开失败,尝试弹出选择菜单
openFileWithMenu(filePath);
}
openFileNative(filePath, () => {
openFileWithMenu(filePath);
});
};