schtonn 1 rok temu
rodzic
commit
bb88d7bef6
1 zmienionych plików z 8 dodań i 2 usunięć
  1. 8 2
      sdsz74/account.swift

+ 8 - 2
sdsz74/account.swift

@@ -333,7 +333,6 @@ func getUserInfo(userInfoIn: UserInfo, action: @escaping (_: UserInfo) -> Void)
             FetchHandler().fetchAny(url: "bxn-timetable/timetable/monitor/homepage/data/student?studentId=\(userInfo.oid)&dateScope=\(res.value ?? "")&_=0") { res in
                 do {
                     let data = res.data(using: String.Encoding.utf8)
-                    let table = try! JSONSerialization.jsonObject(with: data!) as? [String: Any]
                     let decoder = JSONDecoder()
                     let kkd = try decoder.decode(Welcome.self, from: data!)
                     let pp = kkd.blocks.first?.data.first?.data ?? []
@@ -342,7 +341,14 @@ func getUserInfo(userInfoIn: UserInfo, action: @escaping (_: UserInfo) -> Void)
                         print(pp[i])
                         mx = max(mx, pp[i].lesson)
                     }
-                    for i in 0 ... mx {
+                    ret.append([])
+                    ret[0].append(PurpleDatum(day: 0, lesson: 0, data: [FluffyDatum(timetableID: nil, className: "", classID: "", courseName: "  ", courseID: 0, courseType: 0, placeID: nil, placeName: "", placeSn: "", teacher: [], room: nil,  start: "", end: "", timeScope: 0)]))
+                    ret[0].append(PurpleDatum(day: 0, lesson: 0, data: [FluffyDatum(timetableID: nil, className: "", classID: "", courseName: "一 ", courseID: 0, courseType: 0, placeID: nil, placeName: "", placeSn: "", teacher: [], room: nil,  start: "", end: "", timeScope: 0)]))
+                    ret[0].append(PurpleDatum(day: 0, lesson: 0, data: [FluffyDatum(timetableID: nil, className: "", classID: "", courseName: "二 ", courseID: 0, courseType: 0, placeID: nil, placeName: "", placeSn: "", teacher: [], room: nil,  start: "", end: "", timeScope: 0)]))
+                    ret[0].append(PurpleDatum(day: 0, lesson: 0, data: [FluffyDatum(timetableID: nil, className: "", classID: "", courseName: "三 ", courseID: 0, courseType: 0, placeID: nil, placeName: "", placeSn: "", teacher: [], room: nil,  start: "", end: "", timeScope: 0)]))
+                    ret[0].append(PurpleDatum(day: 0, lesson: 0, data: [FluffyDatum(timetableID: nil, className: "", classID: "", courseName: "四 ", courseID: 0, courseType: 0, placeID: nil, placeName: "", placeSn: "", teacher: [], room: nil,  start: "", end: "", timeScope: 0)]))
+                    ret[0].append(PurpleDatum(day: 0, lesson: 0, data: [FluffyDatum(timetableID: nil, className: "", classID: "", courseName: "五 ", courseID: 0, courseType: 0, placeID: nil, placeName: "", placeSn: "", teacher: [], room: nil,  start: "", end: "", timeScope: 0)]))
+                    for i in 1 ... mx {
                         ret.append([])
                         for j in 0 ... 5 {
                             ret[i].append(PurpleDatum(day: 0, lesson: 0, data: []))