ソースを参照

feat: 首次登录自动加载例题

zhangweicheng 4 年 前
コミット
94c009b957
2 ファイル変更4 行追加5 行削除
  1. 1 1
      logs/online_logs.js
  2. 3 4
      modules/pm/facade/pm_facade.js

+ 1 - 1
logs/online_logs.js

@@ -18,7 +18,7 @@ async function saveOnlineTime(req) {
         let start = req.session.online_start_time;
         if(start === undefined) return req.session.online_start_time ==end;
         let online_times =  end - start;
-        //1秒内只记一次就好
+        //0.5秒内只记一次就好
         if(online_times < 500) return;//如果间隔太短,则忽略
         if(online_times > interval_time ){//如果间隔超过有效时长,则不累加这次时长,从头开始算
             req.session.online_start_time = end;

+ 3 - 4
modules/pm/facade/pm_facade.js

@@ -1816,7 +1816,7 @@ async function prepareInitialData(userId, compilation, example) {
         await updateUsedList(userId, compilation);
         const logData = {
             key: uuidV1(),
-            content: '正在初始化数据,请稍候……',
+            content: '正在加载例题,请稍候……',
             userID: userId,
             compilationID: compilation,
             status: 'start',
@@ -1833,10 +1833,9 @@ async function prepareInitialData(userId, compilation, example) {
                 copyCompleRationSection(userId, compilation),
                 copyCompleGljSection(userId, compilation)
             ];
-           /* 2021-01-19 第一次的时候不自动加载例题,右键加载 
-              if (example && example.length > 0) {
+            if (example && example.length > 0) {
                 prepareTask.push(copyExample(userId, compilation, example));
-            } */
+            }
             await Promise.all(prepareTask);
         } catch (error) {
             doc.errorMsg = '加载例题失败,请检查例题项目是否存在!';