变更流量计费方法

This commit is contained in:
qaq
2025-08-01 16:25:16 +08:00
parent c56e647358
commit f35e6e95f5
11 changed files with 70 additions and 119 deletions
+2 -5
View File
@@ -98,11 +98,8 @@ const calculateTunnelUsedFlow = (tunnel: UserTunnel): number => {
const inFlow = tunnel.inFlow || 0;
const outFlow = tunnel.outFlow || 0;
if (tunnel.tunnelFlow === 1) {
return outFlow; // 单向计算:只计算上传流量
} else {
return inFlow + outFlow; // 双向计算或默认:计算上传和下载的总流量
}
// 后端已按计费类型处理流量,前端直接使用入站+出站总和
return inFlow + outFlow;
};
export default function UserPage() {