升级 AppStore 缓存 Key 并在覆盖安装时强制重新登录。
统一账号作用域 Key 对齐 Android,新增缓存 schema 迁移清理旧数据,并同步更新相关模块与单元测试。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -38,14 +38,26 @@ final class HomeCommonMenuStoreTests: XCTestCase {
|
||||
HomePermissionItem(id: "3", name: "任务", uri: "task_management"),
|
||||
]
|
||||
let allMenus = HomeMenuCatalog.visibleMenus(from: permissions)
|
||||
store.saveCommonURIs(["cloud_management"], accountScope: "u1_scenic_user", roleCode: "photographer")
|
||||
store.saveCommonURIs(["cloud_management"], accountScope: "scenic_user_u1", roleCode: "photographer")
|
||||
let common = store.commonMenus(
|
||||
from: allMenus,
|
||||
permissions: permissions,
|
||||
accountScope: "u1_scenic_user",
|
||||
accountScope: "scenic_user_u1",
|
||||
roleCode: "photographer"
|
||||
)
|
||||
XCTAssertEqual(common.map(\.uri), ["cloud_management"])
|
||||
XCTAssertEqual(
|
||||
defaults.stringArray(forKey: "scenic_user_u1_role_photographer_common_uris"),
|
||||
["cloud_management"]
|
||||
)
|
||||
}
|
||||
|
||||
func testIncompleteScopeDoesNotPersistCommonURIs() {
|
||||
store.saveCommonURIs(["wallet"], accountScope: "", roleCode: "photographer")
|
||||
store.saveCommonURIs(["wallet"], accountScope: "scenic_user_u1", roleCode: "")
|
||||
|
||||
XCTAssertNil(defaults.object(forKey: "_role_photographer_common_uris"))
|
||||
XCTAssertNil(defaults.object(forKey: "scenic_user_u1_role__common_uris"))
|
||||
}
|
||||
|
||||
func testSplitMenusSeparatesCommonAndMore() {
|
||||
|
||||
Reference in New Issue
Block a user