|
@@ -105,7 +105,9 @@ async function tryDaySign() {
|
|
|
magicJS.notification.appendNotifyInfo(`🎉今日已签到,无需再次签到!`);
|
|
magicJS.notification.appendNotifyInfo(`🎉今日已签到,无需再次签到!`);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- await checkNotifyUsage(userInfo, onlineData);
|
|
|
|
|
|
|
+ if (userInfo) {
|
|
|
|
|
+ await checkNotifyUsage(userInfo, onlineData);
|
|
|
|
|
+ }
|
|
|
let result = await doDaySign();
|
|
let result = await doDaySign();
|
|
|
if (result) {
|
|
if (result) {
|
|
|
// 0002已签到
|
|
// 0002已签到
|
|
@@ -129,13 +131,19 @@ async function checkNotifyUsage(userInfo, onlineData) {
|
|
|
usageText = `${flush_date_time},使用情况:\n`;
|
|
usageText = `${flush_date_time},使用情况:\n`;
|
|
|
// 剩余话费
|
|
// 剩余话费
|
|
|
let feeResource = userInfo.feeResource;
|
|
let feeResource = userInfo.feeResource;
|
|
|
- usageText += `${feeResource.dynamicFeeTitle}:${feeResource.feePersent}${feeResource.newUnit}\n`;
|
|
|
|
|
|
|
+ if (feeResource) {
|
|
|
|
|
+ usageText += `${feeResource.dynamicFeeTitle}:${feeResource.feePersent}${feeResource.newUnit}\n`;
|
|
|
|
|
+ }
|
|
|
// 剩余流量
|
|
// 剩余流量
|
|
|
let flowResource = userInfo.flowResource;
|
|
let flowResource = userInfo.flowResource;
|
|
|
- usageText += `${flowResource.dynamicFlowTitle}:${flowResource.flowPersent}${flowResource.newUnit}\n`;
|
|
|
|
|
|
|
+ if (flowResource) {
|
|
|
|
|
+ usageText += `${flowResource.dynamicFlowTitle}:${flowResource.flowPersent}${flowResource.newUnit}\n`;
|
|
|
|
|
+ }
|
|
|
// 剩余语音
|
|
// 剩余语音
|
|
|
let voiceResource = userInfo.voiceResource;
|
|
let voiceResource = userInfo.voiceResource;
|
|
|
- usageText += `${voiceResource.dynamicVoiceTitle}:${voiceResource.voicePersent}${voiceResource.newUnit}\n`;
|
|
|
|
|
|
|
+ if (voiceResource) {
|
|
|
|
|
+ usageText += `${voiceResource.dynamicVoiceTitle}:${voiceResource.voicePersent}${voiceResource.newUnit}\n`;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
magicJS.notification.post(scriptName, "", usageText);
|
|
magicJS.notification.post(scriptName, "", usageText);
|
|
|
let sendRet = await magicJS.fastWxpusherSend(usageText, '联通手机使用情况');
|
|
let sendRet = await magicJS.fastWxpusherSend(usageText, '联通手机使用情况');
|