|
|
@@ -31,9 +31,16 @@ class AdminClass extends BaseClass
|
|
|
//获取平台的超级管理员 ssh 20231005
|
|
|
public static function getPtSuperAdminId()
|
|
|
{
|
|
|
- $adminId = 919;
|
|
|
- if (getenv('YII_ENV') == 'production') {
|
|
|
- $adminId = 4;
|
|
|
+ //如果模拟成别人的账号,就取消超管的能力
|
|
|
+ $simulateKey = 'simulate_admin_id';
|
|
|
+ $simulateId = Yii::$app->redis->executeCommand('GET', [$simulateKey]);
|
|
|
+ if (!empty($simulateId)) {
|
|
|
+ $adminId = 0;
|
|
|
+ } else {
|
|
|
+ $adminId = 919;
|
|
|
+ if (getenv('YII_ENV') == 'production') {
|
|
|
+ $adminId = 4;
|
|
|
+ }
|
|
|
}
|
|
|
return $adminId;
|
|
|
}
|