Skip to content

Let's use AI to Earn!

zaici

I5bijibneb48512adccc9
diff --git a/src/api/types/account.type.ts b/src/api/types/account.type.ts
index 838f39d7..f0d9003a 100644
--- a/src/api/types/account.type.ts
+++ b/src/api/types/account.type.ts
@@ -46,4 +46,7 @@ export interface AccountGroupItem {
name: string;
rank: number;
isDefault: boolean;
+ proxyIp?: string;
+ ip?: string;
+ location?: string;
}
diff --git a/src/app/[lng]/accounts/components/AccountSidebar/AccountSidebar.tsx b/src/app/[lng]/accounts/components/AccountSidebar/AccountSidebar.tsx
index 494db832..2524d4aa 100644
--- a/src/app/[lng]/accounts/components/AccountSidebar/AccountSidebar.tsx
+++ b/src/app/[lng]/accounts/components/AccountSidebar/AccountSidebar.tsx
@@ -266,12 +266,13 @@ const AccountSidebar = memo(
).length
}
</span>
- {/* 在默认分组中显示IP和地址信息 */}
- {isDefaultGroup && (
+ {/* 根据proxyIp判断显示IP信息 */}
+ {(!v.proxyIp || v.proxyIp === "") ? (
+ // 本地IP显示
<div className="accountSidebar-ipInfo">
{ipLocationLoading ? (
<span className="accountSidebar-ipLoading">{t("ipInfo.loading")}</span>
- ) : showIpInfo ? (
+ ) : ipLocationInfo ? (
<Tooltip title={t("ipInfo.tooltip", { asn: ipLocationInfo.asn, org: ipLocationInfo.org })}>
<span className="accountSidebar-ipText">
{formatLocationInfo(ipLocationInfo)}
@@ -281,6 +282,17 @@ const AccountSidebar = memo(
<span className="accountSidebar-ipError">{t("ipInfo.error")}</span>
)}
</div>
+ ) : (
+ // 数据中的IP显示
+ v.ip && v.location && (
+ <div className="accountSidebar-ipInfo">
+ <Tooltip title={`IP: ${v.ip}\n位置: ${v.location}`}>
+ <span className="accountSidebar-ipText">
+ {v.ip} | {v.location}
+ </span>
+ </Tooltip>
+ </div>
+ )
)}
</div>
</>
diff --git a/src/app/[lng]/accounts/components/AccountSidebar/UserManageModal.tsx b/src/app/[lng]/accounts/components/AccountSidebar/UserManageModal.tsx
index f8b77ed0..aa52295a 100644
--- a/src/app/[lng]/accounts/components/AccountSidebar/UserManageModal.tsx
+++ b/src/app/[lng]/accounts/components/AccountSidebar/UserManageModal.tsx
@@ -141,8 +141,9 @@ const SpaceInfoCard = ({
</span>
</div> */}
- {/* 默认空间显示IP和属地信息 */}
- {currentSpace.isDefault && (
+ {/* 根据proxyIp判断显示IP和属地信息 */}
+ {(!currentSpace.proxyIp || currentSpace.proxyIp === "") ? (
+ // 本地IP显示
<div style={{
display: 'flex',
alignItems: 'center',
@@ -175,6 +176,29 @@ const SpaceInfoCard = ({
</span>
)}
</div>
+ ) : (
+ // 数据中的IP显示
+ currentSpace.ip && currentSpace.location && (
+ <div style={{
+ display: 'flex',
+ alignItems: 'center',
+ gap: '8px',
+ padding: '8px',
+ backgroundColor: 'var(--grayColor2)',
+ borderRadius: '6px'
+ }}>
+ <GlobalOutlined style={{ color: 'var(--colorPrimary5)' }} />
+ <Tooltip title={`IP: ${currentSpace.ip}\n位置: ${currentSpace.location}`}>
+ <span style={{
+ color: 'var(--grayColor7)',
+ cursor: 'help',
+ fontWeight: '500'
+ }}>
+ {currentSpace.ip} | {currentSpace.location}
+ </span>
+ </Tooltip>
+ </div>
+ )
)}
{/* 空间创建时间等信息 */}