Merge branch 'feature/task1.0.0_xg' into 'feature/task1.0.0'

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

See merge request yanxuan-frontend/shop-pc!16
merge-requests/17/merge
肖广 3 years ago
commit 092f140fb3

@ -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