修改密码

admin2年前Laravel727

public function setpass()
{
   $mobile = request()->input('mobile');
   $code = request()->input('code');
   $pwd = request()->input('pwd', 1);
   $rpwd = request()->input('rpwd', 1);
   if (empty($pwd)) {
       return $this->error('请输入密码');
   }
   if (empty($rpwd)) {
       return $this->error('请输入确认密码');
   }
   if ($pwd !== $rpwd) {
       return $this->error('两次密码不一致');
   }
   $this->verfiy($mobile, $code);
   $info = Db::table('member')->where(array('id' => $this->user_id))->update(['pwd' => md5($this->md5 . $pwd)]);
   if ($info !== false) {
       return $this->success('修改成功');
   } else {
       return $this->error('修改失败');
   }
}

相关文章

公众号登录

public function wxlogin(){       $code = request()->input('code'); &n...

手机号替换

 $vv = substr_replace($vv, '****', 3, 4) ....

微信支付V3

 public static function pay($order_sn = '11111', $money = '12', $uid = 7) ...

base64 处理图片

public function images(){    $image = request()->input('image');    i...

设置项目编号

$max = Db::table('member')->max('id') ?? 0; if ($max < 100000) { $cd = $this->create...

修改密码

/** * 修改密码 */publicfunction setpass(){    $type = request()->input('type');// 1...