8
This commit is contained in:
+11
-5
@@ -122,9 +122,11 @@ class Jwt
|
||||
*
|
||||
* @param string $account 账号,用户名、邮箱、手机号
|
||||
* @param string $password 密码
|
||||
* @param string $type 登录方式
|
||||
* @param string $verifyType 验证方式
|
||||
* @return boolean
|
||||
*/
|
||||
public static function login($account, $password,$type=''): array|bool
|
||||
public static function login($account, $password='',$type='',$verifyType='password'): array|bool
|
||||
{
|
||||
if($type){
|
||||
$field = $type;
|
||||
@@ -150,10 +152,14 @@ class Jwt
|
||||
self::setError('Account is locked');
|
||||
return false;
|
||||
}
|
||||
//if ($user->username!='' && !\plugin\admin\app\common\Util::passwordVerify($password,$user->password)) {
|
||||
if (!\plugin\admin\app\common\Util::passwordVerify($password,$user->password)) {
|
||||
self::setError('Password is incorrect');
|
||||
return false;
|
||||
if($verifyType == 'password'){
|
||||
//if ($user->username!='' && !\plugin\admin\app\common\Util::passwordVerify($password,$user->password)) {
|
||||
if (!\plugin\admin\app\common\Util::passwordVerify($password,$user->password)) {
|
||||
self::setError('Password is incorrect');
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
captcha_verfiy($type,'login',$account);
|
||||
}
|
||||
|
||||
//直接登录会员
|
||||
|
||||
@@ -100,11 +100,17 @@ class Friend
|
||||
* @param string $userID 用户ID
|
||||
* @return array
|
||||
*/
|
||||
public function getFriendList(string $userID): array
|
||||
public function getFriendList(string $userID,$page=1,$pagesize=1000): array
|
||||
{
|
||||
// 获取管理员token
|
||||
$adminToken = Utils::getAdminToken();
|
||||
return Utils::send(Url::$getFriendList, ['userID' => $userID], '获取用户的好友列表错误', $adminToken);
|
||||
return Utils::send(Url::$getFriendList, [
|
||||
'userID' => $userID,
|
||||
"pagination" => [
|
||||
"pageNumber" => $page,
|
||||
"showNumber" => $pagesize
|
||||
]
|
||||
], '获取用户的好友列表错误', $adminToken);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -154,15 +154,15 @@ class Message
|
||||
* @param string $ex 扩展字段
|
||||
* @return array
|
||||
*/
|
||||
public function sendBusinessNotification(string $sendID, string $recvID, array $data): array
|
||||
public function sendBusinessNotification(string $sendID, string $recvID, array $data,string $type='user'): array
|
||||
{
|
||||
// 获取管理员token
|
||||
$data = [
|
||||
'sendUserID' => $sendID,
|
||||
'recvUserID' => $recvID,
|
||||
'recvGroupID' => '',
|
||||
'recvUserID' => $type=='user' ? $recvID : '',
|
||||
'recvGroupID' => $type=='user' ? '': $recvID,
|
||||
'key' => md5(time()),
|
||||
'data' =>json_encode($data),
|
||||
'data' => json_encode($data),
|
||||
'sendMsg' => true,
|
||||
'reliabilityLevel' => 1,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user