packServer/backend/config/config.unittest.js
liufumingren 4f637f1307 feat(web): 微信小程序 code2Session 登录与账号绑定
- POST /api/web/auth/wechat/login:code 换 openid,已绑定直接签发令牌,
  未绑定自动建平台账号(首登标记 firstTime)
- bind / bindings / unbind:登录态下绑定、查询、解绑小程序账号
- wechat_mp_accounts 表 + 迁移;未配置 WX_MP_APPID/SECRET 时本地与单测走 mock
- 新增 cors 中间件(小程序 H5 预览直连后端;鉴权只靠 header 令牌,不依赖 cookie)
- 补充 wechat-mp 接口单测

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-21 00:47:11 +08:00

20 lines
454 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
/**
* 单测专用配置
*
* 只给内部接口放一个固定的运维令牌(`X-Internal-Token`),省得每个用例都去签 JWT;
* 真实环境请用环境变量 `INTERNAL_TOKEN` 注入,**不要用这个值**。
*/
module.exports = {
internal: {
token: 'test-internal-token',
},
// 单测没有真实小程序 appid:允许 `mock:<openid>` 走 mock 登录
wechat: {
mp: {
mock: true,
},
},
};