diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 14f1e92..8f95315 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -74,7 +74,8 @@ class UserController extends Controller try { $position = Location::get($ipToLookup); if ($position) { - $data['location'] = ($position->countryName === '中国' || $position->countryName === 'Local') ? + $isChinaOrLocal = in_array($position->countryCode ?? $position->isoCode ?? '', ['CN', 'TW', 'HK', 'MO']) || $position->countryName === 'Local'; + $data['location'] = $isChinaOrLocal ? trim(($position->regionName ?? '') . ' ' . ($position->cityName ?? '')) : ($position->countryName ?? '未知区域'); diff --git a/resources/views/chat/partials/user-actions.blade.php b/resources/views/chat/partials/user-actions.blade.php index 86ae0fb..4797e42 100644 --- a/resources/views/chat/partials/user-actions.blade.php +++ b/resources/views/chat/partials/user-actions.blade.php @@ -332,23 +332,23 @@ {{-- 详细信息区 (等级高看等级低,或自己看自己时才有这些字段) --}}