惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
宝玉的分享
宝玉的分享
月光博客
月光博客
B
Blog
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
aimingoo的专栏
aimingoo的专栏
N
Netflix TechBlog - Medium
博客园_首页
GbyAI
GbyAI
人人都是产品经理
人人都是产品经理
A
About on SuperTechFans
Y
Y Combinator Blog
L
LangChain Blog
有赞技术团队
有赞技术团队
D
Docker
爱范儿
爱范儿
博客园 - 司徒正美
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Security Blog
Microsoft Security Blog
D
DataBreaches.Net

WishMeLz - JS

Electron 主进程起一个可用的 HTTPS 静态服务器 - WishMeLz ANSI 字体在前端展示 Jenkins日志 - WishMeLz 获取视频某一秒的截图 - WishMeLz 金额大写 - WishMeLz markdown 编辑器 md编辑器 - WishMeLz 零宽非连接符 [ZWNJ] U+200C - WishMeLz SSE(Server-Sent Events) - WishMeLz 随机渐变背景 - WishMeLz 文件处理 - WishMeLz
某x面板每月自动重置流量功能 - WishMeLz
WishMeLz · 2025-12-25 · via WishMeLz - JS
最新版貌似已经添加了重置功能
const axios = require("axios");
const https = require("https");

const baseUrl = "https://xxx.xxx.cn:12221/oG5g0pFGbeeL5Aq";

const api = axios.create({
    baseURL: baseUrl,
    httpsAgent: new https.Agent({
        rejectUnauthorized: false,
    }),
    timeout: 20000,
});

async function main() {
    // 登录
    const loginRes = await api.post("/login", {
        username: "",
        password: "",
    });

    // 提取 set-cookie
    const setCookies = loginRes.headers["set-cookie"];
    if (!setCookies || setCookies.length === 0) {
        throw new Error("login response has no set-cookie");
    }

    const cookieHeader = setCookies.map((c) => c.split(";")[0]).join("; ");

    console.log("cookie:", cookieHeader);

    // 重置所有入站
    const resAllInbound = await api.post("/panel/inbound/resetAllTraffics", null, {
        headers: {
            Cookie: cookieHeader,
        },
    });

    console.log(resAllInbound.data);
    // 重置所有用户
    const resAllUser = await api.post("/panel/inbound/resetAllClientTraffics/-1", null, {
        headers: {
            Cookie: cookieHeader,
        },
    });
    console.log(resAllUser.data);
    console.log("all reset done");
}

main().catch((err) => {
    console.error("FATAL:", err.message);
});

2025-12-25T07:52:39.png


最后编辑时间为: December 25th , 2025 at 03:37 pm
本文由 Wish 创作,采用 知识共享署名 4.0 国际许可协议进行许可
可自由转载、引用,但需署名作者且注明文章出处

标签 : 无标签