模块化 AppStore 并完善素材管理与个人空间设置。
将会话、权限、位置、收款与排队存储拆分为独立模块,同步更新各 ViewModel 与单元测试,并补充素材管理 UI 与个人空间设置交互。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -27,10 +27,10 @@ final class AllFunctionsViewModel {
|
||||
|
||||
/// 加载全部功能并按常用配置拆分。
|
||||
func loadFunctions() {
|
||||
let permissions = appStore.permissionItems()
|
||||
let permissions = appStore.permissions.permissionItems()
|
||||
let allMenus = HomeMenuCatalog.visibleMenus(from: permissions)
|
||||
let accountScope = appStore.accountCachePrefix
|
||||
let roleCode = appStore.roleCode
|
||||
let accountScope = appStore.session.accountCachePrefix
|
||||
let roleCode = appStore.session.roleCode
|
||||
let savedURIs = commonMenuStore.savedCommonURIs(accountScope: accountScope, roleCode: roleCode)
|
||||
let defaultURIs = HomeCommonMenuStore.defaultCommonURIs(from: permissions)
|
||||
let commonURIs = savedURIs.isEmpty ? defaultURIs : savedURIs
|
||||
@ -71,8 +71,8 @@ final class AllFunctionsViewModel {
|
||||
private func persistCommonMenus() {
|
||||
commonMenuStore.saveCommonURIs(
|
||||
commonMenus.map(\.uri),
|
||||
accountScope: appStore.accountCachePrefix,
|
||||
roleCode: appStore.roleCode
|
||||
accountScope: appStore.session.accountCachePrefix,
|
||||
roleCode: appStore.session.roleCode
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user