fix: 沉默期提醒每次登录都弹,有未支付延期订单时提示去支付或作废
Some checks failed
构建并部署前端到测试环境 / build-and-deploy (push) Has been cancelled
Some checks failed
构建并部署前端到测试环境 / build-and-deploy (push) Has been cancelled
- 频率从每天一次改为每次登录一次:重新登录后会再次提醒,同一次登录内回首页不重复 - 已过期套餐有未支付延期订单时,弹窗提示继续支付或作废
This commit is contained in:
@@ -164,6 +164,18 @@ export const pickSilenceReminder = (items, now = Date.now()) => {
|
||||
return null;
|
||||
};
|
||||
|
||||
/** 每个资产、每笔套餐、每种提醒每天最多弹一次的存储键 */
|
||||
export const silenceReminderKey = (identifier, reminder, day) =>
|
||||
`silence_reminder:${identifier}:${reminder.packageUsageId}:${reminder.kind}:${day}`;
|
||||
const shortHash = (value) => {
|
||||
let hash = 0;
|
||||
const text = String(value || '');
|
||||
for (let index = 0; index < text.length; index++) {
|
||||
hash = (hash * 31 + text.charCodeAt(index)) | 0;
|
||||
}
|
||||
return (hash >>> 0).toString(36);
|
||||
};
|
||||
|
||||
/**
|
||||
* 每次登录、每个资产、每笔套餐、每种提醒最多弹一次的存储键:
|
||||
* 带上登录凭证摘要,重新登录后会再次提醒;同一次登录内反复回首页不重复弹。
|
||||
*/
|
||||
export const silenceReminderKey = (identifier, reminder, sessionToken) =>
|
||||
`silence_reminder:${identifier}:${reminder.packageUsageId}:${reminder.kind}:${shortHash(sessionToken)}`;
|
||||
|
||||
Reference in New Issue
Block a user