-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.js
127 lines (100 loc) · 3 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
const Common = require('./lib/common');
const Loader = require('./lib/loader');
const Logger = require('./lib/logger');
let conf = Common.getConf(__dirname);
let func = Common.getFunc();
const tag = Common.fileName( __filename, false );
const log = new Logger(tag);
// 清理日志;
log.clean( 5 );
process.env.UV_THREADPOOL_SIZE = 128;
console.log( '-------------' + Common.getTime() +'-------------' );
//消息推送,默认方法
if (!func || func == 'messager') {
const Messager = require('./src/messager');
let test = Common.getArgv('debug');
let klas = new Messager(conf, test);
}
//生成文件加载器
if (func == 'loader') {
let html = Common.getArgv('html', 'index.html');
let dist = Common.getArgv('dist', 'dist.js');
let klas = new Loader();
klas.init( html, dist );
}
//用户自主推送 (在用)
if (func == 'forward_new') {
const ForwardNew = require('./src/forward_new');
let klas = new ForwardNew(conf);
klas.init();
}
//多群消息源(在用)
if (func == 'groups_send') {
const GroupsSend = require('./src/groups_send');
let klas = new GroupsSend(conf);
klas.init();
}
//群消息SW(在用)
if (func == 'socket_send') {
const SocketSend = require('./src/socket_send');
let klas = new SocketSend(conf);
klas.init();
}
//朋友圈发送(在用,先转链后发送)
if (func == 'moment_send') {
const MomentSend = require('./src/moment_send');
let klas = new MomentSend(conf);
klas.init(func);
}
//营销素材发圈(在用)
if (func == 'moment_mtl') {
const MomentSend = require('./src/moment_send');
let klas = new MomentSend(conf);
klas.init( func );
}
//云课程
if (func == 'course') {
const Groups = require('./src/course');
let item = Common.getArgv('item', 'course');
let klas = new Course(conf);
klas.init( item );
}
//联系人
if (func == 'contact') {
const Account = require('./src/account');
let room = Common.getArgv('room');
let weixin = Common.getArgv('weixin', conf.wechat);
let klas = new Account(conf);
klas.contact( weixin, room );
}
//心跳
if (func == 'heartbeat') {
const Heartbeat = require('./src/heartbeat');
let klas = new Heartbeat(conf);
klas.init();
}
// 自动登陆
if (func == 'autologin') {
const AutoLogin = require('./src/autologin');
let klas = new AutoLogin(conf);
klas.init();
}
// 微信实例
if (func == 'instance') {
const wx = require('./lib/weixin');
let wxid = Common.getArgv('wxid', 'veryide');
let klas = new wx(conf.weixin, conf.reserve, conf.special);
let inst = klas.instance( 10008 ).GetProfile( wxid );
console.log( inst );
}
// 批量转链
if (func == 'transfer') {
const qs = require('querystring');
const req = require('./lib/request');
let url = conf.convert + '?' + qs.stringify( { 'member_id': 10008, 'product': 'true', 'roomid': '', 'lazy_time': Common.getTime(), 'source': 'yfd', 'external': '' } );
let txt = Common.getArgv('txt', '¥SSPV3XMlWRE¥');
console.log( url );
req.post( url, { 'content': txt }, (code, body) => {
console.log( code, body );
}, null, conf.options);
}