Browse Source

修改注册

zs 8 months ago
parent
commit
9cf01a3437
2 changed files with 12 additions and 10 deletions
  1. 10 7
      src/components/custom/custom-layout.vue
  2. 2 3
      src/views/login/parts/register.vue

+ 10 - 7
src/components/custom/custom-layout.vue

@@ -65,7 +65,7 @@
               </div>
             </el-col>
           </div> -->
-          <div class="info_2" v-if="info.key == '10'">
+          <div class="info_2" :class="[user && user.id && isIncubator ? 'info_3' : '']" v-if="info.key == '10'">
             <el-col :span="24" class="list_2">
               <div v-for="(tag, indexs) in info.children" :key="indexs" class="title1" @click="selectMenu(tag.route)">
                 {{ tag.title }}
@@ -121,6 +121,7 @@ const configInfo = ref({})
 const footInfos = ref({})
 const data = ref([])
 const info = ref({})
+const isIncubator = ref(false)
 // 请求
 onMounted(async () => {
   search()
@@ -131,13 +132,12 @@ const search = async () => {
     else val.hover = false
   }
   let menus = cloneDeep(menuList)
-  // 判断,如果没有孵化器角色,则不显示孵化器菜单
-  let isIncubator = false
+  // 判断, 如果没有孵化器角色, 则不显示孵化器菜单
   if (user.value) {
-    const hasIncubator = get(user, 'role', []).find((f) => f === 'Incubator')
-    if (hasIncubator) isIncubator = true
+    const hasIncubator = get(user.value, 'role', []).find((f) => f === 'Incubator')
+    if (hasIncubator) isIncubator.value = true
   }
-  if (!isIncubator) menus = menus.filter((f) => f.key !== '11')
+  if (!isIncubator.value) menus = menus.filter((f) => f.key !== '11')
   data.value = menus
 
   // 基础设置
@@ -301,7 +301,7 @@ const toOut = () => {
         }
         .info_2 {
           position: absolute;
-          left: 68.1%;
+          left: 73.3%;
           top: 128px;
           display: flex;
           padding: 10px 0;
@@ -323,6 +323,9 @@ const toOut = () => {
             }
           }
         }
+        .info_3 {
+          left: 68.1%;
+        }
       }
     }
   }

+ 2 - 3
src/views/login/parts/register.vue

@@ -84,7 +84,7 @@ const form = ref({ role: ['User'] })
 const ruleFormRef = ref()
 const roleList = inject('roleList')
 // 用户协议
-const isAgree = ref(false)
+const isAgree = ref(true)
 const plateList = ref([
   { label: '汽车电子及新型汽车零部件', value: '0' },
   { label: '精细化工及天然气化工', value: '1' },
@@ -137,8 +137,6 @@ const submitForm = async (formEl) => {
       if (user.total === 0) {
         data.account = data.nick_name
         data.gender = '0'
-        if (data.role === 'User') data.role = [data.role]
-        else data.role = ['User', ...[data.role]]
         delete data.refpassword
         delete data.checkCode
         delete data.plate
@@ -149,6 +147,7 @@ const submitForm = async (formEl) => {
             message: '注册用户成功,审核中请稍后登录',
             type: 'success'
           })
+          form.value = { role: ['User'] }
           router.push({ path: '/login' })
         }
       } else {