From bc58bb9f45bfa3390561467c6c04347864d57e18 Mon Sep 17 00:00:00 2001 From: xiaoguang Date: Wed, 11 May 2022 10:10:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=B5=84=E6=96=99=E7=BB=84=E4=BB=B6=E6=96=B9=E6=B3=95=E5=91=BD?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/UiConfirm.vue | 6 +++--- pages/account/index/userInfo.vue | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/components/UiConfirm.vue b/components/UiConfirm.vue index c6369dc..db3f225 100644 --- a/components/UiConfirm.vue +++ b/components/UiConfirm.vue @@ -12,7 +12,7 @@ @@ -43,8 +43,8 @@ export default { }, }, methods: { - onEnsure() { - this.$emit("ensure"); + onConfirm() { + this.$emit("confirm"); this.visible = false; }, }, diff --git a/pages/account/index/userInfo.vue b/pages/account/index/userInfo.vue index f011134..184c3b8 100644 --- a/pages/account/index/userInfo.vue +++ b/pages/account/index/userInfo.vue @@ -28,8 +28,8 @@ :action="ossUploadUrl" :data="uploadData" :show-file-list="false" - :on-success="handleAvatarSuccess" - :before-upload="handleBeforeLoad" + :on-success="handleUploadSuccess" + :before-upload="handleBeforeUpload" > 修改头像 @@ -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() {