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"> <div v-if="showIcon" :class="['avatar-box', userId === userid || user.online ? 'online' : '']" :style="boxStyle">
<em :style="spotStyle"></em> <em :style="spotStyle"></em>
<EAvatar v-if="showImg" :class="{'avatar-default':isDefault}" :src="user.userimg" :size="avatarSize" @error="onError"> <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>
<EAvatar v-else :size="avatarSize" class="avatar-text"> <EAvatar v-else :size="avatarSize" class="avatar-text">
<span :style="spotStyle">{{nickname}}</span> <span class="avatar-char" :style="spotStyle">{{nickname}}</span>
</EAvatar> </EAvatar>
</div> </div>
<div v-if="showName" class="avatar-name" :style="nameStyle">{{user.nickname}}</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) => { params.success = (result, status, xhr) => {
if (!$A.isJson(result)) { if (!$A.isJson(result)) {
console.log(result, status, xhr); console.log(result, status, xhr);
reject({data: {}, msg: "Return error"}) reject({ret: -1, data: {}, msg: "Return error"})
return; return;
} }
const {ret, data, msg} = result; const {ret, data, msg} = result;
@ -56,14 +56,14 @@ export default {
checkNick: false checkNick: false
})).then(resolve).catch(reject); })).then(resolve).catch(reject);
}).catch(() => { }).catch(() => {
reject({data, msg: $A.L('请设置昵称!')}) reject({ret: -1, data, msg: $A.L('请设置昵称!')})
}); });
return; return;
} }
if (ret === 1) { if (ret === 1) {
resolve({data, msg}); resolve({data, msg});
} else { } else {
reject({data, msg: msg || "Unknown error"}) reject({ret, data, msg: msg || "Unknown error"})
// //
if (ret === -4001) { if (ret === -4001) {
dispatch("forgetProject", data.project_id); dispatch("forgetProject", data.project_id);
@ -76,9 +76,9 @@ export default {
}; };
params.error = (xhr, status) => { params.error = (xhr, status) => {
if (window.navigator.onLine === false || (status === 0 && xhr.readyState === 4)) { if (window.navigator.onLine === false || (status === 0 && xhr.readyState === 4)) {
reject({data: {}, msg: $A.L('网络异常,请稍后再试!')}) reject({ret: -1, data: {}, msg: $A.L('网络异常,请稍后再试!')})
} else { } else {
reject({data: {}, msg: "System error"}) reject({ret: -1, data: {}, msg: "System error"})
} }
}; };
// //

View File

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

View File

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