feat: 修改用户资料组件方法命名

merge-requests/16/head
xiaoguang 3 years ago
parent e64e06e1b9
commit bc58bb9f45

@ -12,7 +12,7 @@
</div>
<div class="dialog-footer flex flex-between">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button class="dialog-footer__btn--ensure" @click="onEnsure"
<el-button class="dialog-footer__btn--ensure" @click="onConfirm"
>确认</el-button
>
</div>
@ -43,8 +43,8 @@ export default {
},
},
methods: {
onEnsure() {
this.$emit("ensure");
onConfirm() {
this.$emit("confirm");
this.visible = false;
},
},

@ -28,8 +28,8 @@
:action="ossUploadUrl"
:data="uploadData"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="handleBeforeLoad"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
>
<el-button>修改头像</el-button>
</el-upload>
@ -90,7 +90,7 @@ export default {
},
created() {
this.initData();
this.getOssUrl();
this.getOssConfig();
},
methods: {
initData() {
@ -103,7 +103,7 @@ export default {
});
}
},
async getOssUrl() {
async getOssConfig() {
const { result } = await ApiPostGetOssConfig({
configId: "account-avatar/",
serviceName: "uc",
@ -122,14 +122,14 @@ export default {
},
//
handleBeforeLoad(file) {
handleBeforeUpload(file) {
this.fileName = file.name;
Object.assign(this.uploadData, {
key: `${this.ossDirName}${"${filename}"}`,
name: file.name,
});
},
handleAvatarSuccess() {
handleUploadSuccess() {
this.form.avatar = `${this.ossUploadUrl}/${this.ossDirName}${this.fileName}`;
},
onSubmit() {

Loading…
Cancel
Save