提交 d83ee34c 编写于 作者: C CodFrm

间隔时间增加随机范围

上级 fa011c2e
......@@ -9,7 +9,7 @@ module.exports = {
},
injection: '',
hotversion: {
v2_10: 2.10,
v2_10: 2.103,
v2_08: 2.083,
v2_07: 2.071,
v2_06: 2.06,
......
......@@ -79,8 +79,8 @@ module.exports = function () {
*/
function lazySwitch(callback) {
//无任务
config.auto && self.notice(config.interval + "分钟后插件将自动切换下一节任务");
config.auto && common.log(config.interval + " after switch")
config.auto && self.notice((config.duration / 60000).toFixed(2) + "分钟后插件将自动切换下一节任务");
config.auto && common.log((config.duration / 60000).toFixed(2) + " after switch")
clearTimeout(lastTimeout);
lastTimeout = setTimeout(function () {
if (callback == undefined) {
......
......@@ -363,7 +363,7 @@ export function requestAnswer(topic, platform, page, answer, compile, error, cou
time = time || 2000;
let post = '';
for (let i = (page * count), n = 0; i < topic.length && n < count; i++ , n++) {
post += 'topic[' + n + ']=' + topic[i].topic + '&type[' + n + ']=' + topic[i].type + '&';
post += 'topic[' + n + ']=' + topic[i].topic + '&type[' + n + ']=' + topic[i].type + '&';
}
if (post == '') {
compile && compile();
......
......@@ -4,5 +4,5 @@ const common = require('./common');
common.removeinjected(document);
common.serverMessage('cxconfig', function (param) {
global.config[param.key] = param.value
global.config[param.key] = param.value;
});
......@@ -45,7 +45,7 @@ app.use(bodyParser.urlencoded({
}));
app.use(express.static(path.join(__dirname, 'static'), {
maxage: '7d'
maxage: '1d'
}));
app.get('/', function (req, res) {
......
const common = require('../cxmooc-tools/common')
global.config = JSON.parse(localStorage['config']);
Object.defineProperty(global.config, 'duration', {
get: function () {
return (config.interval || 0.1) * 60000;
let interval = (config.interval || 0.1) * 60000;
return common.randNumber(interval - interval / 2, interval + interval * 2);
}
});
......@@ -32,7 +32,7 @@ window.onload = function () {
cx.collectExam();
} else if (window.location.href.indexOf('work/doHomeWorkNew') > 0) {
cx.homework();
}else if(window.location.href.indexOf('work/selectWorkQuestionYiPiYue')>0){
cx.collectHomeWork();
} else if (window.location.href.indexOf('work/selectWorkQuestionYiPiYue') > 0) {
cx.collectHomeWork();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册