ソースを参照

[更新]修改测试环境判断

Anyon 5 年 前
コミット
a95833c81f
2 ファイル変更3 行追加3 行削除
  1. 2 2
      application/admin/controller/Login.php
  2. 1 1
      route/demo.php

+ 2 - 2
application/admin/controller/Login.php

@@ -42,10 +42,10 @@ class Login extends Controller
             if (NodeService::islogin()) {
                 $this->redirect('@admin');
             } else {
+                $this->title = '系统登录';
                 $this->domain = Request::host(true);
-                $this->devmode = in_array($this->domain, ['127.0.0.1', 'localhost']) or stripos($this->domain, 'thinkadmin.top') !== false;
                 if (!($this->loginskey = session('loginskey'))) session('loginskey', $this->loginskey = uniqid());
-                $this->title = '系统登录';
+                $this->devmode = in_array($this->domain, ['127.0.0.1', 'localhost']) || is_numeric(stripos($this->domain, 'thinkadmin.top'));
                 $this->fetch();
             }
         } else {

+ 1 - 1
route/demo.php

@@ -18,7 +18,7 @@ use think\facade\Route;
 
 /* 演示环境禁止操作路由绑定 */
 $domain = Request::host(true);
-if (in_array($domain, ['127.0.0.1', 'localhost']) or stripos($domain, 'thinkadmin.top') <> false) {
+if (in_array($domain, ['127.0.0.1', 'localhost']) || stripos($domain, 'thinkadmin.top') <> false) {
     Route::post('admin/user/pass', function () {
         return json(['code' => 0, 'info' => '演示环境禁止修改用户密码!']);
     });