|
|
@@ -43,6 +43,7 @@ const UnicomConstKey = {
|
|
|
TokenOnline: 'UnicomTokenOnline',
|
|
|
DesMobile: 'UnicomDesMobile',
|
|
|
OnlineData: 'UnicomOnlineData',
|
|
|
+ SignInTodayDate: 'UnicomSignInTodayDate',
|
|
|
};
|
|
|
|
|
|
let gRetBody;
|
|
|
@@ -108,17 +109,24 @@ async function tryDaySign() {
|
|
|
magicJS.notification.appendNotifyInfo(`🎉今日已签到,无需再次签到!`);
|
|
|
return;
|
|
|
}
|
|
|
- // let result = await doDaySign();
|
|
|
- // if (result) {
|
|
|
- // // 0002已签到
|
|
|
- // if (result.code === '0000') {
|
|
|
- // magicJS.notification.appendNotifyInfo(`🎉签到成功!`);
|
|
|
- // } else {
|
|
|
- // magicJS.notification.appendNotifyInfo(`❌签到失败,错误:${result.desc}`);
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // magicJS.notification.appendNotifyInfo(`🔴签到失败!`);
|
|
|
- // }
|
|
|
+ let lastDateStr = magicJS.data.read(UnicomConstKey.SignInTodayDate, null);
|
|
|
+ let nowDateStr = magicJS.formatDate(new Date(), 'yyyyMMdd');
|
|
|
+ if (nowDateStr == lastDateStr) {
|
|
|
+ magicJS.notification.appendNotifyInfo(`🎉今日已签到,无需再次签到!`);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let result = await doDaySign();
|
|
|
+ if (result) {
|
|
|
+ // 0002已签到
|
|
|
+ if (result.code === '0000') {
|
|
|
+ magicJS.data.write(UnicomConstKey.SignInTodayDate, nowDateStr);
|
|
|
+ magicJS.notification.appendNotifyInfo(`🎉签到成功!`);
|
|
|
+ } else {
|
|
|
+ magicJS.notification.appendNotifyInfo(`❌签到失败,错误:${result.desc}`);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ magicJS.notification.appendNotifyInfo(`🔴签到失败!`);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
async function checkNotifyUsage(userInfo, onlineData) {
|
|
|
@@ -296,7 +304,7 @@ async function queryUserInfoSeven(phoneNum = '16620077714') {
|
|
|
};
|
|
|
let cookieStr = magicJS.data.read(UnicomConstKey.Cookie, null);
|
|
|
let cachCookieDict = magicJS.parseCookies(cookieStr);
|
|
|
- let keys = ['acw_tc', 'a_token', 'ecs_token', 'enc_acc', 'jwt', 't3_token', 'third_token'];
|
|
|
+ let keys = ['acw_tc', 'ecs_acc', 'a_token', 'ecs_token', 'enc_acc', 'jwt', 't3_token', 'third_token'];
|
|
|
keys = ['jwt'];
|
|
|
for (let i = 0; i < keys.length; i++) {
|
|
|
const key = keys[i];
|
|
|
@@ -318,7 +326,7 @@ async function queryUserInfoSeven(phoneNum = '16620077714') {
|
|
|
'X-Tingyun': `c=A|uBuVhVARE0A`,
|
|
|
'Accept-Language': `zh-CN,zh-Hans;q=0.9`
|
|
|
};
|
|
|
- magicJS.logger.info(`queryUserInfoSeven Cookie=${JSON.stringify(headers['Cookie'])}`);
|
|
|
+ // magicJS.logger.info(`queryUserInfoSeven Cookie=${JSON.stringify(headers['Cookie'])}`);
|
|
|
let options = {
|
|
|
url: url,
|
|
|
headers: headers,
|