提交 cd662f71 编写于 作者: A Anne_LXM

通过点号操作符访问 UTSJSONObject 中的数据报错改为下标方式

上级 29bd0ac5
...@@ -147,8 +147,6 @@ ...@@ -147,8 +147,6 @@
if (tempFilePath == null) { if (tempFilePath == null) {
tempFilePath = "" tempFilePath = ""
} }
// console.log('tempFileName',tempFileName);
// console.log('tempFilePath',tempFilePath);
let avatar_file = { let avatar_file = {
// #ifdef WEB // #ifdef WEB
extname: tempFileName.split(".")[tempFileName.split(".").length - 1], extname: tempFileName.split(".")[tempFileName.split(".").length - 1],
...@@ -192,20 +190,17 @@ ...@@ -192,20 +190,17 @@
// _id = "" as string // _id = "" as string
// } // }
let cloudPath = _id + '' + Date.now() let cloudPath = _id + '' + Date.now()
avatar_file.name = cloudPath avatar_file['name'] = cloudPath
uni.showLoading({ uni.showLoading({
title: "更新中", title: "更新中",
mask: true mask: true
}); });
// console.log('filePath', filePath);
uniCloud.uploadFile({ uniCloud.uploadFile({
filePath, filePath,
cloudPath, cloudPath,
}) })
.then(function (res) { .then(function (res) {
// console.log('res', res); avatar_file['url'] = res.fileID
avatar_file.url = res.fileID
// console.log('avatar_file111', avatar_file);
mutations.updateUserInfo({ avatar_file } as UTSJSONObject) mutations.updateUserInfo({ avatar_file } as UTSJSONObject)
}) })
.catch(function (err : any | null) { .catch(function (err : any | null) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册