|
@@ -39,6 +39,34 @@ class Applet extends Base
|
|
|
return $user;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 更新用户信息 绑定用户手机号
|
|
|
+ *
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
+ public function bind_mobile()
|
|
|
+ {
|
|
|
+ $uid = $this->check();
|
|
|
+ //$code = Dever::input('mcode');
|
|
|
+ $mobile = Dever::load('passport/reg')->checkMobileExists();
|
|
|
+ if ($mobile && $uid) {
|
|
|
+ $info = Dever::load('passport/user-one', $uid);
|
|
|
+ $result['mobile'] = $mobile;
|
|
|
+ if ($info) {
|
|
|
+ $update['set_mobile'] = $mobile;
|
|
|
+ $update['where_id'] = $uid;
|
|
|
+ Dever::load('passport/user-update', $update);
|
|
|
+ } else {
|
|
|
+ Dever::alert('无效的用户id,请重新登录');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $result['uid'] = $uid;
|
|
|
+ $result['signature'] = Dever::login($uid);
|
|
|
+
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 生成用户,返回uid
|
|
|
*
|