@@ -4,7 +4,7 @@ const cookieVal = $persistentStore.read(cookieKey)
44
55function sign ( ) {
66 let url = {
7- url : `https://zhiyou.smzdm.com/user/checkin/jsonp_checkin?callback=jQuery112405819534189067781_1474859317229&_=1474859317231 ` ,
7+ url : `https://zhiyou.smzdm.com/user/checkin/jsonp_checkin` ,
88 headers : {
99 Cookie : cookieVal
1010 }
@@ -13,8 +13,21 @@ function sign() {
1313 url . headers [ 'User-Agent' ] = 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.132 Safari/537.36'
1414
1515 $httpClient . get ( url , ( error , response , data ) => {
16- $notification . post ( cookieName , '签到结果: 未知' , '详见日志' )
17- console . log ( `${ cookieName } , error: ${ error } , response: ${ response } , data: ${ data } ` )
16+ let result = JSON . parse ( data )
17+ let title = `${ cookieName } `
18+ // 签到成功
19+ if ( result && result . data && result . error_code == 0 ) {
20+ let subTitle = `签到结果: 成功 (第${ result . data . rank } 名)`
21+ let detail = `累计: ${ result . data . checkin_num } 次, 经验: ${ result . data . exp } , 金币: ${ result . data . gold } `
22+ $notification . post ( title , subTitle , detail )
23+ }
24+ // 签到失败
25+ else {
26+ let subTitle = `签到结果: 失败`
27+ let detail = `请把日志中的输出反馈到Github`
28+ $notification . post ( title , subTitle , detail )
29+ }
30+ console . log ( `${ cookieName } , data: ${ data } ` )
1831 } )
1932
2033 $done ( { } )
0 commit comments