update 登录页修改

This commit is contained in:
2026-02-02 19:25:40 +08:00
parent e3fe9cd7b3
commit 3f424bdc1c
6 changed files with 234 additions and 30 deletions

1
src/assets/question.svg Normal file
View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1770030974855" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2552" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512.128 677.376c-19.296 0-38.496 7.936-52.16 21.568s-21.6 32.8-21.6 52.064 7.936 38.464 21.6 52.064c13.632 13.632 32.832 21.568 52.16 21.568s38.496-7.936 52.16-21.568c13.632-13.632 21.6-32.8 21.6-52.064s-7.936-38.464-21.6-52.064c-13.632-13.632-32.832-21.568-52.16-21.568z" fill="#409eff" p-id="2553"></path><path d="M511.36 213.312c-49.728 0-89.92 15.232-120.544 45.632-30.624 30.464-48.48 72.416-49.472 111.072s80.64 30.624 83.648 11.552c3.2-20.224 16.576-52.896 32.16-67.68s35.008-22.208 58.176-22.208c24.064 0 43.2 7.104 57.376 21.312s21.312 31.296 21.312 51.2c0 14.368-4.032 27.52-12 39.456-5.184 7.552-21.12 23.488-47.68 47.84s-44.352 46.272-53.184 65.728-13.312 44.288-13.312 74.496c0 2.88 0.096 11.072 0.32 24.448l82.784 0c-0.448-28.224 1.696-47.84 6.336-58.784 4.64-10.976 16.576-25.472 35.776-43.456 37.12-34.784 61.376-62.336 72.736-82.496 11.328-20.192 16.96-41.664 16.96-64.288 0-40.896-15.424-76.768-46.4-107.584s-72.576-46.24-124.928-46.24z" fill="#409eff" p-id="2554"></path><path d="M512 0c-282.208 0-512 229.664-512 512.032s229.728 511.968 512 511.968c282.304 0 512-229.6 512-511.968s-229.632-512.032-512-512.032zM511.68 958.912c-246.848 0-447.584-200.768-447.584-447.456 0-246.848 200.768-447.552 447.584-447.552s447.648 200.672 447.648 447.552c0.032 246.72-200.8 447.456-447.648 447.456z" fill="#409eff" p-id="2555"></path></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -1,4 +1,4 @@
import {RouteRecordRaw} from 'vue-router';
import { RouteRecordRaw } from 'vue-router';
import moduleRoutes from '/@/router/modules';
/**
@@ -51,7 +51,8 @@ export const staticRoutes: Array<RouteRecordRaw> = [
{
path: '/login',
name: 'staticRoutes.login',
component: () => import('/@/views/login/index.vue'),
// component: () => import('/@/views/login/index.vue'),
component: () => import('/@/views/login/lyricLogin.vue'),
meta: {
isAuth: false,
},
@@ -88,7 +89,8 @@ export const staticRoutes: Array<RouteRecordRaw> = [
isAuth: false,
},
},
{ // SPDM CODE
{
// SPDM CODE
path: '/tokenLogin',
name: 'staticRoutes.tokenLogin',
component: () => import('/@/spdm/views/tokenLogin.vue'),
@@ -96,7 +98,8 @@ export const staticRoutes: Array<RouteRecordRaw> = [
isAuth: false,
},
},
{ // SPDM CODE
{
// SPDM CODE
path: '/spdmApproval',
name: 'staticRoutes.spdmApproval',
component: () => import('/@/spdm/views/approval/index.vue'),

View File

@@ -4,9 +4,9 @@
// export const TENANT_NAME = 'base'; // 租户:基线
// 测试环境
export const SPDM_URL = 'http://192.168.65.161:3000'; // SPDM项目地址
export const BASE_URL = '/spdmApi/honeycom-spdm'; // baseUrl
export const TENANT_NAME = 'lyric'; // 租户:利元亨
// export const SPDM_URL = 'http://192.168.65.161:3000'; // SPDM项目地址
// export const BASE_URL = '/spdmApi/honeycom-spdm'; // baseUrl
// export const TENANT_NAME = 'lyric'; // 租户:利元亨
// // 利元亨内网环境
// export const SPDM_URL = 'http://192.168.30.147:7115'; // SPDM项目地址
@@ -14,6 +14,6 @@ export const TENANT_NAME = 'lyric'; // 租户:利元亨
// export const TENANT_NAME = 'lyric'; // 租户:利元亨
// // 本地环境
// export const SPDM_URL = 'http://192.168.65.64:3001'; // SPDM项目地址
// export const BASE_URL = '/spdmApi/honeycom-spdm'; // baseUrl
// export const TENANT_NAME = 'lyric'; // 租户:利元亨
export const SPDM_URL = 'http://192.168.65.61:3001'; // SPDM项目地址
export const BASE_URL = '/spdmApi/honeycom-spdm'; // baseUrl
export const TENANT_NAME = 'lyric'; // 租户:利元亨

View File

@@ -93,7 +93,7 @@ watchEffect(() => {
const router = useRouter();
const handleClick = (item: any) => {
if (['todayTmrTasks', 'inProgress', 'postponed'].includes(item.key)) {
localStorage.setItem('home_taskParams', item.key);
localStorage.setItem('HOME_TASK_PARAMS', item.key);
}
router.push(item.path);
};

View File

@@ -64,37 +64,63 @@
<div class="relative flex items-center justify-between">
<div class="text-sm ml-auto">
<!-- <a href="#" class="ml-2 text-primary hover:text-blue-600" @click="emit('change', LoginTypeEnum.MOBILE)"> {{ $t('component.password.091035-2') }} </a> -->
<a v-if="autoRegisterEnable && enableConfigByTenant(['base'])" href="#" class="ml-2 text-primary hover:text-blue-600" @click="emit('change', LoginTypeEnum.REGISTER)">
<a
v-if="autoRegisterEnable && enableConfigByTenant(['base'])"
href="#"
class="ml-2 text-primary hover:text-blue-600"
@click="emit('change', LoginTypeEnum.REGISTER)"
>
{{ $t('component.password.091035-3') }}
</a>
</div>
</div>
<div class="font12 mt30 login-animation4 login-msg text-center">{{ $t('browserMsgText') }}</div>
<div v-if="showBrowserMsgText" class="font12 mt30 login-animation4 login-msg text-center">{{ $t('browserMsgText') }}</div>
<div class="forget-pw">
<el-tooltip placement="right">
<template #content>
如忘记仿真数据管理平台密码可通过以下方式修改<br />
1进入即时通<br />
2进入工作台<br />
3点击仿真数据管理平台按钮进入仿真数据管理平台
</template>
<div class="password-tip">
<img src="/@/assets/question.svg" class="question-img" />
<span class="text">忘记密码</span>
</div>
</el-tooltip>
</div>
</el-form>
<Verify
@success="verifySuccess"
:mode="'pop'"
:captchaType="'blockPuzzle'"
v-if="verifyEnable"
:imgSize="{width: '330px', height: '155px'}"
:imgSize="{ width: '330px', height: '155px' }"
ref="verifyref"
/>
</template>
<script setup lang="ts" name="password">
import {defineAsyncComponent, reactive, ref} from 'vue';
import {useUserInfo} from '/@/stores/userInfo';
import {generateUUID} from '/@/utils/other';
import {LoginTypeEnum} from '/@/api/login';
import {rule} from '/@/utils/validate';
import {uploadFormat} from '/@/utils/commonFunction';
import {Session} from '/@/utils/storage';
import { defineAsyncComponent, reactive, ref } from 'vue';
import { useUserInfo } from '/@/stores/userInfo';
import { generateUUID } from '/@/utils/other';
import { LoginTypeEnum } from '/@/api/login';
import { rule } from '/@/utils/validate';
import { uploadFormat } from '/@/utils/commonFunction';
import { Session } from '/@/utils/storage';
import { useLocalStorage } from '@vueuse/core';
import { enableConfigByTenant } from '/@/spdm/utils/index'; // SPDM CODE
const props = defineProps({
showBrowserMsgText: {
type: Boolean,
default: true,
},
});
// 使用国际化插件
const {t} = useI18n();
const { t } = useI18n();
// 动态加载滑块验证码组件
const Verify = defineAsyncComponent(() => import('/@/components/Verifition/Verify.vue'));
@@ -115,16 +141,16 @@ const state = reactive({
account: '', // 工号
},
});
const isPhoneNum = (num:string) => {
const isPhoneNum = (num: string) => {
// 长度为11时做手机号格式判断
return num.length === 11;
}
const validatePhoneAndId = (rule1: any, value: any, callback: any, source:any, options:any) => {
if(!value) {
};
const validatePhoneAndId = (rule1: any, value: any, callback: any, source: any, options: any) => {
if (!value) {
callback(new Error(t('password.phoneAndJobCodePlaceholder')));
} else {
if (isPhoneNum(value)) {
rule.validatePhone?.(rule1, value, callback, source, options)
rule.validatePhone?.(rule1, value, callback, source, options);
} else {
callback();
}
@@ -132,8 +158,8 @@ const validatePhoneAndId = (rule1: any, value: any, callback: any, source:any, o
};
const loginRules = reactive({
username: [{required: true, trigger: 'blur', validator: validatePhoneAndId}], // 用户名校验规则
password: [{required: true, trigger: 'blur', message: t('password.accountPlaceholder2')}], // 密码校验规则
username: [{ required: true, trigger: 'blur', validator: validatePhoneAndId }], // 用户名校验规则
password: [{ required: true, trigger: 'blur', message: t('password.accountPlaceholder2') }], // 密码校验规则
});
const verifyref = ref<InstanceType<typeof Verify>>(null); // 定义verify组件引用
@@ -187,7 +213,6 @@ const onSignIn = async () => {
}
};
onMounted(() => {
// console.log('clear first');
// Session.clear();
@@ -196,3 +221,23 @@ onMounted(() => {
}
});
</script>
<style lang="scss" scoped>
.forget-pw {
display: flex;
justify-content: flex-end;
}
.question-img {
width: 14px;
height: 14px;
}
.password-tip {
display: flex;
align-items: center;
.text {
color: #409eff;
margin-left: 6px;
font-size: 12px;
}
}
</style>

View File

@@ -0,0 +1,155 @@
<template>
<div class="select-none w-screen h-screen">
<div class="tenant">
<!-- 租户选择 -->
<!-- <tenant /> -->
</div>
<div class="mini_qr">
<!-- 扫码体验移动端
<img :src="!themeConfig.miniQr ? miniQr:baseURL + themeConfig.miniQr"/>
<p>{{ t('scan.wechatApp') }}</p>-->
</div>
<!-- <img :src="bg" class="wave"/> -->
<div class="flex-c absolute right-5 top-3"></div>
<div class="login-container lyric-login-container">
<!-- <div class="img">
<img :src="!systemConfig.background ? illustration : baseURL + systemConfig.background" />
</div> -->
<el-scrollbar height="100vh">
<div class="login-box">
<div class="login-form">
<div class="mb-3 text-left">
<div class="spdm-login-logo">
<img class="logo" :src="systemConfig.logo" alt="" />
<div class="title">仿真流程与数据管理系统</div>
</div>
<!-- <img class="h-20" :src="systemConfig.logo" alt="" /> -->
<!-- <div class="mt-6 text-xl font-medium">Welcome back!</div> -->
<!-- <div class="my-4 text-lg hidden md:block">{{ systemConfig.globalTitle }}</div> -->
</div>
<password
v-if="loginType === LoginTypeEnum.PASSWORD"
:showBrowserMsgText="false"
@signInSuccess="signInSuccess"
@change="changeLoginType"
/>
<register v-else-if="loginType === LoginTypeEnum.REGISTER" @change="changeLoginType" />
<mobile v-else-if="loginType === LoginTypeEnum.MOBILE" @signInSuccess="signInSuccess" @change="changeLoginType" />
<div class="flex items-center justify-center space-x-2 my-5">
<span class="h-px w-16 bg-gray-100"></span>
<!-- <span class="text-gray-300 font-normal">or</span> -->
<span class="h-px w-16 bg-gray-100"></span>
</div>
<!-- <social @signInSuccess="signInSuccess"/> -->
</div>
</div>
</el-scrollbar>
<!-- <div class="flex-1 min-w-0 hidden md:block">
<img class="h-screen w-full object-cover" :src="enableConfigByTenant(['lyric']) ? lyricBgLogin : bgLogin" alt="" />
</div> -->
</div>
</div>
</template>
<script setup lang="ts" name="loginIndex">
import { onBeforeMount } from 'vue';
import bgLogin from '/@/assets/login/login-bg.jpg';
import lyricBgLogin from '/@/spdm/assets/imgs/login_lyric_bg.jpg';
// import illustration from '/@/assets/login/login_bg.svg';
// import bg from '/@/assets/login/bg.png';
// import miniQr from '/@/assets/login/mini_qr.png';
import { useThemeConfig } from '/@/stores/themeConfig';
import { useMessage } from '/@/hooks/message';
import { LoginTypeEnum } from '/@/api/login';
import { formatAxis } from '/@/utils/formatTime';
import { saveLogApi } from '/@/spdm/api/spdm-log'; // SPDM CODE
import Cookies from 'js-cookie';
import { useRoute } from 'vue-router';
import { useUserInfo } from '/@/stores/userInfo';
import { Token } from '/@/utils/storage';
import { isEmpty } from 'lodash';
import { enableConfigByTenant } from '/@/spdm/utils/index'; // SPDM CODE
// 引入组件
const Password = defineAsyncComponent(() => import('./component/password.vue'));
const Mobile = defineAsyncComponent(() => import('./component/mobile.vue'));
// const Social = defineAsyncComponent(() => import('./component/social.vue'));
const Register = defineAsyncComponent(() => import('./component/register_account.vue'));
// const Tenant = defineAsyncComponent(() => import('./component/tenant.vue'));
// 定义变量内容
const storesThemeConfig = useThemeConfig();
const { systemConfig } = storeToRefs(storesThemeConfig);
const { t } = useI18n();
const route = useRoute();
const router = useRouter();
// SPDM CODE
onBeforeMount(() => {
const route: any = useRoute();
const redirect = route.query?.redirect || '/home';
const query = JSON.parse(route?.query?.query || '{}');
if (query.dm_access_token) {
Token.set(query.dm_access_token);
useUserInfo().setUserInfos();
window.location.href = redirect;
}
});
// 登录方式
const loginType = ref(LoginTypeEnum.PASSWORD);
// 修改登录类型
const changeLoginType = (type: LoginTypeEnum) => {
loginType.value = type;
};
// 登录成功后的跳转处理事件
const signInSuccess = async () => {
// 初始化登录成功时间问候语
let currentTimeInfo = formatAxis(new Date());
// FIXME: 这里的跳转逻辑还需优化(如果换一个账号登录,有些账号会进到本没有权限的页面,按钮也能正常使用,例如项目详情页)临时改成直接跳转到首页
// if (route.query?.redirect) {
// // const redirectUri = URL.parse(route.query?.redirect as string, location.origin);
// const redirectUri = new URL(route.query?.redirect as string, location.origin);
// let redirectQuery: any = {};
// if (route.query?.query) {
// redirectQuery = JSON.parse(<string>route.query?.query);
// for (const [key, value] of Object.entries(redirectQuery)) {
// if (value) {
// redirectUri?.searchParams.set(key, value as string);
// }
// }
// }
// // const redirectParams = JSON.parse(<string>route.query?.params || '');
// // window.location.href = route.query?.redirect
// // router.push({
// // path: <string>route.query?.redirect,
// // query: isEmpty(redirectQuery) ? '' : redirectQuery,
// // // params: isEmpty(redirectParams) ? '' : redirectParams,
// // });
// window.location.href = redirectUri?.toString();
// } else {
// window.location.href = '/home';
// // router.push('/home');
// }
// SPDM CODE
saveLogApi({
title: '登录成功',
serviceId: 'simulation-system',
tenantId: Cookies.get('cid_tenant_id'),
createBy: Cookies.get('cid_user_id'),
}).then(() => {
window.location.href = '/home';
// 登录成功提示
useMessage().success(`${currentTimeInfo}${t('signInText')}`);
});
};
</script>
<style>
.lyric-login-container {
grid-template-columns: repeat(1, 1fr);
}
</style>