diff --git a/build/vite/plugin/html.ts b/build/vite/plugin/html.ts index 6af034a..e0a7351 100644 --- a/build/vite/plugin/html.ts +++ b/build/vite/plugin/html.ts @@ -6,6 +6,7 @@ import type { PluginOption } from 'vite'; import { createHtmlPlugin } from 'vite-plugin-html'; import pkg from '../../../package.json'; import { GLOB_CONFIG_FILE_NAME } from '../../constant'; +import {isHJ} from "/@/utils/is"; export function configHtmlPlugin(env: ViteEnv, isBuild: boolean) { const { VITE_GLOB_APP_TITLE, VITE_PUBLIC_PATH } = env; @@ -21,7 +22,9 @@ export function configHtmlPlugin(env: ViteEnv, isBuild: boolean) { inject: { // Inject data into ejs template data: { - title: VITE_GLOB_APP_TITLE, + title: VITE_GLOB_APP_TITLE, //这里可改LOGDING文字 + titleHJ: '河津市农业面源污染在线监测平台', //这里可改LOGDING文字 + // title: VITE_GLOB_APP_TITLE, //这里可改LOGDING文字 }, // Embed the generated app.config.js file tags: isBuild diff --git a/index.html b/index.html index c80afd8..ec84a19 100644 --- a/index.html +++ b/index.html @@ -161,10 +161,17 @@
-
<%= title %>
+
<%= title %>111111
+ diff --git a/src/assets/loginmini/icon/jeecg_ad_text_hj.png b/src/assets/loginmini/icon/jeecg_ad_text_hj.png new file mode 100644 index 0000000..8bdccdd Binary files /dev/null and b/src/assets/loginmini/icon/jeecg_ad_text_hj.png differ diff --git a/src/enums/pageEnum.ts b/src/enums/pageEnum.ts index 778b458..e4e33d9 100644 --- a/src/enums/pageEnum.ts +++ b/src/enums/pageEnum.ts @@ -1,6 +1,17 @@ +import { isHJ } from '/@/utils/is'; +const LOGIN_HJ = '/loginHJ'; +const LOGIN = '/login'; + +let loginC: string = LOGIN; + +if (isHJ()) { + loginC = LOGIN_HJ; +} + export enum PageEnum { // basic login path - BASE_LOGIN = '/login', + // BASE_LOGIN = '/login', + BASE_LOGIN = loginC, // basic home path BASE_HOME = '/dashboard/analysis', // error page path diff --git a/src/router/routes/index.ts b/src/router/routes/index.ts index 6df062f..a44f696 100644 --- a/src/router/routes/index.ts +++ b/src/router/routes/index.ts @@ -39,6 +39,17 @@ export const LoginRoute: AppRouteRecordRaw = { }, }; +export const LoginRouteHJ: AppRouteRecordRaw = { + path: '/loginHJ', + name: 'LoginHJ', + //新版后台登录,如果想要使用旧版登录放开即可 + // component: () => import('/@/views/sys/login/Login.vue'), + component: () => import('/@/views/system/loginmini/MiniLoginHJ.vue'), + meta: { + title: t('routes.basic.login'), + }, +}; + //update-begin---author:wangshuai ---date:20220629 for:auth2登录页面路由------------ export const Oauth2LoginRoute: AppRouteRecordRaw = { path: '/oauth2-app/login', @@ -66,4 +77,4 @@ export const TokenLoginRoute: AppRouteRecordRaw = { }; // Basic routing without permission -export const basicRoutes = [LoginRoute, RootRoute, ...mainOutRoutes, REDIRECT_ROUTE, PAGE_NOT_FOUND_ROUTE, TokenLoginRoute, Oauth2LoginRoute]; +export const basicRoutes = [LoginRouteHJ, LoginRoute, RootRoute, ...mainOutRoutes, REDIRECT_ROUTE, PAGE_NOT_FOUND_ROUTE, TokenLoginRoute, Oauth2LoginRoute]; diff --git a/src/utils/is.ts b/src/utils/is.ts index ec008fb..837bc27 100644 --- a/src/utils/is.ts +++ b/src/utils/is.ts @@ -106,3 +106,11 @@ export function isUrl(path: string): boolean { /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/; return reg.test(path); } + +export function isHJ(): boolean { + if (!window) { + return false; + } + console.log(window?.location.hostname, 'window.location.hostname'); + return window?.location.hostname == 'nsp.sxcooh.com' || window?.location.hostname == '192.168.2.21'; +} diff --git a/src/views/system/loginmini/MiniLoginHJ.vue b/src/views/system/loginmini/MiniLoginHJ.vue new file mode 100644 index 0000000..3d8eeee --- /dev/null +++ b/src/views/system/loginmini/MiniLoginHJ.vue @@ -0,0 +1,558 @@ + + + + + +