27
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
</view>
|
||||
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
<c-cut-avatar ref="cutAvatar" @save="saveAvatar" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -60,6 +61,7 @@
|
||||
import GroupMemberRow from "./components/GroupMemberRow.vue";
|
||||
import {getPurePath} from "@/util/common";
|
||||
import util from "@/util/index.js"
|
||||
import {upload} from "@/api/login.js";
|
||||
|
||||
const ConfirmTypes = {
|
||||
Dismiss: "Dismiss",
|
||||
@@ -273,6 +275,22 @@
|
||||
console.log(e);
|
||||
})
|
||||
},
|
||||
saveAvatar(e){
|
||||
if (!this.isAdmin && !this.isOwner) {
|
||||
return;
|
||||
}
|
||||
this.tempFilePath = e.path;
|
||||
upload(e.path,{
|
||||
'url':"/group/avatar",
|
||||
savePath: "groupavatar",
|
||||
groupID: this.storeCurrentConversation.groupID,
|
||||
}).then((res) => {
|
||||
console.log("上传成功",res);
|
||||
//userStore.selfInfo.faceURL = res.data.faceURL;
|
||||
}).catch((res1) => {
|
||||
console.log("上传失败",res1);
|
||||
});
|
||||
},
|
||||
updateGroupAvatar() {
|
||||
if (!this.isAdmin && !this.isOwner) {
|
||||
return;
|
||||
@@ -285,6 +303,8 @@
|
||||
tempFilePaths
|
||||
}) => {
|
||||
const path = tempFilePaths[0];
|
||||
this.$refs.cutAvatar.enterEditor(path);
|
||||
return ;
|
||||
const nameIdx = path.lastIndexOf("/") + 1;
|
||||
const typeIdx = path.lastIndexOf(".") + 1;
|
||||
const fileName = path.slice(nameIdx);
|
||||
|
||||
Reference in New Issue
Block a user