|
@@ -43,7 +43,7 @@
|
|
|
:action="imgOssUrl"
|
|
:action="imgOssUrl"
|
|
|
:headers="imgHeaders"
|
|
:headers="imgHeaders"
|
|
|
:data="imgData"
|
|
:data="imgData"
|
|
|
- :with-credentials="true"
|
|
|
|
|
|
|
+ :with-credentials="false"
|
|
|
:show-file-list="false"
|
|
:show-file-list="false"
|
|
|
:before-upload="beforeAvatarUpload"
|
|
:before-upload="beforeAvatarUpload"
|
|
|
:on-success="handleAvatarSuccess"
|
|
:on-success="handleAvatarSuccess"
|
|
@@ -189,7 +189,7 @@ export default {
|
|
|
mixins: [userMixin],
|
|
mixins: [userMixin],
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- imgOssUrl: null,
|
|
|
|
|
|
|
+ imgOssUrl: '',
|
|
|
imgHeaders: {
|
|
imgHeaders: {
|
|
|
Authorization: ''
|
|
Authorization: ''
|
|
|
},
|
|
},
|
|
@@ -241,7 +241,7 @@ export default {
|
|
|
methods: {
|
|
methods: {
|
|
|
// ****************************************************************************************************************
|
|
// ****************************************************************************************************************
|
|
|
beforeAvatarUpload(file) {
|
|
beforeAvatarUpload(file) {
|
|
|
- if (this.imgOssUrl === null) {
|
|
|
|
|
|
|
+ if (this.imgOssUrl === '') {
|
|
|
this.$message.error('没有可上传的 OSS 地址!')
|
|
this.$message.error('没有可上传的 OSS 地址!')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
@@ -266,7 +266,7 @@ export default {
|
|
|
avatar.uploadId = resData.uploadId
|
|
avatar.uploadId = resData.uploadId
|
|
|
updateAvatar(avatar).then(resp => {
|
|
updateAvatar(avatar).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
if (resp.code === 0) {
|
|
|
- this.loginUser.avatarUrl = resp.data.url
|
|
|
|
|
|
|
+ this.loginUser.avatarUrl = resp.data.avatarUrl
|
|
|
updateAuthedUser(this.loginUser)
|
|
updateAuthedUser(this.loginUser)
|
|
|
} else {
|
|
} else {
|
|
|
this.$notify({
|
|
this.$notify({
|