|
...
|
...
|
@@ -74,24 +74,6 @@ class ComController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 菜单权限->得到子级数组
|
|
|
|
* @param int
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function _get_child($my_id, $arr)
|
|
|
|
{
|
|
|
|
$new_arr = array();
|
|
|
|
foreach ($arr as $k => $v) {
|
|
|
|
$v = (array)$v;
|
|
|
|
if ($v['pid'] == $my_id) {
|
|
|
|
$v['sub'] = $this->_get_child($v['id'],$arr);
|
|
|
|
$new_arr[] = $v;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $new_arr ? $new_arr : false;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @name :获取当前项目详情
|
|
|
|
* @return void
|
|
|
|
* @author :liyuhang
|
|
...
|
...
|
@@ -114,17 +96,11 @@ class ComController extends BaseController |
|
|
|
*/
|
|
|
|
public function edit_info(){
|
|
|
|
$rules = [
|
|
|
|
'id'=>'required',
|
|
|
|
'mobile'=>'required|string|max:11',
|
|
|
|
'password'=>'required|string|min:5',
|
|
|
|
'name'=>'required|max:20',
|
|
|
|
];
|
|
|
|
//验证的提示信息
|
|
|
|
$message = [
|
|
|
|
'id.required'=>'主键不能为空',
|
|
|
|
'mobile.required'=>'号码必须填写',
|
|
|
|
'mobile.string'=>'号码中含有非法文字',
|
|
|
|
'mobile.max' => '号码不大于11字符.',
|
|
|
|
'password.required'=>'密码必须填写',
|
|
|
|
'password.string'=>'密码中含有非法文字',
|
|
|
|
'password.min' => '密码不小于5字符.',
|
|
...
|
...
|
@@ -135,8 +111,13 @@ class ComController extends BaseController |
|
|
|
if($validate->fails()){
|
|
|
|
return $this->response($validate->errors()->first(),Code::USER_PARAMS_ERROE,$this->param);
|
|
|
|
}
|
|
|
|
$user = new UserModel();
|
|
|
|
|
|
|
|
$userModel = new UserModel();
|
|
|
|
$this->param['id'] = $this->uid;
|
|
|
|
$rs = $userModel->edits($this->param);
|
|
|
|
if($rs === false){
|
|
|
|
$this->response('参数错误或其他服务器原因,编辑失败',Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
$this->response('编辑成功');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -146,6 +127,10 @@ class ComController extends BaseController |
|
|
|
* @method :post
|
|
|
|
*/
|
|
|
|
public function logout(){
|
|
|
|
|
|
|
|
$rs = Cache::pull($this->token);
|
|
|
|
if($rs === false){
|
|
|
|
$this->response('error',Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|