This commit is contained in:
2026-04-04 08:52:59 +08:00
parent 66bcd8061a
commit d98ac8f146
33 changed files with 2565 additions and 328 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ class Jwt
'password' => $password,
'email' => $email,
'mobile' => $mobile,
'level' => 1,
'level' => 0,
'score' => 0,
'avatar' => '',
];
+1 -2
View File
@@ -33,9 +33,8 @@ class Auth
public function getUserToken(string $userID, string $platformID = 'android'): array
{
// 获取管理员token
$adminToken = Utils::getAdminToken();
$platformID = Utils::getPlatformId( $platformID );
return Utils::send(Url::$getUserToken, ['userID' => $userID, 'platformID' => $platformID], '获取用户token错误', $adminToken);
return Utils::send(Url::$getUserToken, ['userID' => $userID, 'platformID' => $platformID], '获取用户token错误');
}
/**
+1 -1
View File
@@ -63,7 +63,7 @@ class Friend
* @param string $friendUserID 好友ID
* @return array
*/
public function deleteFriend(string $ownerUserID, string $friendUserID): array
public function deleteFriend(string $ownerUserID, string $friendUserID): array|bool
{
// 获取管理员token
$adminToken = Utils::getAdminToken();
+3
View File
@@ -192,6 +192,9 @@ class Utils
return self::getTokenManager()->clearToken($userID, $isAdmin);
}
public static function getPlatformId($name=''): int{
if(ctype_digit($name)){
return (int)$name;
}
$arr = [
'ios' => 1,
'android' => 2,