@@ -42,7 +42,6 @@ function loginapp() {
4242 const url = { url : VAL_loginurl , headers : JSON . parse ( VAL_loginheader ) }
4343 chavy . post ( url , ( error , response , data ) => {
4444 try {
45- updateSignAppCookies ( response . headers [ 'Set-Cookie' ] )
4645 resolve ( )
4746 } catch ( e ) {
4847 chavy . msg ( cookieName , `登录结果: 失败` , `说明: ${ e } ` )
@@ -54,35 +53,10 @@ function loginapp() {
5453 } )
5554}
5655
57- function updateSignAppCookies ( respcookie ) {
58- if ( VAL_signheader ) {
59- const OBJ_signheader = JSON . parse ( VAL_signheader )
60- let signcookie = OBJ_signheader [ 'Cookie' ]
61- signcookie = signcookie . replace ( / r o u t e 5 = ( [ ^ ; ] * ) / , respcookie . match ( / r o u t e 5 = ( [ ^ ; ] * ) / ) [ 0 ] )
62- signcookie = signcookie . replace ( / J S E S S I O N I D = ( [ ^ ; ] * ) / , respcookie . match ( / J S E S S I O N I D = ( [ ^ ; ] * ) / ) [ 0 ] )
63- OBJ_signheader [ 'Cookie' ] = signcookie
64- VAL_signheader = JSON . stringify ( OBJ_signheader )
65- } else {
66- chavy . log ( `⚠ ${ cookieName } updateSignAppCookies: 请先获取 Cookies` )
67- }
68- }
69-
70- function updateLotteryAppCookies ( respcookie ) {
71- if ( VAL_lotteryheader ) {
72- const OBJ_lotteryheader = JSON . parse ( VAL_lotteryheader )
73- let lotterycookie = OBJ_lotteryheader [ 'Cookie' ]
74- lotterycookie = lotterycookie . replace ( / r o u t e 5 = ( [ ^ ; ] * ) / , respcookie . match ( / r o u t e 5 = ( [ ^ ; ] * ) / ) [ 0 ] )
75- lotterycookie = lotterycookie . replace ( / J S E S S I O N I D = ( [ ^ ; ] * ) / , respcookie . match ( / J S E S S I O N I D = ( [ ^ ; ] * ) / ) [ 0 ] )
76- OBJ_lotteryheader [ 'Cookie' ] = lotterycookie
77- VAL_lotteryheader = JSON . stringify ( OBJ_lotteryheader )
78- } else {
79- chavy . log ( `⚠ ${ cookieName } updatelotteryAppCookies: 请先获取 Cookies` )
80- }
81- }
82-
8356function signapp ( ) {
8457 return new Promise ( ( resolve , reject ) => {
85- const url = { url : VAL_signurl , body : '{}' , headers : JSON . parse ( VAL_signheader ) }
58+ if ( VAL_signurl . endsWith ( '.do' ) ) VAL_signurl = VAL_signurl . replace ( '.do' , '' )
59+ const url = { url : 'https://act.10010.com/SigninApp/signin/daySign' , headers : JSON . parse ( VAL_signheader ) }
8660 chavy . post ( url , ( error , response , data ) => {
8761 try {
8862 signinfo . signapp = JSON . parse ( data )
@@ -105,7 +79,6 @@ function loginlottery() {
10579 const encryptmobileMatch = data . match ( / e n c r y p t m o b i l e = ( [ ^ ( ' | " ) ] * ) / )
10680 if ( encryptmobileMatch ) {
10781 signinfo . encryptmobile = encryptmobileMatch [ 1 ]
108- chavy . log ( `❌ ${ cookieName } loginlottery - encryptmobile: ${ signinfo . encryptmobile } ` )
10982 } else {
11083 chavy . msg ( cookieName , `获取抽奖令牌: 失败` , `说明: ${ e } ` )
11184 chavy . log ( `❌ ${ cookieName } loginlottery - 获取抽奖令牌失败: ${ e } ` )
@@ -124,14 +97,11 @@ function loginlottery() {
12497
12598function findlottery ( ) {
12699 return new Promise ( ( resolve , reject ) => {
127- chavy . log ( `❌ ${ cookieName } findlottery - OLD - VAL_findlotteryurl: ${ VAL_findlotteryurl } }` )
128100 VAL_findlotteryurl = VAL_findlotteryurl . replace ( / e n c r y p t m o b i l e = [ ^ ( & | $ ) ] * / , `encryptmobile=${ signinfo . encryptmobile } ` )
129101 VAL_findlotteryurl = VAL_findlotteryurl . replace ( / m o b i l e = [ ^ ( & | $ ) ] * / , `mobile=${ signinfo . encryptmobile } ` )
130- chavy . log ( `❌ ${ cookieName } findlottery - NEW - VAL_findlotteryurl: ${ VAL_findlotteryurl } }` )
131102 const url = { url : VAL_findlotteryurl , headers : JSON . parse ( VAL_findlotteryheader ) }
132103 chavy . get ( url , ( error , response , data ) => {
133104 try {
134- chavy . log ( `❌ ${ cookieName } findlottery - response: ${ JSON . stringify ( response ) } ` )
135105 signinfo . findlottery = JSON . parse ( data )
136106 resolve ( )
137107 } catch ( e ) {
@@ -150,7 +120,6 @@ function lottery() {
150120 url . headers [ 'Referer' ] = `https://m.client.10010.com/dailylottery/static/doubleball/firstpage?encryptmobile=${ signinfo . encryptmobile } `
151121 chavy . post ( url , ( error , response , data ) => {
152122 try {
153- chavy . log ( `❌ ${ cookieName } lottery - response: ${ JSON . stringify ( response ) } ` )
154123 signinfo . lotterylist = signinfo . lotterylist ? signinfo . lotterylist : [ ]
155124 signinfo . lotterylist . push ( JSON . parse ( data ) )
156125 resolve ( )
@@ -194,44 +163,41 @@ function getinfo() {
194163function showmsg ( ) {
195164 let subTitle = ''
196165 let detail = ''
197- let signday = ''
198166
199167 // 签到结果
200- if ( signinfo . signapp . msgCode == '0000' ) {
168+ if ( signinfo . signapp . signinMedal ) {
201169 subTitle = `签到: 成功`
202- signday = `; 连签: ${ signinfo . signapp . continuCount } 天`
203- detail = `连签: ${ signinfo . signapp . continuCount } 天, 积分: +${ signinfo . signapp . prizeCount } `
204- } else if ( signinfo . signapp . msgCode == '0008' ) {
170+ detail = `积分: +${ signinfo . signapp . prizeCount } , 成长值: +${ signinfo . signapp . growthV } , 鲜花: +${ signinfo . signapp . flowerCount } `
171+ } else if ( JSON . stringify ( signinfo . signapp ) == '{}' ) {
205172 subTitle = `签到: 重复`
206173 } else {
207174 subTitle = `签到: 失败`
175+ chavy . log ( `❌ ${ cookieName } signapp - response: ${ JSON . stringify ( signinfo . signapp ) } ` )
208176 }
209177
210178 if ( signinfo . info . code == '0000' ) {
211179 // 基本信息
212- subTitle += signday
213180 detail = detail ? `${ detail } \n` : ``
214181 const free = signinfo . info . dataList [ 0 ]
215182 const flow = signinfo . info . dataList [ 1 ]
216183 const voice = signinfo . info . dataList [ 2 ]
217184 detail = `话费: ${ free . number } ${ free . unit } , 已用: ${ flow . number } ${ flow . unit } , 剩余: ${ voice . number } ${ voice . unit } `
185+ } else {
186+ chavy . log ( `❌ ${ cookieName } signapp - response: ${ JSON . stringify ( signinfo . info ) } ` )
218187 }
219188
220189 if ( signinfo . findlottery && signinfo . findlottery . acFrequency && signinfo . lotterylist ) {
221190 subTitle += `; 抽奖: ${ signinfo . findlottery . acFrequency . usableAcFreq } 次`
222- detail += '\n查看抽奖详情 \n'
191+ detail += '\n查看详情 \n'
223192
224193 for ( let i = 0 ; i < signinfo . findlottery . acFrequency . usableAcFreq ; i ++ ) {
225- detail += `\n抽奖 (${ i } ): ${ signinfo . lotterylist [ i ] . RspMsg } `
194+ detail += `\n抽奖 (${ i + 1 } ): ${ signinfo . lotterylist [ i ] . RspMsg } `
226195 }
196+ } else {
197+ chavy . log ( `❌ ${ cookieName } signapp - response: ${ JSON . stringify ( signinfo . findlottery ) } ` )
227198 }
228199
229- // 详细信息
230- // if (signinfo.detail.code == '0000') {
231- // }
232-
233200 chavy . msg ( cookieName , subTitle , detail )
234- chavy . done ( )
235201}
236202
237203function init ( ) {
0 commit comments