mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 03:01:12 +00:00
Merge branch 'okr' into pro
This commit is contained in:
commit
8dac2bc444
@ -1830,6 +1830,8 @@ class DialogController extends AbstractController
|
||||
*
|
||||
* @apiParam {Number} dialog_id 会话ID
|
||||
* @apiParam {Number} userid 新的群主
|
||||
* @apiParam {String} check_owner 转让验证 yes-需要验证 no-不需要验证
|
||||
* @apiParam {String} key 密钥(APP_KEY)
|
||||
*
|
||||
* @apiSuccess {Number} ret 返回状态码(1正确、0错误)
|
||||
* @apiSuccess {String} msg 返回信息(错误描述)
|
||||
@ -1837,21 +1839,24 @@ class DialogController extends AbstractController
|
||||
*/
|
||||
public function group__transfer()
|
||||
{
|
||||
$user = User::auth();
|
||||
if (!Base::is_internal_ip(Base::getIp()) || Request::input("key") !== env('APP_KEY')) {
|
||||
$user = User::auth();
|
||||
}
|
||||
//
|
||||
$dialog_id = intval(Request::input('dialog_id'));
|
||||
$userid = intval(Request::input('userid'));
|
||||
$check_owner = trim(Request::input('check_owner', 'yes')) === 'yes';
|
||||
//
|
||||
if ($userid === $user->userid) {
|
||||
if ($check_owner && $userid === $user?->userid) {
|
||||
return Base::retError('你已经是群主');
|
||||
}
|
||||
if (!User::whereUserid($userid)->exists()) {
|
||||
return Base::retError('请选择有效的新群主');
|
||||
}
|
||||
//
|
||||
$dialog = WebSocketDialog::checkDialog($dialog_id, true);
|
||||
$dialog = WebSocketDialog::checkDialog($dialog_id, $check_owner);
|
||||
//
|
||||
$dialog->checkGroup('user');
|
||||
$dialog->checkGroup($check_owner ? 'user' : null);
|
||||
$dialog->owner_id = $userid;
|
||||
if ($dialog->save()) {
|
||||
$dialog->joinGroup($userid, 0);
|
||||
@ -1977,7 +1982,7 @@ class DialogController extends AbstractController
|
||||
*/
|
||||
public function okr__push()
|
||||
{
|
||||
if (Request::input("key") !== env('APP_KEY')) {
|
||||
if (!Base::is_internal_ip(Base::getIp()) || Request::input("key") !== env('APP_KEY')) {
|
||||
User::auth();
|
||||
}
|
||||
$text = trim(Request::input('text'));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user