Files
hzhub/hzhub-portal-employee/src/pages/login/index.vue
大壮 226f119607 feat: 完善员工门户功能及ERP集成
主要修改:
- 完善员工门户CRM模块(经销商、线索管理)
- 添加ERP客户选择器集成
- 优化登录认证和租户选择
- 添加超时配置、企业微信集成等文档
- 更新docker-compose配置
- 将.pid临时文件加入gitignore

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 09:46:54 +00:00

164 lines
3.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { computed } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import TenantAccountPassword from './components/TenantAccountPassword.vue';
const router = useRouter();
const route = useRoute();
// 租户ID到公司名称的映射
const tenantNameMap: Record<string, string> = {
'000001': '集团总部',
'000002': '汇亚公司',
'000003': '恒福公司',
'000004': '玛缇公司',
};
// 从URL参数获取租户ID并映射到公司名称
const companyName = computed(() => {
const tenantId = route.query.tenant as string;
return tenantId ? tenantNameMap[tenantId] || 'HZHub' : 'HZHub';
});
function handleLoginSuccess() {
// 登录成功后跳转到首页或 redirect 页面
const redirect = router.currentRoute.value.query.redirect as string;
router.push(redirect || '/');
}
</script>
<template>
<div class="login-page">
<div class="login-container">
<div class="left-section">
<div class="logo-wrap">
<svg width="40" height="40" viewBox="0 0 28 28" fill="none">
<rect width="28" height="28" rx="8" fill="#1d5af3" />
<path d="M8 14L12 10L16 14L20 10" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
<path d="M8 18L12 14L16 18L20 14" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" opacity="0.5" />
</svg>
<span class="logo-text">{{ companyName }} 企业员工门户</span>
</div>
<div class="ad-banner">
<el-icon :size="200" color="#1d5af3">
<User />
</el-icon>
</div>
</div>
<div class="right-section">
<div class="content-wrapper">
<div class="form-container">
<span class="content-title">登录后访问完整功能</span>
<el-divider content-position="center">
账号密码登录
</el-divider>
<TenantAccountPassword @success="handleLoginSuccess" />
</div>
</div>
</div>
</div>
</div>
</template>
<style scoped lang="scss">
.login-page {
display: flex;
align-items: center;
justify-content: center;
width: 100vw;
height: 100vh;
background: linear-gradient(135deg, #f5f3f0 0%, #e8e6e1 100%);
}
.login-container {
display: flex;
width: 738px;
max-width: 90%;
height: 416px;
overflow: hidden;
background-color: #fff;
border-radius: 24px;
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}
.left-section {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 50%;
padding: 32px;
background: linear-gradient(233deg, rgba(113, 161, 255, 0.6) 17.67%, rgba(154, 219, 255, 0.6) 70.4%);
.logo-wrap {
display: flex;
gap: 12px;
align-items: center;
margin-bottom: 32px;
}
.logo-text {
font-size: 18px;
font-weight: 700;
color: #1a1a2e;
}
.ad-banner {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 250px;
}
}
.right-section {
display: flex;
flex-direction: column;
width: 50%;
padding: 32px;
.content-wrapper {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
width: 100%;
}
.content-title {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
font-size: 20px;
font-weight: 700;
color: var(--color-text-primary);
}
.form-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
max-width: 320px;
}
}
@media (width <= 800px) {
.left-section {
display: none !important;
}
.login-container {
height: auto;
min-height: 400px;
}
.right-section {
width: 100%;
}
}
</style>