zhaojs
2023-07-20 8c00bd0245ca4756ca04483a4980ad202714e43e
application/common/library/Auth.php
@@ -134,7 +134,7 @@
     * @param string $third_info 三方用户信息 注:需保持统一结构
     * @return boolean
     */
    public function register($username = '', $password, $email = '', $mobile = '', $extend = [],$third_platform="",$third_info=[])
    public function register($username = '', $password, $email = '', $mobile = '', $extend = [],$third_platform="",$third_info=[],$pushCid="")
    {
        // 检测用户名、昵称、邮箱、手机号是否存在
        if(!empty($third_platform) && !empty($third_info)){
@@ -184,7 +184,8 @@
            'logintime' => $time,
            'loginip'   => $ip,
            'prevtime'  => $time,
            'status'    => 'normal'
            'status'    => 'normal',
            'push_cid'=>$pushCid
        ]);
        //$params['password'] = $this->getEncryptPassword($password, $params['salt']);
        $params = array_merge($params, $extend);
@@ -340,7 +341,7 @@
     * @param int $user_id
     * @return boolean
     */
    public function direct($user_id)
    public function direct($user_id,$pushCid='')
    {
        $user = User::get($user_id);
        if ($user) {
@@ -363,6 +364,10 @@
                //!empty(PUSH_CID) && $user->push_cid = PUSH_CID;
                //重置登录失败次数
                $user->loginfailure = 0;
                if(!empty($pushCid))
                {
                    $user->push_cid=$pushCid;
                }
                $user->save();
                $this->_user = $user;
                $this->_token = Random::uuid();