904118851 před 4 měsíci
rodič
revize
754307e72f

+ 2 - 0
MESSAGE_DISPATCH/MESSAGE_DISPATCH.js

@@ -357,6 +357,8 @@ CMD.updateTimeConfig = function(){
         console.log("qi_mao_mf_token:",headers['n-token'])
         redis_help.setKeyValue("qi_mao_mf_token",headers['n-token'])
     })
+
+    require('../src/api/dz/dz_login').login()
 }
 //定时更新配置
 CMD.updateConfig = function(){

+ 5 - 0
logs/combined.log

@@ -2,3 +2,8 @@
 2025-04-14T16:34:18: > heiyan@1.0.0 start
 2025-04-14T16:34:18: > node tg_factory_main.js
 2025-04-14T16:34:18: 
+2025-04-22T18:14:02: 
+2025-04-22T18:14:02: > heiyan@1.0.0 start
+2025-04-22T18:14:02: > node tg_factory_main.js
+2025-04-22T18:14:02: 
+2025-04-22T18:14:05: Connected to Redis

+ 5 - 0
logs/out.log

@@ -2,3 +2,8 @@
 2025-04-14T16:34:18: > heiyan@1.0.0 start
 2025-04-14T16:34:18: > node tg_factory_main.js
 2025-04-14T16:34:18: 
+2025-04-22T18:14:02: 
+2025-04-22T18:14:02: > heiyan@1.0.0 start
+2025-04-22T18:14:02: > node tg_factory_main.js
+2025-04-22T18:14:02: 
+2025-04-22T18:14:05: Connected to Redis

+ 11 - 5
src/api/dz/dz_login.js

@@ -2,11 +2,14 @@ const axios = require('axios');
 const qs = require('querystring');
 const dns = require('dns').promises;
 const net = require('net');
+const tools = require('../../../tools');
+
+
 
 
 class AdminSession {
     constructor(options = {}) {
-        this.baseURL = 'https://admin.wqxsw.com';
+        this.baseURL = 'https://vip.wqxsw.com';
         this.dnsServers = options.dnsServers || ['8.8.8.8', '8.8.4.4', '223.5.5.5', '223.6.6.6'];
         this.maxRetries = options.maxRetries || 3;
         this.currentRetry = 0;
@@ -68,7 +71,7 @@ class AdminSession {
         return null;
     }
 
-    async login(username = 'zydx16', password = 'Xuan6963') {
+    async login(username = 'zydx3vip', password = 'Xuan6963') {
         try {
             // 先进行DNS检查
             let targetHost = this.baseURL;
@@ -89,7 +92,7 @@ class AdminSession {
 
             // 添加重要的请求头
             const headers = {
-                'Host': 'admin.wqxsw.com',
+                'Host': 'vip.wqxsw.com',
                 'Referer': `${this.baseURL}/admin/index/login?url=%2Fadmin%2Fnotice%2Findex%3Fref%3Daddtabs`,
                 'Cookie': 'PHPSESSID=vi938g4mfaqjeelunmjmfa68tn'
             };
@@ -110,8 +113,7 @@ class AdminSession {
                     }
                 }
             );
-
-            return response.data;
+            return [response.data,response.config.headers.Cookie];
         } catch (error) {
             if (this.currentRetry < this.maxRetries) {
                 this.currentRetry++;
@@ -148,7 +150,11 @@ async function main() {
     try {
         console.log('开始登录...');
         const result = await session.login();
+        if(result[0].code==1){
+            await tools.setDzCookie(result[1])
+        }
         console.log('登录结果:', result);
+
     } catch (error) {
         console.error('登录失败:', error.message);
         

+ 4 - 2
src/api/dz/dz_search_book.js

@@ -1,5 +1,5 @@
 const fetch = require('node-fetch');
-
+const tools = require('../../../tools')
 async function search_id(book_id) {
     try {
         // 构建查询参数
@@ -24,6 +24,7 @@ async function search_id(book_id) {
         url.searchParams.append('filter', filter);
         url.searchParams.append('op', op);
 
+        let cookit = await tools.getDzCookit()
         const response = await fetch(url.toString(), {
             method: 'GET',
             headers: {
@@ -31,11 +32,12 @@ async function search_id(book_id) {
                 'accept-language': 'zh-CN,zh;q=0.9',
                 'content-type': 'application/json',
                 'x-requested-with': 'XMLHttpRequest',
-                'cookie': 'PHPSESSID=7te5nqmg1emufuuroppnirch01; keeplogin=63010%7C604800%7C1745918436%7C6183691e96d5c7f016d912b325e653a4'
+                'cookie': `${cookit}`
             }
         });
 
         const data = await response.json();
+    
         let info = {
 
         }

binární
src/api/hy/qr.gif


binární
src/api/hy/qr_resized.gif


+ 6 - 2
tg_factory_main.js

@@ -35,8 +35,12 @@ let isInit = false
 if(config.isDebug){
     redis_help.connect( async (results)=>{
         if(results){
-            // let data = await require('./src/api/dz/dz_search_book').search_id('11010288676')
-            // console.log("data:",data)
+      
+            // require('./src/api/dz/dz_login').login()
+            // setTimeout(async ()=>{
+            //         let data = await require('./src/api/dz/dz_search_book').search_id('11010288676')
+            //         console.log("data:",data)
+            // },3000)
             // let totalWordSize = data.rows[0].totalWordSize
             // let totalChapterNum = data.rows[0].totalChapterNum
             // let book_info =  await require("./src/api/qm_mf/qm_mf_search_book").search_name("巧克力薄脆","爸妈地震中只救假千金,我离开后他们后悔了")

+ 8 - 0
tools.js

@@ -278,6 +278,14 @@ class tools {
         }
  
     }
+
+    async setDzCookie(cookit){
+       return this.redis_help.setKeyValue("DZ_COOKIT",cookit)
+    }
+
+    async getDzCookit(){
+        return this.redis_help.getKeyValue("DZ_COOKIT")
+    }
 }
 
 module.exports = new tools(require('./src/use_redis'));