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

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

Loading…
Cancel
Save