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
be3831af
Commit
be3831af
authored
Jun 23, 2026
by
PC-20251223ZVQQ\Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
问题修复02
parent
3fbd2a23
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
13 deletions
+23
-13
teacherInfo.ts
src/biz/teacher/teacherInfo.ts
+14
-4
teacher.ts
src/routers/teacher.ts
+9
-9
No files found.
src/biz/teacher/teacherInfo.ts
View file @
be3831af
...
...
@@ -66,8 +66,8 @@ export async function teacherInfo(teacherId: string) {
* @param teacherId 导师ID
* @param param 修改参数
* @param param.political_status 政治面貌
* @param
param.is_class_teacher 是否班主任
* @param
param.max_students 最大可带学生数
* @param
user_name 教师姓名
* @param
gender 教师性别
* @param param.class_ids 任教班级ID数组
* @param param.subjects 任教科目数组
* @param param.semester_id 学期ID(可选,默认使用当前学期)
...
...
@@ -93,8 +93,8 @@ export async function teacherUpdate(teacherId: string, param: any) {
/**更新导师扩展信息 */
let
updateData
:
any
=
{};
if
(
param
.
political_status
!==
undefined
)
updateData
.
political_status
=
param
.
political_status
;
if
(
param
.
is_class_teacher
!==
undefined
)
updateData
.
is_class_teacher
=
param
.
is_class_teacher
;
if
(
param
.
max_students
!==
undefined
)
updateData
.
max_students
=
param
.
max_students
;
//
if (param.is_class_teacher !== undefined) updateData.is_class_teacher = param.is_class_teacher;
//
if (param.max_students !== undefined) updateData.max_students = param.max_students;
if
(
Object
.
keys
(
updateData
).
length
>
0
)
{
await
updateManyData
(
TABLENAME
.
用户扩展信息表
,
{
user_id
:
teacherId
},
updateData
);
...
...
@@ -135,6 +135,16 @@ export async function teacherUpdate(teacherId: string, param: any) {
}
}
}
/**更新用户信息 */
let
userParams
:
any
=
{};
if
(
param
.
user_name
!==
undefined
)
userParams
.
user_name
=
param
.
user_name
;
if
(
param
.
user_name
!==
undefined
)
userParams
.
nickname
=
param
.
user_name
;
if
(
param
.
gender
!==
undefined
)
userParams
.
gender
=
param
.
gender
;
if
(
Object
.
keys
(
updateData
).
length
>
0
)
{
await
updateManyData
(
TABLENAME
.
统一用户表
,
{
user_id
:
teacherId
},
userParams
);
}
return
{
isSuccess
:
true
};
}
...
...
src/routers/teacher.ts
View file @
be3831af
...
...
@@ -890,7 +890,7 @@ async function teacherDashboard(req, res) {
*/
async
function
teacherInfo
(
req
,
res
)
{
const
userInfo
=
req
.
userInfo
;
let
result
=
await
teacherInfoBiz
.
teacherInfo
(
userInfo
.
user
_i
d
);
let
result
=
await
teacherInfoBiz
.
teacherInfo
(
userInfo
.
user
I
d
);
res
.
success
(
result
);
}
...
...
@@ -898,27 +898,27 @@ async function teacherInfo(req, res) {
* 修改导师信息
* @param teacherId 教师user_id
* @param political_status 政治面貌
* @param
is_class_teacher 是否班主任
* @param
max_students 最大可带学生数
* @param
user_name 教师姓名
* @param
user_sex 教师性别
* @param class_ids 班级ID数组
* @param subjects 任教科目数组
*/
async
function
teacherUpdate
(
req
,
res
)
{
const
userInfo
=
req
.
userInfo
;
let
reqConf
=
{
political_status
:
'String'
,
is_class_teacher
:
'Boolean'
,
max_students
:
'Number
'
,
class_ids
:
'[Number]'
,
subjects
:
'[String]'
};
const
NotMustHaveKeys
=
[
'
political_status'
,
'is_class_teacher'
,
'max_students
'
,
'class_ids'
,
'subjects'
];
let
{
political_status
,
is_class_teacher
,
max_students
,
class_ids
,
subjects
}
=
eccReqParamater
(
reqConf
,
req
.
body
,
NotMustHaveKeys
);
let
reqConf
=
{
user_name
:
'String'
,
political_status
:
'String'
,
gender
:
'String
'
,
class_ids
:
'[Number]'
,
subjects
:
'[String]'
};
const
NotMustHaveKeys
=
[
'
user_name'
,
'political_status'
,
'gender
'
,
'class_ids'
,
'subjects'
];
let
{
user_name
,
political_status
,
gender
,
class_ids
,
subjects
}
=
eccReqParamater
(
reqConf
,
req
.
body
,
NotMustHaveKeys
);
let
updateData
=
{
political_status
,
is_class_teacher
,
max_students
,
user_name
,
gender
,
class_ids
,
subjects
};
let
result
=
await
teacherInfoBiz
.
teacherUpdate
(
userInfo
.
user
_i
d
,
updateData
);
let
result
=
await
teacherInfoBiz
.
teacherUpdate
(
userInfo
.
user
I
d
,
updateData
);
res
.
success
(
result
);
}
...
...
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