新增
This commit is contained in:
@@ -50,13 +50,23 @@ class LoginController extends BaseAdminController
|
||||
$agentId = env('work_wechat.agent_id', '');
|
||||
|
||||
if (empty($corpId) || empty($agentId)) {
|
||||
return $this->data(['enabled' => false]);
|
||||
return $this->data([
|
||||
'enabled' => false,
|
||||
'require_bind_nonroot' => false,
|
||||
'force_bind_login' => LoginLogic::isForceBindWorkWechatFromEnv(),
|
||||
]);
|
||||
}
|
||||
|
||||
$oauthOk = LoginLogic::isWorkWechatOAuthConfigured();
|
||||
$forceBind = LoginLogic::isForceBindWorkWechatFromEnv();
|
||||
|
||||
return $this->data([
|
||||
'enabled' => true,
|
||||
'corp_id' => $corpId,
|
||||
'agent_id' => $agentId,
|
||||
/** 与 .env FORCE_BIND_LOGIN 一致:为 true 且 OAuth 配全时非 root 须先绑定 */
|
||||
'require_bind_nonroot' => $forceBind && $oauthOk,
|
||||
'force_bind_login' => $forceBind,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user