Commit 68af526532d23bdcd59791ac3cc09f8a9ef490cc

Authored by ww
1 parent e92ec172

perf: 优化组态权限控制

@@ -4290,7 +4290,7 @@ App.prototype.loadFile = function (id, sameWindow, file, success, force) { @@ -4290,7 +4290,7 @@ App.prototype.loadFile = function (id, sameWindow, file, success, force) {
4290 async function getRemoteData() { 4290 async function getRemoteData() {
4291 const { doGetConfigurationContent } = useContentData() 4291 const { doGetConfigurationContent } = useContentData()
4292 const { getAuthInfo } = useAuth?.() || {} 4292 const { getAuthInfo } = useAuth?.() || {}
4293 - 4293 +
4294 const platformInfo = getPlatformInfo() 4294 const platformInfo = getPlatformInfo()
4295 document.getElementById('first-text-animation-text').querySelector('text').innerHTML = platformInfo?.name || window.PROJECT_ENV?.shortName 4295 document.getElementById('first-text-animation-text').querySelector('text').innerHTML = platformInfo?.name || window.PROJECT_ENV?.shortName
4296 document.getElementById('first-text-animation').style.display = 'block' 4296 document.getElementById('first-text-animation').style.display = 'block'
@@ -4313,26 +4313,28 @@ App.prototype.loadFile = function (id, sameWindow, file, success, force) { @@ -4313,26 +4313,28 @@ App.prototype.loadFile = function (id, sameWindow, file, success, force) {
4313 * @property {ConfigurationContentListItemType[]} configurationContentList 4313 * @property {ConfigurationContentListItemType[]} configurationContentList
4314 */ 4314 */
4315 4315
4316 - /**  
4317 - * @typedef PermissionInfo  
4318 - * @property {string[]} permissions  
4319 - * @property {string} hasPreview  
4320 - * @property {string} platform  
4321 - * @property {ConfigurationContentListItemType[]} configurationContentList  
4322 - */  
4323 -  
4324 - /**  
4325 - * @type {PermissionInfo}  
4326 - */  
4327 - const permissionInfo = await getAuthInfo?.() || {}  
4328 -  
4329 - this.permissionInfo = permissionInfo 4316 + /**
  4317 + * @typedef PermissionInfo
  4318 + * @property {string[]} permissions
  4319 + * @property {string} hasPreview
  4320 + * @property {string} platform
  4321 + * @property {ConfigurationContentListItemType[]} configurationContentList
  4322 + */
4330 4323
4331 /** 4324 /**
4332 * @type {ConfigurationContentType} 4325 * @type {ConfigurationContentType}
4333 */ 4326 */
4334 const result = await doGetConfigurationContent() 4327 const result = await doGetConfigurationContent()
4335 const { configurationContentList, configurationId, configurationName, platform, isTemplate } = result 4328 const { configurationContentList, configurationId, configurationName, platform, isTemplate } = result
  4329 +
  4330 +
  4331 + /**
  4332 + * @type {PermissionInfo}
  4333 + */
  4334 + const permissionInfo = await getAuthInfo?.() || {}
  4335 +
  4336 + this.permissionInfo = permissionInfo
  4337 +
4336 const firstContent = configurationContentList?.[0] 4338 const firstContent = configurationContentList?.[0]
4337 this.configurationContentId = firstContent?.id 4339 this.configurationContentId = firstContent?.id
4338 this.isTemplateConfiguration = !!isTemplate 4340 this.isTemplateConfiguration = !!isTemplate
@@ -11,7 +11,6 @@ export function useAuth() { @@ -11,7 +11,6 @@ export function useAuth() {
11 const permissions = await getCurrentRolePermission() 11 const permissions = await getCurrentRolePermission()
12 result.permissions = permissions 12 result.permissions = permissions
13 const ret = contentDataStore.setPermissions(permissions) 13 const ret = contentDataStore.setPermissions(permissions)
14 -  
15 return { 14 return {
16 permissions, 15 permissions,
17 ...ret, 16 ...ret,