This commit is contained in:
kuaifan 2022-03-30 08:20:41 +08:00
parent cf6b4f5432
commit bec72dfd5f
4 changed files with 18 additions and 20 deletions

View File

@ -17,10 +17,10 @@
<div v-if="showIcon" :class="['avatar-box', userId === userid || user.online ? 'online' : '']" :style="boxStyle">
<em :style="spotStyle"></em>
<EAvatar v-if="showImg" :class="{'avatar-default':isDefault}" :src="user.userimg" :size="avatarSize" @error="onError">
<span :style="spotStyle">{{nickname}}</span>
<span class="avatar-char" :style="spotStyle">{{nickname}}</span>
</EAvatar>
<EAvatar v-else :size="avatarSize" class="avatar-text">
<span :style="spotStyle">{{nickname}}</span>
<span class="avatar-char" :style="spotStyle">{{nickname}}</span>
</EAvatar>
</div>
<div v-if="showName" class="avatar-name" :style="nameStyle">{{user.nickname}}</div>

View File

@ -35,7 +35,7 @@ export default {
params.success = (result, status, xhr) => {
if (!$A.isJson(result)) {
console.log(result, status, xhr);
reject({data: {}, msg: "Return error"})
reject({ret: -1, data: {}, msg: "Return error"})
return;
}
const {ret, data, msg} = result;
@ -56,14 +56,14 @@ export default {
checkNick: false
})).then(resolve).catch(reject);
}).catch(() => {
reject({data, msg: $A.L('请设置昵称!')})
reject({ret: -1, data, msg: $A.L('请设置昵称!')})
});
return;
}
if (ret === 1) {
resolve({data, msg});
} else {
reject({data, msg: msg || "Unknown error"})
reject({ret, data, msg: msg || "Unknown error"})
//
if (ret === -4001) {
dispatch("forgetProject", data.project_id);
@ -76,9 +76,9 @@ export default {
};
params.error = (xhr, status) => {
if (window.navigator.onLine === false || (status === 0 && xhr.readyState === 4)) {
reject({data: {}, msg: $A.L('网络异常,请稍后再试!')})
reject({ret: -1, data: {}, msg: $A.L('网络异常,请稍后再试!')})
} else {
reject({data: {}, msg: "System error"})
reject({ret: -1, data: {}, msg: "System error"})
}
};
//

View File

@ -13,11 +13,11 @@
}
.avatar-text {
background-color: $primary-color;
> span {
display: inline-block;
font-size: 15px;
line-height: 1;
}
}
.avatar-char {
display: inline-block;
font-size: 15px;
line-height: inherit;
}
> em {
position: absolute;

View File

@ -308,12 +308,8 @@
margin-right: 8px;
}
}
.common-avatar {
.el-avatar {
> span {
font-size: 12px;
}
}
.avatar-char {
font-size: 18px;
}
.permission {
padding-left: 6px;
@ -438,7 +434,9 @@
color: #ffffff;
}
}
.avatar-char {
font-size: 18px;
}
}
&.shear {
opacity: 0.38;
@ -615,7 +613,7 @@
}
.page-file-share-list {
max-height: 500px;
margin-bottom: 24px;
margin-bottom: 26px;
> li {
display: flex;
align-items: center;