提交 a38d9a0a 编写于 作者: 雪洛's avatar 雪洛

feat: h5 getFileInfo

上级 a6fbb25e
......@@ -9,7 +9,6 @@ export default [
'getSavedFileList',
'getSavedFileInfo',
'removeSavedFileInfo',
'getFileInfo',
'onMemoryWarning',
'onGyroscopeChange',
'startGyroscope',
......
import {
urlToFile
} from 'uni-platform/helpers/file'
const {
invokeCallbackHandler: invoke
} = UniServiceJSBridge
export function getFileInfo ({
filePath
} = {}, callbackId) {
// TODO 计算文件摘要
urlToFile(filePath).then((res) => {
invoke(callbackId, {
errMsg: 'getFileInfo:ok',
size: res.size
})
}).catch((err) => {
invoke(callbackId, {
errMsg: 'getFileInfo:fail 文件[' +
filePath +
'] getFileInfo 失败:' + err.message
})
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册