1
This commit is contained in:
@@ -109,6 +109,7 @@ async function verifyRequest(body) {
|
||||
plan_id: sub.plan_id,
|
||||
subscription_id: sub.id,
|
||||
token_id: row.id,
|
||||
token_key: row.key || "",
|
||||
stat_month: statMonth,
|
||||
usage_snapshot: {
|
||||
msg_count: usageSvc.num(usageRow.msg_count),
|
||||
|
||||
@@ -36,7 +36,7 @@ async function findActiveSubscriptionForUser(userId) {
|
||||
}
|
||||
|
||||
async function createToken(body) {
|
||||
const { user_id, token_name, expire_at } = body;
|
||||
const { user_id, token_name, expire_at, key } = body;
|
||||
if (!user_id || !expire_at) throw new Error("缺少 user_id 或 expire_at");
|
||||
const u = await baseModel.biz_user.findByPk(user_id);
|
||||
if (!u) throw new Error("用户不存在");
|
||||
@@ -60,6 +60,7 @@ async function createToken(body) {
|
||||
user_id,
|
||||
plan_id,
|
||||
token_name: token_name || "default",
|
||||
key: key || null,
|
||||
token_hash,
|
||||
secret_cipher,
|
||||
status: "active",
|
||||
|
||||
Reference in New Issue
Block a user