diff --git a/src/router/routes/constant.ts b/src/router/routes/constant.ts
index 0e0e348e..d92ca805 100644
--- a/src/router/routes/constant.ts
+++ b/src/router/routes/constant.ts
@@ -1,3 +1,5 @@
+// import { getLoginModuleRegExp } from '@/utils';
+
/** 固定的路由 */
const constantRoutes: AuthRoute.Route[] = [
{
diff --git a/src/store/modules/theme/helpers.ts b/src/store/modules/theme/helpers.ts
index 271b8dd3..9de1f417 100644
--- a/src/store/modules/theme/helpers.ts
+++ b/src/store/modules/theme/helpers.ts
@@ -1,5 +1,4 @@
-import { colord } from 'colord';
-import { getColorPalette } from '@/utils';
+import { getColorPalette, addColorAlpha } from '@/utils';
type ColorType = 'primary' | 'info' | 'success' | 'warning' | 'error';
@@ -23,7 +22,7 @@ export function getThemeColors(colors: [ColorType, string][]) {
{ scene: 'Suppl', handler: color => color },
{ scene: 'Hover', handler: color => getColorPalette(color, 5) },
{ scene: 'Pressed', handler: color => getColorPalette(color, 7) },
- { scene: 'Active', handler: color => colord(color).alpha(0.1).toHex() }
+ { scene: 'Active', handler: color => addColorAlpha(color, 0.1) }
];
const themeColor: ThemeColor = {};
diff --git a/src/styles/css/global.css b/src/styles/css/global.css
index e17043b3..f92e90b2 100644
--- a/src/styles/css/global.css
+++ b/src/styles/css/global.css
@@ -1 +1,5 @@
@import './scrollbar.css';
+
+html, body, #app {
+ height: 100%;
+}
diff --git a/src/typings/common/route.d.ts b/src/typings/common/route.d.ts
index c767b6b5..498df82f 100644
--- a/src/typings/common/route.d.ts
+++ b/src/typings/common/route.d.ts
@@ -24,7 +24,7 @@ declare namespace AuthRoute {
: `/${Key}`;
/** 路由路径 */
- type RoutePath
=
+ type RoutePath =
| '/'
| Exclude, '/root' | '/redirect'>
| Key
@@ -66,11 +66,11 @@ declare namespace AuthRoute {
};
/** 单个路由的类型结构(后端返回此类型结构的路由) */
- interface Route {
+ interface Route {
/** 路由名称(路由唯一标识) */
name: RouteKey;
/** 路由路径 */
- path: RoutePath;
+ path: RoutePath;
/** 路由重定向 */
redirect?: RoutePath;
/**
diff --git a/src/typings/common/util.d.ts b/src/typings/common/util.d.ts
new file mode 100644
index 00000000..7e9b1931
--- /dev/null
+++ b/src/typings/common/util.d.ts
@@ -0,0 +1,17 @@
+declare namespace Util {
+ /** convert a union to an intersection: X | Y | Z ==> X & Y & Z */
+ type UnionToIntersection = (T extends any ? (args: T) => any : never) extends (args: infer R) => any ? R : never;
+
+ /** returns true if the type is a union otherwise false */
+ type IsUnion = [T] extends [UnionToIntersection] ? false : true;
+
+ type LastInUnion = UnionToIntersection any : never> extends (arg: infer R) => any
+ ? R
+ : never;
+
+ type UnionToTuple = [T] extends [never]
+ ? []
+ : [LastInUnion, ...UnionToTuple>>];
+
+ type Inter = UnionToTuple<'1' | '2'>;
+}
diff --git a/src/utils/common/color.ts b/src/utils/common/color.ts
index 29a42176..ca3b003b 100644
--- a/src/utils/common/color.ts
+++ b/src/utils/common/color.ts
@@ -1,6 +1,9 @@
-import { colord } from 'colord';
+import { colord, extend } from 'colord';
+import mixPlugin from 'colord/plugins/mix';
import type { HsvColor } from 'colord';
+extend([mixPlugin]);
+
type ColorIndex = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
const hueStep = 2;
@@ -114,3 +117,22 @@ function getValue(hsv: HsvColor, i: number, isLight: boolean) {
}
return value;
}
+
+/**
+ * 给颜色加透明度
+ * @param color - 颜色
+ * @param alpha - 透明度(0 - 1)
+ */
+export function addColorAlpha(color: string, alpha: number) {
+ return colord(color).alpha(alpha).toHex();
+}
+
+/**
+ * 颜色混合
+ * @param firstColor - 第一个颜色
+ * @param secondColor - 第二个颜色
+ * @param ratio - 第二个颜色占比
+ */
+export function mixColor(firstColor: string, secondColor: string, ratio: number) {
+ return colord(firstColor).mix(secondColor, ratio).toHex();
+}
diff --git a/src/utils/router/index.ts b/src/utils/router/index.ts
index c5f595cf..a363a5bc 100644
--- a/src/utils/router/index.ts
+++ b/src/utils/router/index.ts
@@ -1 +1,2 @@
export * from './helpers';
+export * from './regexp';
diff --git a/src/utils/router/regexp.ts b/src/utils/router/regexp.ts
new file mode 100644
index 00000000..dcc67f12
--- /dev/null
+++ b/src/utils/router/regexp.ts
@@ -0,0 +1,7 @@
+import type { LoginModuleKey } from '@/interface';
+
+/** 获取登录页面模块的动态路由的正则 */
+export function getLoginModuleRegExp() {
+ const modules: LoginModuleKey[] = ['pwd-login', 'code-login', 'register', 'reset-pwd', 'bind-wechat'];
+ return modules.join('|');
+}
diff --git a/src/views/system/login/components/LoginBg/components/CornerBottom.vue b/src/views/system/login/components/LoginBg/components/CornerBottom.vue
new file mode 100644
index 00000000..b62deb4c
--- /dev/null
+++ b/src/views/system/login/components/LoginBg/components/CornerBottom.vue
@@ -0,0 +1,40 @@
+
+
+
+
+
+
diff --git a/src/views/system/login/components/LoginBg/components/CornerTop.vue b/src/views/system/login/components/LoginBg/components/CornerTop.vue
new file mode 100644
index 00000000..6b1d6e20
--- /dev/null
+++ b/src/views/system/login/components/LoginBg/components/CornerTop.vue
@@ -0,0 +1,34 @@
+
+
+
+
+
+
diff --git a/src/views/system/login/components/LoginBg/components/index.ts b/src/views/system/login/components/LoginBg/components/index.ts
new file mode 100644
index 00000000..33e9bf12
--- /dev/null
+++ b/src/views/system/login/components/LoginBg/components/index.ts
@@ -0,0 +1,4 @@
+import CornerTop from './CornerTop.vue';
+import CornerBottom from './CornerBottom.vue';
+
+export { CornerTop, CornerBottom };
diff --git a/src/views/system/login/components/LoginBg/index.vue b/src/views/system/login/components/LoginBg/index.vue
new file mode 100644
index 00000000..fdff871c
--- /dev/null
+++ b/src/views/system/login/components/LoginBg/index.vue
@@ -0,0 +1,27 @@
+
+
+
+
+
+
diff --git a/src/views/system/login/components/index.ts b/src/views/system/login/components/index.ts
new file mode 100644
index 00000000..1d3abc6c
--- /dev/null
+++ b/src/views/system/login/components/index.ts
@@ -0,0 +1,3 @@
+import LoginBg from './LoginBg/index.vue';
+
+export { LoginBg };
diff --git a/src/views/system/login/index.vue b/src/views/system/login/index.vue
index 0813c3ca..31620e6a 100644
--- a/src/views/system/login/index.vue
+++ b/src/views/system/login/index.vue
@@ -1,8 +1,39 @@
-