浏览代码

修改后台入口配置

请先更新 ThinkLibrary 再更新 Admin 模块
Anyon 4 年之前
父节点
当前提交
07a197f7b6
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      app/admin/controller/Config.php
  2. 1 1
      app/admin/view/config/system.html

+ 1 - 1
app/admin/controller/Config.php

@@ -65,7 +65,7 @@ class Config extends Controller
             $this->fetch();
         } else {
             if ($xpath = $this->request->post('xpath')) {
-                if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]+$/', $xpath)) {
+                if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $xpath)) {
                     $this->error('后台入口名称需要是由英文字母开头!');
                 }
                 if ($xpath !== 'admin' && file_exists($this->app->getBasePath() . $xpath)) {

+ 1 - 1
app/admin/view/config/system.html

@@ -5,7 +5,7 @@
             <span class="color-desc margin-left-5">Login</span>
             <label class="layui-input relative block label-required-null">
                 <span>{:sysuri('@',[],false,true)}</span>
-                <input autofocus required pattern="[a-zA-Z_][a-zA-Z0-9_]+" placeholder="请输入后台登录入口" class="layui-input inline-block padding-0 border-0" style="width:auto;background:none" value="{:trim(sysuri('admin/index/index',[],false),'/')}" name="xpath">
+                <input autofocus required pattern="[a-zA-Z_][a-zA-Z0-9_]*" placeholder="请输入后台登录入口" class="layui-input inline-block padding-0 border-0" style="width:auto;background:none" value="{:trim(sysuri('admin/index/index',[],false),'/')}" name="xpath">
             </label>
             <span class="help-block">名称由英文字母开头且不能存在相同名称的应用,设置之后原地址不能继续访问!</span>
         </div>