feat: refine login flows and integrate tiangong worship audio

This commit is contained in:
zhouzhibo committed 2026-10-18 23:35:28 +08:00
1 parent bc7bbc52c8
commit 38fc4187ea
49 files changed
+1786 -224

No files matched your search

+29
View File
@@ -81,6 +81,35 @@ test('无登录凭证不发送个人资料请求;401清除缓存并同步所
unsubscribe()
})
test('生日阳历日期与农历显示偏好一起保存并从接口回显', async () => {
const ctx = setup()
const original = await ctx.service.api.profile()
const form = { ...ctx.editing.toEditableProfile(original), birthdayCalendar: 'lunar' }
const saved = await ctx.editing.saveProfileEdits(original, form, '', ctx.service.api, () => {})
const request = ctx.calls.find(call => call.method === 'PUT')
assert.equal(request.data.birthday, original.birthday)
assert.equal(request.data.birthdayCalendar, 'lunar')
assert.equal(saved.profile.birthdayCalendar, 'lunar')
const reloaded = ctx.editing.toEditableProfile(await ctx.service.api.profile(true))
assert.equal(reloaded.birthdayCalendar, 'lunar')
assert.equal(reloaded.birthday, original.birthday)
const before = ctx.calls.length
const unchanged = await ctx.editing.saveProfileEdits(saved.profile, reloaded, '', ctx.service.api, () => {})
assert.equal(unchanged.changed, false)
assert.equal(ctx.calls.length, before)
})
test('登录校验只复用同token的有效资料,账号切换与退出后立即失效', async () => {
const ctx = setup()
assert.equal(ctx.service.getFreshCachedProfile(), null)
await ctx.service.api.profile()
assert.equal(ctx.service.getFreshCachedProfile().id, fullProfile.id)
ctx.storage.token = 'another-session'
assert.equal(ctx.service.getFreshCachedProfile(), null)
ctx.service.clearLogin()
assert.equal(ctx.service.getFreshCachedProfile(), null)
})
test('头像经专用COS后端接口上传,Bearer字段正确,禁止H5跨域Cookie', async () => {
const ctx = setup()
const updates = []