mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat(projects): 登录页面开始迁移
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
@ -1 +1,2 @@
|
||||
export * from './helpers';
|
||||
export * from './regexp';
|
||||
|
7
src/utils/router/regexp.ts
Normal file
7
src/utils/router/regexp.ts
Normal file
@ -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('|');
|
||||
}
|
Reference in New Issue
Block a user