Просмотр исходного кода

Merge branch 'master' into dev

shish 1 год назад
Родитель
Сommit
bb12e1a7d5
1 измененных файлов с 15 добавлено и 2 удалено
  1. 15 2
      app-hd/controllers/BaseController.php

+ 15 - 2
app-hd/controllers/BaseController.php

@@ -32,9 +32,22 @@ class BaseController extends PublicController
 
 
         //token验证 
         //token验证 
         $adminId = jwt::getLoginId();
         $adminId = jwt::getLoginId();
-        if (getenv('YII_ENV', 'local') != 'production') {
-            //$adminId = 253;
+
+        //将石少华的号模拟成别人的号进行测试,有多处需要同步修改,关键词 simulate_other ssh 20250717
+        $simulateKey = 'simulate_admin_id';
+        $simulateId = Yii::$app->redis->executeCommand('GET', [$simulateKey]);
+        if (!empty($simulateId) && $simulateId > 0) {
+            if (getenv('YII_ENV') == 'production') {
+                if ($adminId == 4) {
+                    $adminId = $simulateId;
+                }
+            } else {
+                if ($adminId == 919) {
+                    $adminId = $simulateId;
+                }
+            }
         }
         }
+
         if (empty($adminId) && in_array($action->id, $this->guestAccess) == false) {
         if (empty($adminId) && in_array($action->id, $this->guestAccess) == false) {
             util::notLogin();
             util::notLogin();
         }
         }