Authored by 邱骏

修改getBase64Image接口

@@ -337,7 +337,7 @@ const shoes = { @@ -337,7 +337,7 @@ const shoes = {
337 }; 337 };
338 let canUpdate = false; 338 let canUpdate = false;
339 339
340 - for (let i = 0; i < list.length; i ++) { 340 + for (let i = 0; i < list.length; i++) {
341 newScoreInfo.score += parseInt(list[i].isCorrect, 10) ? 10 : 0; 341 newScoreInfo.score += parseInt(list[i].isCorrect, 10) ? 10 : 0;
342 newScoreInfo.playTime += list[i].time; 342 newScoreInfo.playTime += list[i].time;
343 newScoreInfo.clickTimes += list[i].cts || 1; 343 newScoreInfo.clickTimes += list[i].cts || 1;
@@ -345,10 +345,10 @@ const shoes = { @@ -345,10 +345,10 @@ const shoes = {
345 345
346 if (newScoreInfo.score > scoreInfo.score) { // 分数比原来高的情况 346 if (newScoreInfo.score > scoreInfo.score) { // 分数比原来高的情况
347 canUpdate = true; 347 canUpdate = true;
348 - } else if (newScoreInfo.score === scoreInfo.score){ // 分数和原来相同时,看点击次数多少 348 + } else if (newScoreInfo.score === scoreInfo.score) { // 分数和原来相同时,看点击次数多少
349 if (newScoreInfo.clickTimes < scoreInfo.clickTimes) { // 点击次数少于原来 349 if (newScoreInfo.clickTimes < scoreInfo.clickTimes) { // 点击次数少于原来
350 canUpdate = true; 350 canUpdate = true;
351 - } else if (newScoreInfo.clickTimes === scoreInfo.clickTimes){ // 点击次数等于原来,看时间长短 351 + } else if (newScoreInfo.clickTimes === scoreInfo.clickTimes) { // 点击次数等于原来,看时间长短
352 if (newScoreInfo.playTime < scoreInfo.playTime) { 352 if (newScoreInfo.playTime < scoreInfo.playTime) {
353 canUpdate = true; 353 canUpdate = true;
354 } 354 }
@@ -546,7 +546,7 @@ const shoes = { @@ -546,7 +546,7 @@ const shoes = {
546 }); 546 });
547 }, 547 },
548 548
549 - async getImageData(req, res) { 549 + async getImageData(req, res, next) {
550 550
551 let pic_url = req.query.image; 551 let pic_url = req.query.image;
552 552
@@ -581,7 +581,7 @@ const shoes = { @@ -581,7 +581,7 @@ const shoes = {
581 data: result 581 data: result
582 }); 582 });
583 }).catch(err => { 583 }).catch(err => {
584 - return res.json(err); 584 + next(err);
585 }); 585 });
586 }, 586 },
587 587