1. 修改登录页面中:星期展示方法
2. 登录页面
3.
This commit is contained in:
Zy
2026-09-28 08:31:29 +08:00
parent 368e80f6bf
commit 4f7cb2d085
13 changed files with 182 additions and 666 deletions

13
src/utils/time.ts Normal file
View File

@@ -0,0 +1,13 @@
/**
* 根据数字 1-7 生成对应星期
* @param num 1=周一,2=周二...7=周日
* @param options 选项对象
* @param options.prefix 选项,可自定义前缀,默认 '周'
* @returns 周一 / 周二 ... / 周日
*/
export function numToWeek(num: number,options = {
prefix: '周',
}): string {
const weekMap = ['一', '二', '三', '四', '五', '六', '日'];
return options.prefix + weekMap[num - 1] || '';
}