Skip to content

Commit 16e3cdf

Browse files
committed
修改存储于数据库中的 USER 字段 studentId 为超级课表中的 studentId 而非 studentNum
1 parent 5c38b20 commit 16e3cdf

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/kotlin/stageguard/sctimetable/api/LoginReceiptDTO.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ data class __InternalStudent(
8686
val schoolRoll: Int,
8787
val showRate: Boolean,
8888
val studentId: Int,
89-
val studentNum: String,
89+
val studentNum: String = "",
9090
val studentType: Int,
9191
val superId: String,
9292
val supportAuto: Boolean,

src/main/kotlin/stageguard/sctimetable/api/SuperCourseApiService.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ object SuperCourseApiService {
106106
}))
107107
//超级课表的api可真是狗屎,逼我自定义一个Either
108108
val result = (response.content.readUTF8Line() ?: "{\"data\":{\"errorStr\":\"Empty response content.\"},\"status\":1}")
109+
//println(result)
109110
if(Pattern.compile("errorStr").matcher(result).find()) {
110111
Either.Right(Json.decodeFromString(result))
111112
} else {

src/main/kotlin/stageguard/sctimetable/service/RequestHandlerService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ object RequestHandlerService : AbstractPluginManagedService(Dispatchers.IO) {
5757
is Either.Left -> {
5858
Database.query { User.new {
5959
qq = request.qq
60-
studentId = loginReceipt.value.data.student.studentNum.toLong()
60+
studentId = loginReceipt.value.data.student.studentId.toLong()
6161
name = loginReceipt.value.data.student.nickName
6262
schoolId = loginReceipt.value.data.student.schoolId
6363
account = request.loginInfoData.username

0 commit comments

Comments
 (0)