Browse Source

电子表单模板信息存储调整为sessionStorage

cfort 1 năm trước cách đây
mục cha
commit
885a16154c
2 tập tin đã thay đổi với 15 bổ sung3 xóa
  1. 2 2
      src/store/modules/ibps/modules/user.js
  2. 13 1
      src/views/viewFile/template.vue

+ 2 - 2
src/store/modules/ibps/modules/user.js

@@ -75,9 +75,9 @@ export default {
                         const info = response.data
                         /**
                          * store 统一存储高权限角色,用于各模块校验附件下载权限
-                         * 初定角色为:系统管理角色、主任、质量负责人、文件管理负责人、文件管理员
+                         * 初定角色为:系统管理角色、主任、质量负责人、文件管理负责人、文件管理员,文件下载角色
                          */
-                        info.highRoles = ['xtgljs', 'syszr', 'zlfzr', 'wjglzzc', 'wjgly']
+                        info.highRoles = ['xtgljs', 'syszr', 'zlfzr', 'wjglzzc', 'wjgly', 'wjxzjs']
                         const { role = [] } = info || {}
                         const hasHighRole = role.some(item => info.highRoles.includes(item.alias))
                         // 用于文件预览页判定是否开启下载权限

+ 13 - 1
src/views/viewFile/template.vue

@@ -24,7 +24,19 @@ export default {
         }
     },
     mounted () {
-        const temp = localStorage.getItem('templateOption')
+        const url = (location.hash.match(/\?(.*)/) || [])[1] || ''
+        const params = {}
+        if (url) {
+            url.split('&').forEach(param => {
+                if (param.includes('=')) {
+                    const [key, value] = param.split('=')
+                    params[decodeURIComponent(key)] = decodeURIComponent(value)
+                }
+            })
+        }
+        const path = params.path
+        const temp = sessionStorage.getItem(decodeURIComponent(path))
+        // const temp = localStorage.getItem('templateOption')
         this.option = temp ? JSON.parse(temp) : {}
         if (this.$utils.isNotEmpty(this.option)) {
             this.setEditor(this.option)