| | |
| | | }, { immediate: true }); |
| | | |
| | | const sidebarRouters = ref([]) |
| | | // function handleLogin() { |
| | | // proxy.$refs.loginRef.validate(valid => { |
| | | // if (valid) { |
| | | // loading.value = true; |
| | | // // 勾选了需要记住密码设置在 cookie 中设置记住用户名和密码 |
| | | // // if (loginForm.value.rememberMe) { |
| | | // Cookies.set("username", loginForm.value.username, { expires: 30 }); |
| | | // Cookies.set("password", encrypt(loginForm.value.password), { expires: 30 }); |
| | | // // Cookies.set("rememberMe", loginForm.value.rememberMe, { expires: 30 }); |
| | | // // } else { |
| | | // // 否则移除 |
| | | // // Cookies.remove("username"); |
| | | // // Cookies.remove("password"); |
| | | // // Cookies.remove("rememberMe"); |
| | | // // } |
| | | // // 调用action的登录方法 |
| | | // // loginForm.value.password = Base64.encode(loginForm.value.password) |
| | | // const param = { |
| | | // username: loginForm.value.username, |
| | | // password: Base64.encode(loginForm.value.password), |
| | | // code: loginForm.value.code, |
| | | // uuid: loginForm.value.uuid, |
| | | // identity: loginForm.value.role |
| | | // } |
| | | // userStore.login(param).then(() => { |
| | | // // const query = route.query; |
| | | // // const otherQueryParams = Object.keys(query).reduce((acc, cur) => { |
| | | // // if (cur !== "redirect") { |
| | | // // acc[cur] = query[cur]; |
| | | // // } |
| | | // // return acc; |
| | | // // }, {}); |
| | | // |
| | | // //暂时不分角色 |
| | | // // const userInfo = JSON.parse(Cookies.get('userInfo')) |
| | | // // if(userInfo.identity === 0 ) { |
| | | // // //监管用户(管理员) |
| | | // // sidebarRouters.value = menu.adminMenu |
| | | // // Cookies.set('routers',JSON.stringify(sidebarRouters.value)) |
| | | // // }else if(userInfo.identity === 1) { |
| | | // // sidebarRouters.value = menu.agencyMenu |
| | | // // Cookies.set('routers',JSON.stringify(sidebarRouters.value)) |
| | | // // } |
| | | // const userInfo = JSON.parse(Cookies.get('userInfo')) |
| | | // |
| | | // if(userInfo.userType === 0) { |
| | | // sidebarRouters.value = menu.adminMenu |
| | | // Cookies.set('routers',JSON.stringify(sidebarRouters.value)) |
| | | // }else if(userInfo.userType === 1){ |
| | | // const config = JSON.parse(Cookies.get('configInfo')) |
| | | // if(config){ |
| | | // if(config.useProd === 0){ |
| | | // sidebarRouters.value = menu.companyMenu.filter(item => item.path != '/finishedBasicInfo') |
| | | // }else { |
| | | // sidebarRouters.value = menu.companyMenu |
| | | // |
| | | // } |
| | | // }else { |
| | | // ElMessage.warning('请联系管理员完善企业配置') |
| | | // sidebarRouters.value = menu.companyMenu |
| | | // } |
| | | // Cookies.set('routers',JSON.stringify(sidebarRouters.value)) |
| | | // }else if(userInfo.userType === 2){ |
| | | // const config = JSON.parse(Cookies.get('configInfo')) |
| | | // if(config){ |
| | | // if(config.useProd === 0){ |
| | | // sidebarRouters.value = menu.commonMenu.filter(item => item.path != '/finishedBasicInfo') |
| | | // }else { |
| | | // sidebarRouters.value = menu.commonMenu |
| | | // } |
| | | // }else { |
| | | // // ElMessage.warning('请联系管理员完善企业配置') |
| | | // sidebarRouters.value = menu.commonMenu |
| | | // } |
| | | // Cookies.set('routers',JSON.stringify(sidebarRouters.value)) |
| | | // }else { |
| | | // ElMessage.warning('监管部门账号不可登录') |
| | | // loading.value = false |
| | | // return |
| | | // } |
| | | // let path = "" |
| | | // if(sidebarRouters.value[0].children && sidebarRouters.value[0].children.length > 0){ |
| | | // path = sidebarRouters.value[0].path + '/'+ sidebarRouters.value[0].children[0].path |
| | | // }else { |
| | | // path = sidebarRouters.value[0].path |
| | | // } |
| | | // |
| | | // router.push({ |
| | | // path: path |
| | | // }) |
| | | // // router.push({ path: redirect.value || "/", query: otherQueryParams }); |
| | | // }).catch(() => { |
| | | // loading.value = false; |
| | | // // 重新获取验证码 |
| | | // if (captchaEnabled.value) { |
| | | // getCode(); |
| | | // } |
| | | // }); |
| | | // } |
| | | // }); |
| | | // } |
| | | |
| | | function handleLogin() { |
| | | proxy.$refs.loginRef.validate(valid => { |
| | | if (valid) { |
| | |
| | | // 勾选了需要记住密码设置在 cookie 中设置记住用户名和密码 |
| | | // if (loginForm.value.rememberMe) { |
| | | Cookies.set("username", loginForm.value.username, { expires: 30 }); |
| | | Cookies.set("password", encrypt(loginForm.value.password), { expires: 30 }); |
| | | Cookies.set("password", loginForm.value.password, { expires: 30 }); |
| | | // Cookies.set("password", encrypt(loginForm.value.password), { expires: 30 }); |
| | | // Cookies.set("rememberMe", loginForm.value.rememberMe, { expires: 30 }); |
| | | // } else { |
| | | // 否则移除 |
| | |
| | | password: Base64.encode(loginForm.value.password), |
| | | code: loginForm.value.code, |
| | | uuid: loginForm.value.uuid, |
| | | identity: loginForm.value.role |
| | | } |
| | | userStore.login(param).then(() => { |
| | | // const query = route.query; |
| | | // const otherQueryParams = Object.keys(query).reduce((acc, cur) => { |
| | | // if (cur !== "redirect") { |
| | | // acc[cur] = query[cur]; |
| | | // } |
| | | // return acc; |
| | | // }, {}); |
| | | |
| | | //暂时不分角色 |
| | | // const userInfo = JSON.parse(Cookies.get('userInfo')) |
| | | // if(userInfo.identity === 0 ) { |
| | | // //监管用户(管理员) |
| | | // sidebarRouters.value = menu.adminMenu |
| | | // Cookies.set('routers',JSON.stringify(sidebarRouters.value)) |
| | | // }else if(userInfo.identity === 1) { |
| | | // sidebarRouters.value = menu.agencyMenu |
| | | // Cookies.set('routers',JSON.stringify(sidebarRouters.value)) |
| | | // } |
| | | const userInfo = JSON.parse(Cookies.get('userInfo')) |
| | | |
| | | if(userInfo.userType === 0) { |
| | | sidebarRouters.value = menu.adminMenu |
| | | Cookies.set('routers',JSON.stringify(sidebarRouters.value)) |
| | | }else if(userInfo.userType === 1){ |
| | | const config = JSON.parse(Cookies.get('configInfo')) |
| | | if(config){ |
| | | if(config.useProd === 0){ |
| | | sidebarRouters.value = menu.companyMenu.filter(item => item.path != '/finishedBasicInfo') |
| | | }else { |
| | | sidebarRouters.value = menu.companyMenu |
| | | |
| | | } |
| | | }else { |
| | | ElMessage.warning('请联系管理员完善企业配置') |
| | | sidebarRouters.value = menu.companyMenu |
| | | const query = route.query; |
| | | const otherQueryParams = Object.keys(query).reduce((acc, cur) => { |
| | | if (cur !== "redirect") { |
| | | acc[cur] = query[cur]; |
| | | } |
| | | Cookies.set('routers',JSON.stringify(sidebarRouters.value)) |
| | | }else if(userInfo.userType === 2){ |
| | | const config = JSON.parse(Cookies.get('configInfo')) |
| | | if(config){ |
| | | if(config.useProd === 0){ |
| | | sidebarRouters.value = menu.commonMenu.filter(item => item.path != '/finishedBasicInfo') |
| | | }else { |
| | | sidebarRouters.value = menu.commonMenu |
| | | } |
| | | }else { |
| | | // ElMessage.warning('请联系管理员完善企业配置') |
| | | sidebarRouters.value = menu.commonMenu |
| | | } |
| | | Cookies.set('routers',JSON.stringify(sidebarRouters.value)) |
| | | } |
| | | let path = "" |
| | | if(sidebarRouters.value[0].children && sidebarRouters.value[0].children.length > 0){ |
| | | path = sidebarRouters.value[0].path + '/'+ sidebarRouters.value[0].children[0].path |
| | | }else { |
| | | path = sidebarRouters.value[0].path |
| | | } |
| | | |
| | | router.push({ |
| | | path: path |
| | | }) |
| | | // router.push({ path: redirect.value || "/", query: otherQueryParams }); |
| | | return acc; |
| | | }, {}); |
| | | router.push({ path: redirect.value || "/", query: otherQueryParams }); |
| | | }).catch(() => { |
| | | loading.value = false; |
| | | // 重新获取验证码 |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function getCode() { |
| | | getCodeImg().then(res => { |
| | | // captchaEnabled.value = res.data.captchaEnabled |
| | |
| | | .content{ |
| | | display: flex; |
| | | min-width: 1200px; |
| | | min-height: 600px; |
| | | min-height: 560px; |
| | | border-radius: 16px; |
| | | background: url("../assets/images/logbox.jpg") no-repeat center; |
| | | background-size: cover; |
| | | box-shadow: 0 10px 20px rgba(0,0,0,.1); |
| | | transform: translateY(-50px); |
| | | position: relative; |
| | | } |
| | | @keyframes float { |
| | | 100% { |
| | | transform: translateX(0); |
| | | opacity: 100%; |
| | | -webkit-opacity: 100% |
| | | } |
| | | } |
| | | .imgBox { |
| | | width: 50%; |
| | | min-height: 600px; |
| | | min-height: 560px; |
| | | opacity: 0; |
| | | -webkit-opacity: 0; |
| | | transform: translateX(50px); |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | animation: float ease 0.6s 0.6s forwards; |
| | | } |
| | | .fromRow{ |
| | | width: 100%; |
| | |
| | | align-items: center; |
| | | background-repeat: no-repeat; |
| | | } |
| | | @keyframes showForm { |
| | | 100% { |
| | | transform: translateY(0); |
| | | opacity: 100%; |
| | | -webkit-opacity: 100% |
| | | } |
| | | } |
| | | .formBox{ |
| | | width: 50%; |
| | | height: 100%; |
| | | position: absolute; |
| | | right: 0; |
| | | top: -20px; |
| | | transform: translateY(30px); |
| | | opacity: 0; |
| | | -webkit-opacity: 0; |
| | | min-height: 600px; |
| | | border-radius: 0 16px 16px 0; |
| | | border-radius: 16px; |
| | | background: #fff; |
| | | padding: 30px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: center; |
| | | z-index: 999; |
| | | animation: showForm ease-in-out 0.6s forwards; |
| | | } |
| | | .loginTitle{ |
| | | width: 100%; |