作者 郭盛
1 个管道 的构建 通过 耗费 1 秒

修改验证密码

@@ -365,11 +365,24 @@ class Create extends Api @@ -365,11 +365,24 @@ class Create extends Api
365 if(empty($pwd)){ 365 if(empty($pwd)){
366 $this->error('缺少必要参数'); 366 $this->error('缺少必要参数');
367 } 367 }
  368 + //文件类型
  369 + $file_type = $this->request->param('file_type');
  370 + if(empty($file_type)){
  371 + $this->error('缺少必要参数');
  372 + }
  373 +
  374 + if($file_type == 1){
  375 + $data = Db::name('folder')->where('id',$id)->find();
  376 + if(empty($data)){
  377 + $this->error('参数错误,没有该条数据');
  378 + }
  379 + }elseif ($file_type == 2){
368 //判断该条数据是否为空 如果为空给出提示 380 //判断该条数据是否为空 如果为空给出提示
369 $data = Db::name('savemes')->where('id',$id)->find(); 381 $data = Db::name('savemes')->where('id',$id)->find();
370 if(empty($data)){ 382 if(empty($data)){
371 $this->error('参数错误,没有该条数据'); 383 $this->error('参数错误,没有该条数据');
372 } 384 }
  385 + }
373 //判断用户的密码 386 //判断用户的密码
374 $user = Db::name('user')->where('id',$data['user_id'])->find(); 387 $user = Db::name('user')->where('id',$data['user_id'])->find();
375 if(empty($user['file_pwd'])){ 388 if(empty($user['file_pwd'])){