|
@@ -1,45 +0,0 @@
|
|
|
-const { Subscription } = require('./src/models');
|
|
|
-
|
|
|
-async function updateSubscription() {
|
|
|
- try {
|
|
|
- // 查找测试订阅
|
|
|
- const testSubscription = await Subscription.findOne({
|
|
|
- where: { url: 'https://example.com/subscription' }
|
|
|
- });
|
|
|
-
|
|
|
- if (testSubscription) {
|
|
|
- console.log('找到测试订阅,正在更新为真实链接...');
|
|
|
-
|
|
|
- // 更新为真实订阅链接
|
|
|
- await testSubscription.update({
|
|
|
- url: 'http://so.xfxssr.me/api/v1/client/subscribe?token=7854d59f38ac51700730b9e782c5160c',
|
|
|
- name: '真实订阅'
|
|
|
- });
|
|
|
-
|
|
|
- console.log('订阅更新成功!');
|
|
|
- console.log(`ID: ${testSubscription.id}`);
|
|
|
- console.log(`新名称: ${testSubscription.name}`);
|
|
|
- console.log(`新URL: ${testSubscription.url}`);
|
|
|
- } else {
|
|
|
- console.log('未找到测试订阅配置');
|
|
|
-
|
|
|
- // 如果没有找到,创建一个新的真实订阅
|
|
|
- const newSubscription = await Subscription.create({
|
|
|
- name: '真实订阅',
|
|
|
- url: 'http://so.xfxssr.me/api/v1/client/subscribe?token=7854d59f38ac51700730b9e782c5160c',
|
|
|
- isActive: true,
|
|
|
- speedTestInterval: 3600000, // 1小时
|
|
|
- notificationEnabled: true
|
|
|
- });
|
|
|
-
|
|
|
- console.log('创建新的真实订阅配置成功!');
|
|
|
- console.log(`ID: ${newSubscription.id}`);
|
|
|
- console.log(`名称: ${newSubscription.name}`);
|
|
|
- console.log(`URL: ${newSubscription.url}`);
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.error('更新订阅配置失败:', error.message);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-updateSubscription();
|