Add WeChat in-app JSAPI recharge for g2.tkmind.cn.
Use JSAPI with bound openid inside WeChat instead of QR long-press, and include related auth redirect and admin UX fixes. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1648,6 +1648,17 @@ export function createUserAuth(pool, options = {}) {
|
||||
return rows[0] ?? null;
|
||||
};
|
||||
|
||||
const getWechatOpenidForUser = async (userId, appId) => {
|
||||
const [rows] = await pool.query(
|
||||
`SELECT openid
|
||||
FROM h5_user_wechat_identities
|
||||
WHERE user_id = ? AND app_id = ?
|
||||
LIMIT 1`,
|
||||
[userId, appId],
|
||||
);
|
||||
return rows[0]?.openid ?? null;
|
||||
};
|
||||
|
||||
const bindWechatToUser = async ({
|
||||
userId,
|
||||
appId,
|
||||
@@ -2118,6 +2129,7 @@ export function createUserAuth(pool, options = {}) {
|
||||
completeWechatBindAccount,
|
||||
getWechatPendingBind,
|
||||
getWechatBindingStatus,
|
||||
getWechatOpenidForUser,
|
||||
resetPassword,
|
||||
verify,
|
||||
revoke,
|
||||
|
||||
Reference in New Issue
Block a user