Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Nov 24, 2024
1 parent a813809 commit e983677
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 81 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function login()
return $retError('帐号或密码错误');
}
//
if (in_array('disable', $user->identity)) {
if ($user->isDisable()) {
return $retError('帐号已停用...');
}
Cache::forget("code::" . $email);
Expand Down Expand Up @@ -928,7 +928,7 @@ public function operation()
if ($transferUser->userid === $userInfo->userid) {
return Base::retError('不能移交给自己');
}
if (in_array('disable', $transferUser->identity)) {
if ($transferUser->isDisable()) {
return Base::retError('交接人已离职,请选择另一个交接人');
}
break;
Expand Down
52 changes: 31 additions & 21 deletions app/Http/Controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Redirect;
use Response;
use App\Models\File;
use App\Models\User;
use App\Models\UserTransfer;
use App\Module\Doo;
use App\Module\Base;
Expand Down Expand Up @@ -261,27 +262,6 @@ public function crontab()
return "success";
}

/**
* 迁移辅助路由
* @return array
*/
public function migration__userdialog()
{
if (Request::header('app-key') !== env('APP_KEY')) {
return Base::retError("key error");
}
go(function() {
Coroutine::sleep(3);
UserTransfer::orderBy('id')->chunkById(10, function ($transfers) {
/** @var UserTransfer $transfer */
foreach ($transfers as $transfer) {
$transfer->exitDialog();
}
});
});
return Base::retSuccess('success');
}

/**
* 桌面客户端发布
*/
Expand Down Expand Up @@ -520,6 +500,36 @@ public function online__preview()
return Redirect::to($redirectUrl, 301);
}

/**
* 修复操作离职后续操作(todo 临时,后期删除)
* @return array
*/
public function migration__userdialog()
{
if (Request::header('app-key') !== env('APP_KEY')) {
return Base::retError("key error");
}
go(function() {
Coroutine::sleep(3);
$handled = [];
UserTransfer::orderBy('id')->chunkById(10, function ($transfers) use ($handled) {
/** @var UserTransfer $transfer */
foreach ($transfers as $transfer) {
if (in_array($transfer->original_userid, $handled)) {
continue;
}
$handled[] = $transfer->original_userid;
//
$user = User::find($transfer->original_userid);
if ($user?->isDisable()) {
$transfer->exitDialog();
}
}
});
});
return Base::retSuccess('success');
}

/**
* 保存配置 (todo 已废弃)
* @return string
Expand Down
2 changes: 1 addition & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ public static function auth($identity = null)
throw new ApiException('请登录后继续...', [], -1);
}
}
if (in_array('disable', $user->identity)) {
if ($user->isDisable()) {
throw new ApiException('帐号已停用...', [], -1);
}
if ($identity) {
Expand Down
2 changes: 1 addition & 1 deletion app/Models/WebSocketDialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function dialogUser(): \Illuminate\Database\Eloquent\Relations\HasMany
}

/**
* 获取对话成员(剔除离职
* 获取对话成员(连表查
* @param $addField
* @return User|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder
*/
Expand Down

This file was deleted.

3 changes: 2 additions & 1 deletion language/original-web.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ ID、名称、描述...
添加协助人员
点击加入会议
点击复制链接
自动归档任务
获取会话失败
请输入昵称!
请输入验证码
Expand Down Expand Up @@ -1825,3 +1824,5 @@ WiFi签到延迟时长为±1分钟。

今天下班前
明天下班前

自动归档
12 changes: 0 additions & 12 deletions language/translate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3659,18 +3659,6 @@
"id": "Klik untuk menyalin tautan",
"ru": "Нажмите, чтобы скопировать ссылку"
},
{
"key": "自动归档任务",
"zh": "",
"zh-CHT": "自動歸檔任務",
"en": "Automatically archive tasks",
"ko": "작업 자동 보관",
"ja": "タスクを自動アーカイブ",
"de": "Aufgaben automatisch archivieren",
"fr": "Archiver automatiquement les tâches",
"id": "Arsipkan tugas secara otomatis",
"ru": "Автоматически архивировать задачи"
},
{
"key": "请输入昵称!",
"zh": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@
</RadioGroup>
<div v-if="formDatum.project_invite == 'open'" class="form-tip">{{$L('开启:项目管理员可生成链接邀请成员加入项目。')}}</div>
</FormItem>
<FormItem :label="$L('自动归档任务')" prop="autoArchived">
</div>
</div>
<div class="block-setting-box">
<h3>{{ $L('任务相关') }}</h3>
<div class="form-box">
<FormItem :label="$L('自动归档')" prop="autoArchived">
<RadioGroup :value="formDatum.auto_archived" @on-change="formArchived">
<Radio label="open">{{$L('开启')}}</Radio>
<Radio label="close">{{$L('关闭')}}</Radio>
Expand All @@ -90,11 +95,6 @@
<div slot="content">{{$L('任务完成 (*) 天后自动归档。', formDatum.archived_day)}}</div>
</ETooltip>
</FormItem>
</div>
</div>
<div class="block-setting-box">
<h3>{{ $L('任务相关') }}</h3>
<div class="form-box">
<FormItem :label="$L('可见性选项')" prop="taskVisible">
<RadioGroup v-model="formDatum.task_visible">
<Radio label="open">{{$L('保持')}}</Radio>
Expand Down
2 changes: 1 addition & 1 deletion resources/mobile

0 comments on commit e983677

Please sign in to comment.