feat: 微信分享钩子全页面接入 + 订阅信息结构化映射 + JWT 错误处理加强

- client: 全部页面接入 onShareAppMessage/onShareTimeline 分享钩子
- client: login 页增强、profile 订阅展示优化
- client/stores: 订阅字段扁平结构映射为 subInfo(plan/expiresAt/startDate)
- server: auth 路由 JWT 无效/过期统一返回 401 未授权响应
- server: models/tests 同步更新
This commit is contained in:
Yuzhiran Dev
2026-09-04 11:47:29 +08:00
parent de8ca9c420
commit 66de1dc396
37 changed files with 2138 additions and 1830 deletions
+11 -6
View File
@@ -6,8 +6,8 @@
const BASE_URL = 'https://wdkj.yuzhiran.com.cn'
const DEV_URL = 'http://127.0.0.1:3001'
// 生产环境使用域名(SSL 已续期)
const API_BASE = 'https://wdkj.yuzhiran.com.cn'
// 开发环境走本地后端,生产环境使用线上域名
const API_BASE = import.meta.env.DEV ? DEV_URL : BASE_URL
/**
* 通用请求封装
@@ -54,8 +54,8 @@ export const authApi = {
request('POST', '/api/auth/user/login', loginData),
/** H5 注册 */
register: (email, password, nickName, verifyCode) =>
request('POST', '/api/auth/user/register', { email, password, nickName, verifyCode }),
register: (email, password, nickName, verifyCode, username) =>
request('POST', '/api/auth/user/register', { email, password, nickName, verifyCode, username }),
/** 获取当前用户 */
me: (token) =>
@@ -155,10 +155,15 @@ export const paymentApi = {
/** 获取商品列表 */
products: () =>
request('GET', '/api/payment/products'),
/** 创建订单 */
/** 创建订单(小程序支付) */
createOrder: (productId, token) =>
request('POST', '/api/payment/create-order', { productId }, token),
/** 创建H5支付订单 */
createH5Order: (productId, clientIp, token) =>
request('POST', '/api/payment/create-h5-order', { productId, clientIp }, token),
/** 验证支付结果 */
verify: (productId, orderNo, token) =>
request('POST', '/api/payment/verify', { productId, orderNo }, token),
}
/**