Compare commits

...
2 Commits
Author SHA1 Message Date
cheney 3b79054995 更新代理配置与对账单数据 2026-10-21 19:59:48 +08:00
cheney 9cf1aacd74 更新token并增加接口错误处理 2026-10-21 19:59:46 +08:00
5 changed files with 59 additions and 33 deletions
+14 -1
View File
@@ -6,7 +6,7 @@ const EXCEL_FILE = path.join(__dirname, '新建 XLSX 工作表.xlsx');
const SHEET_NAME = '2026';
const BASE_URL = 'https://superstar.geelytravel.com';
const AUTH_TOKEN = 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJKV1QtRC1TRVFfVVNFUl9UTUNfMDAwMDAxODMiLCJ1c2VyX2NvZGUiOiJTRVFfVVNFUl9UTUNfMDAwMDAxODMiLCJyb2xlcyI6WyLnu5PnrpfkuJPlkZgiLCLnu5PnrpfkuJPlkZgiXSwiZXhwIjoxNzg2NTMzNTUxLCJpYXQiOjE3ODM5NDE1NTF9.1Mcmf5IM07Scrry4FzPs6TAcfUu0Nqtjre_2iJlNd5c';
const AUTH_TOKEN = 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJKV1QtRC1TRVFfVVNFUl9UTUNfMDAwMDAxODMiLCJ1c2VyX2NvZGUiOiJTRVFfVVNFUl9UTUNfMDAwMDAxODMiLCJyb2xlcyI6WyLnu5PnrpfkuJPlkZgiLCLnu5PnrpfkuJPlkZgiXSwiZXhwIjoxNzk1MDkxMTI3LCJpYXQiOjE3OTI0OTkxMjd9.wPYA-ntdWfT86LsQIYEJdVUHEksbMM9VwE96VqPdGms';
const COMMON_HEADERS = {
'accept': 'application/json, text/plain, */*',
@@ -301,6 +301,17 @@ function randomDelaySeconds() {
return Math.floor(15 + Math.random() * 31);
}
// ========== 接口错误检查 ==========
function ensureOk(resp, what) {
if (resp && resp.code && resp.code !== 'Z000') {
if (resp.code === 'E003') {
console.error(' ✗ token 已失效(E003: ' + (resp.msg || '') + '),请更新 AUTH_TOKEN');
process.exit(1);
}
throw new Error(what + ' 失败: [' + resp.code + '] ' + (resp.msg || resp.message || ''));
}
}
// ========== 主流程 ==========
async function main() {
const teamIds = readTeamIds();
@@ -315,6 +326,7 @@ async function main() {
try {
const settlementResp = await querySettlementAccountIds(teamId);
ensureOk(settlementResp, 'querySettlementAccountIds');
const resultList = settlementResp?.result || [];
if (resultList.length === 0) {
console.log(' ⚠ ' + teamId + ' 没有 settlement account,跳过\n');
@@ -324,6 +336,7 @@ async function main() {
console.log(' -> settlementAccountId: ' + settlementAccountId);
const billResp = await queryBillList(settlementAccountId);
ensureOk(billResp, 'queryBillList');
const allBills = billResp?.result?.list || [];
const total = billResp?.result?.total || 0;
console.log(' -> 共 ' + total + ' 条对账单');
+14 -1
View File
@@ -6,7 +6,7 @@ const EXCEL_FILE = path.join(__dirname, '新建 XLSX 工作表.xlsx');
const SHEET_NAME = '2026';
const BASE_URL = 'https://superstar.geelytravel.com';
const AUTH_TOKEN = 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJKV1QtRC1TRVFfVVNFUl9UTUNfMDAwMDAxODMiLCJ1c2VyX2NvZGUiOiJTRVFfVVNFUl9UTUNfMDAwMDAxODMiLCJyb2xlcyI6WyLnu5PnrpfkuJPlkZgiLCLnu5PnrpfkuJPlkZgiXSwiZXhwIjoxNzg2NTMzNTUxLCJpYXQiOjE3ODM5NDE1NTF9.1Mcmf5IM07Scrry4FzPs6TAcfUu0Nqtjre_2iJlNd5c';
const AUTH_TOKEN = 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJKV1QtRC1TRVFfVVNFUl9UTUNfMDAwMDAxODMiLCJ1c2VyX2NvZGUiOiJTRVFfVVNFUl9UTUNfMDAwMDAxODMiLCJyb2xlcyI6WyLnu5PnrpfkuJPlkZgiLCLnu5PnrpfkuJPlkZgiXSwiZXhwIjoxNzk1MDkxMTI3LCJpYXQiOjE3OTI0OTkxMjd9.wPYA-ntdWfT86LsQIYEJdVUHEksbMM9VwE96VqPdGms';
const COMMON_HEADERS = {
'accept': 'application/json, text/plain, */*',
@@ -350,6 +350,17 @@ function randomDelaySeconds() {
return Math.floor(15 + Math.random() * 31);
}
// ========== 接口错误检查 ==========
function ensureOk(resp, what) {
if (resp && resp.code && resp.code !== 'Z000') {
if (resp.code === 'E003') {
console.error(' ✗ token 已失效(E003: ' + (resp.msg || '') + '),请更新 AUTH_TOKEN');
process.exit(1);
}
throw new Error(what + ' 失败: [' + resp.code + '] ' + (resp.msg || resp.message || ''));
}
}
// ========== 主流程 ==========
async function main() {
const teamIds = readTeamIds();
@@ -364,6 +375,7 @@ async function main() {
try {
const settlementResp = await querySettlementAccountIds(teamId);
ensureOk(settlementResp, 'querySettlementAccountIds');
const resultList = settlementResp?.result || [];
if (resultList.length === 0) {
console.log(' ⚠ ' + teamId + ' 没有 settlement account,跳过\n');
@@ -373,6 +385,7 @@ async function main() {
console.log(' -> settlementAccountId: ' + settlementAccountId);
const billResp = await queryBillList(settlementAccountId);
ensureOk(billResp, 'queryBillList');
const allBills = billResp?.result?.list || [];
const total = billResp?.result?.total || 0;
console.log(' -> 共 ' + total + ' 条对账单');
+1 -1
View File
@@ -1,6 +1,6 @@
{
"server": {
"url": "ws://bh.vps.honor3.com:18888/websocket_path",
"url": "ws://baishe.vps.honor3.com:18888/websocket_path",
"password": "helloworld"
},
"client_name": "cheney"
+1 -1
View File
@@ -12,7 +12,7 @@
"name": "superstar",
"remote_port": 4443,
"local_port": 443,
"local_ip": "198.19.0.115",
"local_ip": "198.19.0.22",
"speed_limit": 0.0,
"protocol": "tcp"
}
Binary file not shown.