|
@@ -26,7 +26,7 @@ class Auth
|
|
|
//默认配置
|
|
|
protected $config = [];
|
|
|
protected $options = [];
|
|
|
- protected $allowFields = ['id', 'username', 'nickname', 'mobile', 'avatar', 'gender', 'createtime' ,'idcard_status'];
|
|
|
+ protected $allowFields = ['id', 'username', 'nickname', 'mobile', 'avatar', 'gender', 'createtime' ,'idcard_status','tv_mobile'];
|
|
|
|
|
|
public function __construct($options = [])
|
|
|
{
|
|
@@ -246,9 +246,12 @@ class Auth
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- if ($tv_userid && User::getByTvUserid($tv_userid)) {
|
|
|
- $this->setError('tv user already exist');
|
|
|
- return false;
|
|
|
+ if ($tv_userid) {
|
|
|
+ $check_user = Db::name('user')->where('comefrom',2)->where('tv_userid',$tv_userid)->find();
|
|
|
+ if($check_user){
|
|
|
+ $this->setError('tv user already exist');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$ip = request()->ip();
|
|
@@ -538,6 +541,21 @@ class Auth
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 获取会员基本信息
|
|
|
+ */
|
|
|
+ public function getUserinfo_tv()
|
|
|
+ {
|
|
|
+ $data = $this->_user->toArray();
|
|
|
+ $allowFields = $this->getAllowFields();
|
|
|
+ $userinfo = array_intersect_key($data, array_flip($allowFields));
|
|
|
+ $userinfo = array_merge($userinfo, Token::get($this->_token));
|
|
|
+
|
|
|
+ $userinfo['avatar'] = localpath_to_netpath($userinfo['avatar']);
|
|
|
+
|
|
|
+ return $userinfo;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 获取会员组别规则列表
|
|
|
* @return array|bool|\PDOStatement|string|\think\Collection
|
|
|
*/
|