feat: 用户多应用成员关系与微信扫码登录
- 新增 user_app / user_identity 模型、应用注册表与成员关系服务,启动时校验配置覆盖 - 新增微信开放平台扫码登录:二维码地址、回调与 ticket 换取 token - 管理端接口改为路由层声明 appIds + 角色鉴权,新增批量用户信息、锁定、授权与个人配置 - 删除账号同步清理成员关系与外部身份,避免关系被新账号复用 - 补充多应用、应用配置、注册表测试与迁移/建号脚本
This commit is contained in:
+6
-2
@@ -24,6 +24,10 @@ describe('用户接口集成测试', () => {
|
||||
await DBModel.User.delUser(userId);
|
||||
}
|
||||
app.stop();
|
||||
// 关闭数据库连接,否则 node --test 进程不会退出
|
||||
if (DBModel.dbConnection) {
|
||||
await DBModel.dbConnection.close();
|
||||
}
|
||||
});
|
||||
|
||||
describe('POST /user/register', () => {
|
||||
@@ -194,12 +198,12 @@ describe('用户接口集成测试', () => {
|
||||
assert.equal(res.body.data.user.profile.name, '更新后的名字');
|
||||
});
|
||||
|
||||
it('无 token 更新应返回 400', async () => {
|
||||
it('无 token 更新应返回 401', async () => {
|
||||
const res = await agent
|
||||
.post('/user/update')
|
||||
.send({ profile: { name: 'test' } });
|
||||
|
||||
assert.equal(res.body.code, 400);
|
||||
assert.equal(res.body.code, 401);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user