v1.10.3: 修「买完仍显示试用倒计时」与「到期时间显示永久」

根因:CardAuth 自动发卡只写 ca_cards(status=used + bind_info.machine_id),
从不写 ca_authorizations,而插件只查 /public/authorizations/query → 已购用户恒为空。

- checkLicense 增加卡密直验兜底:用本地记住的卡密调 /public/verify,
  返回 valid/expire_time/is_permanent,直接作为授权状态与到期时间
- activateCard 成功即持久化 activeCardKey + activeCardInfo(换机/过期自动清除)
- buy.js 不再用「永久」兜底到期时间(订单接口不返回 expire_time),
  改为只在服务端明确给出时显示,否则显示套餐名
- 侧边栏已授权态显示套餐名 + 真实到期时间
This commit is contained in:
jinghui committed 2026-10-20 23:32:43 +08:00
1 parent 99d1d1fe92
commit 226e4fbbf9
5 files changed
+81 -4

No files matched your search

+10 -1
View File
@@ -149,11 +149,20 @@ function showCardBox(key, activated) {
function showActivated(res) {
const status = $('order-status');
const permanent = !!res.isPermanent;
const exp = String(res.expireTime || '').trim();
const plan = String(res.planName || '').trim();
// 绝不默认「永久」:到期时间只在服务端明确给出时才显示
let expireLine;
if (permanent) expireLine = '到期时间:<b>永久</b>';
else if (exp) expireLine = '到期时间:<b>' + esc(exp) + '</b>';
else if (plan) expireLine = '套餐:<b>' + esc(plan) + '</b>(实际到期时间以插件侧边栏「已授权 · 到期 …」为准)';
else expireLine = '到期时间:以插件侧边栏显示为准';
status.className = 'order-status success';
status.innerHTML = `
<div class="ok-title">✓ 支付成功,已自动激活</div>
<div class="ok-line">卡密:<b>${esc(res.cardKey || '')}</b></div>
<div class="ok-line">到期时间:${esc(res.expireTime || '永久')}</div>
<div class="ok-line">${expireLine}</div>
<div class="ok-line muted">回到插件侧边栏即可使用全部功能(本机已授权)。</div>`;
}