Michael Wang 3 жил өмнө
parent
commit
1c172197e0

+ 4 - 0
src/store/store.ts

@@ -47,6 +47,10 @@ export const useStore = defineStore("ecs", {
     hasGlobalMask(): boolean {
     hasGlobalMask(): boolean {
       return store.globalMaskCount > 0;
       return store.globalMaskCount > 0;
     },
     },
+    /** 得到学生端正确的当前时间,考虑电脑的时钟误差 */
+    getTimeStamp(): number {
+      return Date.now() + store.sysTime.difference;
+    },
   },
   },
   actions: {
   actions: {
     /** 增加当前的globalMaskCount */
     /** 增加当前的globalMaskCount */

+ 6 - 4
src/types/student-client.d.ts

@@ -64,7 +64,7 @@ export type Store = {
   };
   };
   /** 电脑时间管理 */
   /** 电脑时间管理 */
   sysTime: {
   sysTime: {
-    /** 与服务器差异 */
+    /** 与服务器差异,服务器时间大于学生端时间,则返回正数,否则返回负数 */
     difference: number;
     difference: number;
     /** 网络延迟 通过网络请求来判断 */
     /** 网络延迟 通过网络请求来判断 */
     rtt: number;
     rtt: number;
@@ -202,16 +202,18 @@ type BaseExam = {
 type ExamCycle = {
 type ExamCycle = {
   /** 考试周期是否开启循环 */
   /** 考试周期是否开启循环 */
   examCycleEnabled: boolean;
   examCycleEnabled: boolean;
-  /** 周循环中周几开启考试 */
-  examCycleWeek: (1 | 2 | 3 | 4 | 5 | 6 | 7)[];
+  /** 周循环中周几开启考试 1-7 */
+  examCycleWeek: number[];
   /** 周期循环中开启的时间段 HHmm [['08:00', '10:30'], ['15:00', '17:00']] */
   /** 周期循环中开启的时间段 HHmm [['08:00', '10:30'], ['15:00', '17:00']] */
-  examCycleTimeRange: [string, string][];
+  examCycleTimeRange: { timeRange: [string, string] }[];
 };
 };
 
 
 type OnlineExam = BaseExam &
 type OnlineExam = BaseExam &
   ExamCycle & {
   ExamCycle & {
     /** 是否显示考生承诺书 */
     /** 是否显示考生承诺书 */
     showUndertaking: boolean;
     showUndertaking: boolean;
+    /** 考生承诺书内容 */
+    undertaking: string;
     /** 是否启用人脸比对 */
     /** 是否启用人脸比对 */
     faceEnable: boolean;
     faceEnable: boolean;
     /** 剩余考试次数 */
     /** 剩余考试次数 */