mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 19:35:50 +00:00
perf: 优化与离职账号聊天
This commit is contained in:
parent
aa1ea41c5d
commit
4f57b195a8
@ -222,10 +222,14 @@ class User extends AbstractModel
|
||||
|
||||
/**
|
||||
* 返回是否禁用帐号(离职)
|
||||
* @param bool $incAt 是否包含禁用时间
|
||||
* @return bool
|
||||
*/
|
||||
public function isDisable()
|
||||
public function isDisable($incAt = false)
|
||||
{
|
||||
if ($incAt) {
|
||||
return in_array('disable', $this->identity) || $this->disable_at;
|
||||
}
|
||||
return in_array('disable', $this->identity);
|
||||
}
|
||||
|
||||
|
||||
@ -291,6 +291,7 @@ class WebSocketDialog extends AbstractModel
|
||||
$data['email'] = $basic->email;
|
||||
$data['userimg'] = $basic->userimg;
|
||||
$data['bot'] = $basic->getBotOwner();
|
||||
$data['is_disable'] = $basic->isDisable(true);
|
||||
$data['quick_msgs'] = UserBot::quickMsgs($basic->email);
|
||||
} else {
|
||||
$data['name'] = 'non-existent';
|
||||
|
||||
@ -260,6 +260,9 @@
|
||||
<div v-if="isMute" class="chat-mute">
|
||||
{{$L('禁言发言')}}
|
||||
</div>
|
||||
<div v-else-if="isDisable" class="chat-mute">
|
||||
{{$L('此账号已停用')}}
|
||||
</div>
|
||||
<ChatInput
|
||||
v-else
|
||||
ref="input"
|
||||
@ -1126,6 +1129,10 @@ export default {
|
||||
return false
|
||||
},
|
||||
|
||||
isDisable() {
|
||||
return this.dialogData.is_disable ?? false
|
||||
},
|
||||
|
||||
quoteId() {
|
||||
if (this.msgId > 0) {
|
||||
return this.msgId
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user