diff --git a/app/BaseController.php b/app/BaseController.php index 41ff30f..742ff28 100644 --- a/app/BaseController.php +++ b/app/BaseController.php @@ -258,7 +258,7 @@ abstract class BaseController } else { $artUrl = (string) url('article_detail', ['id' => $aid]); } - +//halt($indexUrl,$artUrl); //多应用时,文章所属应用 2022.11.17 $app = app('http')->getName(); if(empty($appname)) { @@ -268,9 +268,9 @@ abstract class BaseController } // 判断index应用是否绑定域名 - $bind_index = array_search($appname,config('app.domain_bind')); + $bind_index = array_search($appname, config('app.domain_bind')); // 判断index应用是否域名映射 - $map_index = array_search($appname,config('app.app_map')); + $map_index = array_search($appname, config('app.app_map')); // article 所属应用名 $index = $map_index ?: $appname; // index应用名 @@ -293,7 +293,7 @@ abstract class BaseController if($bind_index) { // echo 111; // index或home前端(非admin应用)域名进行了绑定 - // url = $indexUrl . str_replace($admin . '/','',$artUrl); +// $url = $indexUrl . str_replace($admin . '/','',$artUrl); $url = $indexUrl . $artUrl; } else { if($bind_admin) { @@ -304,11 +304,11 @@ abstract class BaseController // echo 333; // var_dump($admin, $appname, $artUrl); // admin进行了映射 - $url = $indexUrl . str_replace($admin, $appname, $artUrl); + $url = $indexUrl . str_replace($admin, $index, $artUrl); } else { // echo 444; // admin未绑定域名 - $url = $indexUrl . str_replace($app, $appname, $artUrl); + $url = $indexUrl . str_replace($app, $index, $artUrl); } } diff --git a/app/admin/controller/AuthGroup.php b/app/admin/controller/AuthGroup.php index 69ebd4e..8b18795 100644 --- a/app/admin/controller/AuthGroup.php +++ b/app/admin/controller/AuthGroup.php @@ -27,7 +27,7 @@ class AuthGroup extends AdminController if(Request::isAjax()){ $data = Request::only(['id']); $map = array_filter($data); - $role = Db::name('auth_group')->field('id,title,limits,descr,status')->where('status',1)->where($map)->select(); + $role = Db::name('auth_group')->field('id,title,limits,descr,status')->where($map)->select(); $count = $role->count(); $res = []; if($count){ diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index a592caf..3188447 100644 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -42,12 +42,16 @@ class User extends AdminController // if(Request::isAjax()){ $data = Request::param(); - $result = Db::name('user')->save($data); - if($result){ - $res = ['code'=>0,'msg'=>'添加成功']; - }else{ - $res = ['code'=>-1,'msg'=>'添加失败']; - } + $data['create_time'] = time(); + $salt = substr(md5($data['create_time']),-6); + // 默认手机号为密码 + $data['password'] = md5(substr_replace(md5($data['phone']),$salt,0,6)); + try { + Db::name('user')->save($data); + $res = ['code'=>0,'msg'=>'添加成功']; + } catch (\Exception $e) { + $res = ['code'=>-1, 'msg'=>$e->getMessage()]; + } return json($res); } @@ -59,6 +63,10 @@ class User extends AdminController { if(Request::isAjax()){ $data = Request::param(); + $user = Db::name('user')->field('create_time')->find($data['id']); + $salt = substr(md5($user['create_time']),-6); + // 默认手机号为密码 + $data['password'] = md5(substr_replace(md5($data['phone']),$salt,0,6)); $result = Db::name('user')->update($data); if($result){ $res = ['code'=>0,'msg'=>'编辑成功']; diff --git a/app/admin/view/forum/tagsform.html b/app/admin/view/forum/tagsform.html index bf68c54..b87f384 100644 --- a/app/admin/view/forum/tagsform.html +++ b/app/admin/view/forum/tagsform.html @@ -26,18 +26,18 @@