Some checks failed
Deploy / deploy (push) Has been cancelled
Full-stack web application for Telegram management - Frontend: Vue 3 + Vben Admin - Backend: NestJS - Features: User management, group broadcast, statistics 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
169 lines
5.6 KiB
JavaScript
169 lines
5.6 KiB
JavaScript
// 在浏览器控制台中登录系统后运行此脚本
|
||
// 确保已经登录并有有效的token
|
||
|
||
async function initProxyPlatforms() {
|
||
// 获取当前的token
|
||
const token = localStorage.getItem('token') || '';
|
||
|
||
if (!token) {
|
||
console.error('请先登录系统');
|
||
return;
|
||
}
|
||
|
||
// 10个代理平台的数据
|
||
const platforms = [
|
||
{
|
||
platform: 'brightdata',
|
||
description: '全球最大的代理网络,拥有7200万+IP',
|
||
apiUrl: 'https://api.brightdata.com',
|
||
authType: 'userPass',
|
||
proxyTypes: 'http,https,socks5',
|
||
countries: 'US,UK,DE,FR,JP,CN,AU,CA,BR,IN',
|
||
concurrentLimit: 1000,
|
||
rotationInterval: 0,
|
||
isEnabled: true
|
||
},
|
||
{
|
||
platform: 'oxylabs',
|
||
description: '企业级代理解决方案,1亿+住宅IP',
|
||
apiUrl: 'https://api.oxylabs.io',
|
||
authType: 'userPass',
|
||
proxyTypes: 'http,https',
|
||
countries: 'US,UK,DE,FR,ES,IT,NL,PL,CA,AU',
|
||
concurrentLimit: 500,
|
||
rotationInterval: 0,
|
||
isEnabled: true
|
||
},
|
||
{
|
||
platform: 'smartproxy',
|
||
description: '高性价比选择,5500万+住宅IP',
|
||
apiUrl: 'https://api.smartproxy.com',
|
||
authType: 'userPass',
|
||
proxyTypes: 'http,https',
|
||
countries: 'US,UK,DE,FR,CA,AU,JP,BR,IN,IT',
|
||
concurrentLimit: 300,
|
||
rotationInterval: 600,
|
||
isEnabled: true
|
||
},
|
||
{
|
||
platform: 'iproyal',
|
||
description: '新兴代理服务商,价格实惠',
|
||
apiUrl: 'https://api.iproyal.com',
|
||
authType: 'userPass',
|
||
proxyTypes: 'http,https,socks5',
|
||
countries: 'US,UK,DE,FR,ES,IT,NL,CA,AU,BR',
|
||
concurrentLimit: 200,
|
||
rotationInterval: 300,
|
||
isEnabled: true
|
||
},
|
||
{
|
||
platform: 'proxyseller',
|
||
description: '专注数据中心和移动代理',
|
||
apiUrl: 'https://api.proxy-seller.com',
|
||
authType: 'apiKey',
|
||
proxyTypes: 'http,https,socks5',
|
||
countries: 'US,UK,DE,FR,RU,UA,PL,NL,ES,IT',
|
||
concurrentLimit: 100,
|
||
rotationInterval: 0,
|
||
isEnabled: true
|
||
},
|
||
{
|
||
platform: 'webshare',
|
||
description: '免费和付费代理服务',
|
||
apiUrl: 'https://proxy.webshare.io/api',
|
||
authType: 'apiKey',
|
||
proxyTypes: 'http,socks5',
|
||
countries: 'US,UK,DE,FR,CA,NL,ES,IT,AU,JP',
|
||
concurrentLimit: 100,
|
||
rotationInterval: 3600,
|
||
isEnabled: true
|
||
},
|
||
{
|
||
platform: 'proxyempire',
|
||
description: '轮换住宅和移动代理',
|
||
apiUrl: 'https://api.proxyempire.io',
|
||
authType: 'userPass',
|
||
proxyTypes: 'http,https',
|
||
countries: 'US,UK,DE,FR,CA,AU,BR,MX,IN,JP',
|
||
concurrentLimit: 250,
|
||
rotationInterval: 300,
|
||
isEnabled: true
|
||
},
|
||
{
|
||
platform: 'infatica',
|
||
description: '住宅代理网络,1000万+IP',
|
||
apiUrl: 'https://api.infatica.io',
|
||
authType: 'userPass',
|
||
proxyTypes: 'http,https,socks5',
|
||
countries: 'US,UK,DE,FR,ES,IT,CA,AU,BR,IN',
|
||
concurrentLimit: 150,
|
||
rotationInterval: 600,
|
||
isEnabled: true
|
||
},
|
||
{
|
||
platform: 'netnut',
|
||
description: 'DiviNetworks旗下,5200万+IP',
|
||
apiUrl: 'https://api.netnut.io',
|
||
authType: 'userPass',
|
||
proxyTypes: 'http,https',
|
||
countries: 'US,UK,DE,FR,ES,IT,BR,MX,CA,AU',
|
||
concurrentLimit: 500,
|
||
rotationInterval: 0,
|
||
isEnabled: true
|
||
},
|
||
{
|
||
platform: 'stormproxies',
|
||
description: '轮换反向代理,适合批量操作',
|
||
apiUrl: 'https://api.stormproxies.com',
|
||
authType: 'userPass',
|
||
proxyTypes: 'http',
|
||
countries: 'US,EU',
|
||
concurrentLimit: 40,
|
||
rotationInterval: 180,
|
||
isEnabled: true
|
||
}
|
||
];
|
||
|
||
// API基础URL
|
||
const baseUrl = window.location.hostname === 'localhost'
|
||
? 'http://127.0.0.1:3000'
|
||
: 'http://api.tgtg.vip';
|
||
|
||
console.log('开始初始化代理平台数据...');
|
||
|
||
let successCount = 0;
|
||
let failCount = 0;
|
||
|
||
// 逐个添加平台
|
||
for (const platform of platforms) {
|
||
try {
|
||
const response = await fetch(`${baseUrl}/proxyPlatform/add`, {
|
||
method: 'POST',
|
||
headers: {
|
||
'Content-Type': 'application/json',
|
||
'token': token
|
||
},
|
||
body: JSON.stringify(platform)
|
||
});
|
||
|
||
const result = await response.json();
|
||
|
||
if (result.success) {
|
||
console.log(`✅ 成功添加平台: ${platform.platform}`);
|
||
successCount++;
|
||
} else {
|
||
console.error(`❌ 添加平台失败: ${platform.platform}`, result.msg || '未知错误');
|
||
failCount++;
|
||
}
|
||
} catch (error) {
|
||
console.error(`❌ 添加平台出错: ${platform.platform}`, error);
|
||
failCount++;
|
||
}
|
||
}
|
||
|
||
console.log(`\n初始化完成!成功: ${successCount}, 失败: ${failCount}`);
|
||
console.log('请刷新页面查看代理平台列表');
|
||
}
|
||
|
||
// 运行初始化
|
||
initProxyPlatforms(); |