Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nanMoMentorPlatform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
node_server
nanMoMentorPlatform
Commits
21bc7814
Commit
21bc7814
authored
May 19, 2026
by
chenjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
9b343953
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
appointment.ts
src/biz/student/appointment.ts
+12
-9
No files found.
src/biz/student/appointment.ts
View file @
21bc7814
...
...
@@ -281,16 +281,19 @@ export async function createAppointment( studentId: string, param: { start_time:
}
/**验证预约时间 */
let
startTime
=
new
Date
(
param
.
start_time
);
let
endTime
=
new
Date
(
param
.
end_time
);
if
(
startTime
>=
endTime
)
{
throw
new
BizError
(
ERRORENUM
.
参数错误
,
'预约结束时间必须大于开始时间'
);
const
startTime
=
new
Date
(
param
.
start_time
);
const
endTime
=
new
Date
(
param
.
end_time
);
if
(
isNaN
(
startTime
.
getTime
())
||
isNaN
(
endTime
.
getTime
()))
{
throw
new
BizError
(
ERRORENUM
.
参数错误
,
'时间格式无效'
);
}
if
(
startTime
>
endTime
)
{
// 修改点:允许相等,只拒绝开始>结束
throw
new
BizError
(
ERRORENUM
.
参数错误
,
'预约结束时间必须大于或等于开始时间'
);
}
const
todayStart
=
new
Date
();
todayStart
.
setHours
(
0
,
0
,
0
,
0
);
if
(
startTime
<
todayStart
)
{
throw
new
BizError
(
ERRORENUM
.
参数错误
,
'预约开始时间不能早于今天'
);
}
// if (startTime < new Date()) {
// throw new BizError(ERRORENUM.参数错误, '预约开始时间不能早于当前时间');
// }
/**创建预约 */
await
addData
(
TABLENAME
.
预约表
,
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment