修改密码
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('修改失败');
}
}