Browse Source

维保管理,增加管理员编辑

lizhen_gitee 3 months ago
parent
commit
0ab1f6ef60

+ 3 - 3
application/admin/controller/Pcadmin.php

@@ -108,16 +108,16 @@ class Pcadmin extends Backend
 
             $adminmobile = $params['mobile'];
             if (!$adminmobile || !\think\Validate::regex($adminmobile, "^1\d{10}$")) {
-                $this->error('手机号格式不正确');
+                abort(500,'手机号格式不正确');
             }
             $check = Db::name('pc_admin')->where('username',$adminmobile)->where('id','neq',$adminid)->find();
             if(!empty($check)){
-                $this->error('该手机号已被其他管理员注册');
+                abort(500,'该手机号已被其他管理员注册');
             }
 
             if (!empty($params['password'])) {
                 if (!\think\Validate::is($params['password'], "/^[\S]{6,30}$/")) {
-                    $this->error(__("Please input correct password"));
+                    abort(500,__("Please input correct password"));
                 }
                 $params['salt'] = Random::alnum();
                 $params['password'] = md5(md5($params['password']) . $params['salt']);

+ 2 - 0
application/admin/lang/zh-cn.php

@@ -220,4 +220,6 @@ return [
     'User Module'                                           => '会员模块',
     'Register'                                              => '注册',
     'User Center'                                           => '会员中心',
+    'Please input correct password'             => '密码长度必须在6-30位之间,不能包含空格',
+
 ];

+ 1 - 1
application/admin/lang/zh-cn/company.php

@@ -12,5 +12,5 @@ return [
     'Set status to 0'=> '设为禁用',
     'Aboutus_image' => '关于我们顶部图',
     'Aboutus'       => '关于我们',
-    'Deletetime'    => '删除时间'
+    'Deletetime'    => '删除时间',
 ];

+ 1 - 1
application/admin/view/pcadmin/pcadmin.html

@@ -34,7 +34,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-password" class="form-control" name="row[password]" placeholder="不修改密码请留空" type="password" value="" autocomplete="new-password" data-rule="password">
+            <input id="c-password" class="form-control" name="row[password]" placeholder="不修改密码请留空" type="password" value="" >
         </div>
     </div>