修改密码

admin2年前Laravel782

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 register(){    $mobile = request()->input('mobile');   &nb...

阿里云发送短信

public function sms(){    $moile = request()->input('mobile');    if...

关注公众号并登录

/* * 服务端生成带唯一标识二维码并将唯一标识返回给前端 */ public function wx_code() { $scene_str = $this->get_...

按照距离远近排序

   $distance = "ACOS(SIN(( $lat * 3.1415) / 180 ) *SIN((lat * 3.1415) / 180 ) +COS((...

下载文件

public function img_url() { $id = request()->param('id', 1122); $info = Db::name('...

不重复 的推荐码

public function getcode(){    do {        $code = rand(10000000, 99999...