修复账号切换后「我的」页当前账号展示错误,并统一举报摄影师首页 URI。

切换账号时以用户选中账号为准写入展示标题与业务作用域,避免沿用旧门店名称;同时将首页举报摄影师入口 URI 对齐为 report_photographer。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-01 17:21:04 +08:00
parent fcb86d43f5
commit 5ab9b1b324
23 changed files with 419 additions and 92 deletions

View File

@ -46,6 +46,32 @@ final class AccountContextTests: XCTestCase {
XCTAssertEqual(context.currentStore?.id, 20)
}
///
func testReplaceScopesExplicitSelectionClearsStoreForScenicAccount() {
let context = AccountContext()
context.replaceScopes(
scenic: [BusinessScope(id: 128, name: "伊犁那拉提景区-5A", kind: .scenic)],
stores: [BusinessScope(id: 37, name: "随心旅拍", kind: .store, parentScenicId: 128)],
currentScenicId: 128,
currentStoreId: 37,
explicitSelection: true
)
XCTAssertEqual(context.currentStore?.name, "随心旅拍")
context.applyLogin(accountType: V9ScenicUser.accountTypeValue, businessUserId: 41, displayTitle: "伊犁那拉提景区-5A")
context.replaceScopes(
scenic: [BusinessScope(id: 128, name: "伊犁那拉提景区-5A", kind: .scenic)],
stores: [BusinessScope(id: 37, name: "随心旅拍", kind: .store, parentScenicId: 128)],
currentScenicId: 128,
currentStoreId: nil,
explicitSelection: true
)
XCTAssertEqual(context.accountType, V9ScenicUser.accountTypeValue)
XCTAssertNil(context.currentStore)
XCTAssertEqual(context.currentAccountDisplayTitle, "伊犁那拉提景区-5A")
}
/// ID 退
func testReplaceScopesFallsBackToFirstScopeWhenCachedIdIsMissing() {
let context = AccountContext()