From ab1d3645244d9e5da63d73dd503c46cc0e0ede38 Mon Sep 17 00:00:00 2001 From: qubiaobiao <3294694717@qq.com> Date: Fri, 27 Mar 2026 17:55:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=97=E6=96=97=E5=BA=94=E7=94=A8=E6=8A=80?= =?UTF-8?q?=E6=9C=AF=E5=9F=B9=E8=AE=AD=E6=8A=A5=E5=90=8D=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E9=A2=98=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 1 + .eslintrc | 4 + .gitignore | 15 +++ .sequelizerc | 10 ++ README.md | 31 ++++++ app/controller/home.js | 156 +++++++++++++++++++++++++++++++ app/core/base_controller.js | 133 ++++++++++++++++++++++++++ app/core/base_service.js | 88 +++++++++++++++++ app/middleware/log.js | 72 ++++++++++++++ app/model/Examinee.js | 31 ++++++ app/model/Whitelist.js | 19 ++++ app/model2/Interlocution.js | 19 ++++ app/model2/Judgment.js | 19 ++++ app/model2/Multiple.js | 24 +++++ app/model2/Radio.js | 23 +++++ app/router.js | 19 ++++ app/service/home.js | 119 +++++++++++++++++++++++ config/config.default.js | 109 +++++++++++++++++++++ config/plugin.js | 21 +++++ controllerLog/2025/2/28.txt | 8 ++ controllerLog/2025/3/11.txt | 23 +++++ controllerLog/2025/3/12.txt | 1 + controllerLog/2025/3/13.txt | 21 +++++ controllerLog/2025/3/14.txt | 1 + controllerLog/2025/4/2.txt | 29 ++++++ controllerLog/2025/4/21.txt | 6 ++ controllerLog/2025/4/3.txt | 4 + database/config.json | 23 +++++ jsconfig.json | 5 + package.json | 49 ++++++++++ serviceLog/2025/3/11.txt | 8 ++ serviceLog/2025/3/12.txt | 9 ++ serviceLog/2025/3/13.txt | 18 ++++ serviceLog/2025/3/14.txt | 24 +++++ serviceLog/2025/3/17.txt | 75 +++++++++++++++ serviceLog/2025/3/21.txt | 2 + serviceLog/2025/3/24.txt | 34 +++++++ serviceLog/2025/3/26.txt | 1 + serviceLog/2025/3/5.txt | 3 + serviceLog/2025/4/2.txt | 9 ++ serviceLog/2025/4/3.txt | 12 +++ test/app/controller/home.test.js | 23 +++++ 42 files changed, 1301 insertions(+) create mode 100644 .eslintignore create mode 100644 .eslintrc create mode 100644 .gitignore create mode 100644 .sequelizerc create mode 100644 README.md create mode 100644 app/controller/home.js create mode 100644 app/core/base_controller.js create mode 100644 app/core/base_service.js create mode 100644 app/middleware/log.js create mode 100644 app/model/Examinee.js create mode 100644 app/model/Whitelist.js create mode 100644 app/model2/Interlocution.js create mode 100644 app/model2/Judgment.js create mode 100644 app/model2/Multiple.js create mode 100644 app/model2/Radio.js create mode 100644 app/router.js create mode 100644 app/service/home.js create mode 100644 config/config.default.js create mode 100644 config/plugin.js create mode 100644 controllerLog/2025/2/28.txt create mode 100644 controllerLog/2025/3/11.txt create mode 100644 controllerLog/2025/3/12.txt create mode 100644 controllerLog/2025/3/13.txt create mode 100644 controllerLog/2025/3/14.txt create mode 100644 controllerLog/2025/4/2.txt create mode 100644 controllerLog/2025/4/21.txt create mode 100644 controllerLog/2025/4/3.txt create mode 100644 database/config.json create mode 100644 jsconfig.json create mode 100644 package.json create mode 100644 serviceLog/2025/3/11.txt create mode 100644 serviceLog/2025/3/12.txt create mode 100644 serviceLog/2025/3/13.txt create mode 100644 serviceLog/2025/3/14.txt create mode 100644 serviceLog/2025/3/17.txt create mode 100644 serviceLog/2025/3/21.txt create mode 100644 serviceLog/2025/3/24.txt create mode 100644 serviceLog/2025/3/26.txt create mode 100644 serviceLog/2025/3/5.txt create mode 100644 serviceLog/2025/4/2.txt create mode 100644 serviceLog/2025/4/3.txt create mode 100644 test/app/controller/home.test.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..4ebc8ae --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +coverage diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..f304bdd --- /dev/null +++ b/.eslintrc @@ -0,0 +1,4 @@ +{ + "extends": "eslint-config-egg", + "root": true +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..652759b --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +logs/ +npm-debug.log +yarn-error.log +node_modules/ +*-lock.json +*-lock.yaml +yarn.lock +coverage/ +.idea/ +run/ +.DS_Store +*.sw* +*.un~ +typings/ +.nyc_output/ diff --git a/.sequelizerc b/.sequelizerc new file mode 100644 index 0000000..01d9847 --- /dev/null +++ b/.sequelizerc @@ -0,0 +1,10 @@ +'use strict'; + +const path = require('path'); + +module.exports = { + "config": path.join(__dirname, 'database/config.json'), + 'migrations-path': path.join(__dirname, 'database/migrations'), + 'seeders-path': path.join(__dirname, 'database/seeders'), + 'models-path': path.join(__dirname, 'app/model'), +}; diff --git a/README.md b/README.md new file mode 100644 index 0000000..6a02535 --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# open-map-assistant + + + +## QuickStart + + + +see [egg docs][egg] for more detail. + +### Development + +```bash +npm i +npm run dev +open http://localhost:7001/ +``` + +### Deploy + +```bash +npm start +npm stop +``` + +### npm scripts + +- Use `npm run lint` to check code style. +- Use `npm test` to run unit test. + +[egg]: https://eggjs.org diff --git a/app/controller/home.js b/app/controller/home.js new file mode 100644 index 0000000..21d9d8b --- /dev/null +++ b/app/controller/home.js @@ -0,0 +1,156 @@ +const Controller = require('../core/base_controller'); + +const fileName = "Home"; + +class HomeController extends Controller { + // 题库登录接口 + async login() { + const { ctx } = this; + try { + const body = ctx.request.body; + const result = await ctx.service.home.login(body); + if (result == "error") { + this.setResponse(ctx, 500, '服务器错误', "none"); + return; + } + if (result) { + await ctx.app.redis.get('db3').set(result.dataValues.user_uid, result.dataValues.type, 'EX', 21600); + this.setResponse(ctx, 200, '操作成功', "polymerization", this.encryptRequest(result.dataValues.user_uid + '?' + new Date().getTime())); + } else { + this.setResponse(ctx, 404, '操作失败', "none"); + } + } catch (error) { + const blockName = fileName + "--" + "login"; + ctx.app.middleware.log('../../controllerLog', blockName + ">>>>" + error); + this.setResponse(ctx, 500, '服务器错误', "none"); + } + } + + // 获取题库登录状态接口 + async loginStatus() { + const { ctx } = this; + try { + const data = ctx.request.body.data; + const topic = await ctx.app.redis.get('db3').get(this.decryptRequest(data).split('?')[0]); + if (topic == null) { + this.setResponse(ctx, 404, '操作失败', "none"); + } else { + this.setResponse(ctx, 200, '操作成功', "none"); + } + } catch (error) { + const blockName = fileName + "--" + "loginStatus"; + ctx.app.middleware.log('../../controllerLog', blockName + ">>>>" + error); + this.setResponse(ctx, 500, '服务器错误', "none"); + } + } + + // 获取单选题接口 + async radio() { + const { ctx } = this; + try { + let rdmcode = await this.checkUid(ctx); + if (!rdmcode) { + this.setResponse(ctx, 401, 'token过期或错误', "none"); + return; + } + const body = ctx.request.body; + const result = await ctx.service.home.radio(body); + if (result == "error") { + this.setResponse(ctx, 500, '服务器错误', "none"); + return; + } + if (result) { + this.setResponse(ctx, 200, '操作成功', "deconstruction", result); + } else { + this.setResponse(ctx, 404, '操作失败', "none"); + } + } catch (error) { + const blockName = fileName + "--" + "radio"; + ctx.app.middleware.log('../../controllerLog', blockName + ">>>>" + error); + this.setResponse(ctx, 500, '服务器错误', "none"); + } + } + + // 获取多选题接口 + async multiple() { + const { ctx } = this; + try { + let rdmcode = await this.checkUid(ctx); + if (!rdmcode) { + this.setResponse(ctx, 401, 'token过期或错误', "none"); + return; + } + const body = ctx.request.body; + const result = await ctx.service.home.multiple(body); + if (result == "error") { + this.setResponse(ctx, 500, '服务器错误', "none"); + return; + } + if (result) { + this.setResponse(ctx, 200, '操作成功', "deconstruction", result); + } else { + this.setResponse(ctx, 404, '操作失败', "none"); + } + } catch (error) { + const blockName = fileName + "--" + "multiple"; + ctx.app.middleware.log('../../controllerLog', blockName + ">>>>" + error); + this.setResponse(ctx, 500, '服务器错误', "none"); + } + } + + // 获取判断题接口 + async judgment() { + const { ctx } = this; + try { + let rdmcode = await this.checkUid(ctx); + if (!rdmcode) { + this.setResponse(ctx, 401, 'token过期或错误', "none"); + return; + } + const body = ctx.request.body; + const result = await ctx.service.home.judgment(body); + if (result == "error") { + this.setResponse(ctx, 500, '服务器错误', "none"); + return; + } + if (result) { + this.setResponse(ctx, 200, '操作成功', "deconstruction", result); + } else { + this.setResponse(ctx, 404, '操作失败', "none"); + } + } catch (error) { + const blockName = fileName + "--" + "judgment"; + ctx.app.middleware.log('../../controllerLog', blockName + ">>>>" + error); + this.setResponse(ctx, 500, '服务器错误', "none"); + } + } + + // 获取问答题接口 + async interlocution() { + const { ctx } = this; + try { + let rdmcode = await this.checkUid(ctx); + if (!rdmcode) { + this.setResponse(ctx, 401, 'token过期或错误', "none"); + return; + } + const body = ctx.request.body; + const result = await ctx.service.home.interlocution(body); + if (result == "error") { + this.setResponse(ctx, 500, '服务器错误', "none"); + return; + } + if (result) { + this.setResponse(ctx, 200, '操作成功', "deconstruction", result); + } else { + this.setResponse(ctx, 404, '操作失败', "none"); + } + } catch (error) { + const blockName = fileName + "--" + "interlocution"; + ctx.app.middleware.log('../../controllerLog', blockName + ">>>>" + error); + this.setResponse(ctx, 500, '服务器错误', "none"); + } + } +} + +module.exports = HomeController; diff --git a/app/core/base_controller.js b/app/core/base_controller.js new file mode 100644 index 0000000..61b53bb --- /dev/null +++ b/app/core/base_controller.js @@ -0,0 +1,133 @@ +const { Controller } = require('egg'); + +const sha256 = require("crypto-js/sha256"); + +const CryptoJS = require("crypto-js"); + +const KEY = CryptoJS.enc.Utf8.parse('BDQH'); + +class BaseController extends Controller { + shaForm = (body, salt) => { + return sha256(sha256(body).toString() + salt).toString(); + } + + encryptRequest = (body) => { + return CryptoJS.AES.encrypt(body, KEY, { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7 + }).toString(); + } + + decryptRequest = (body) => { + return CryptoJS.AES.decrypt(body, KEY, { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7 + }).toString(CryptoJS.enc.Utf8); + } + + // 用户uid生成函数 + generateNumberString = (side) => { + // 获取当前日期(年月日) + const now = new Date(); + const year = String(now.getFullYear()).padStart(4, '0'); + const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以加1 + const date = String(now.getDate()).padStart(2, '0'); + const dateString = year + month + date; + + // 获取当前时间戳的后三位 + const timestamp = String(Date.now()).slice(-3); + + // 生成三位随机数字 + const randomDigits = Math.floor(Math.random() * 100).toString().padStart(3, '0'); + + // 组合成最终的15位字符串 + const fullNumberString = dateString + timestamp + randomDigits + side; + + return fullNumberString; + } + + // 随机盐生成函数 + generateRandomString = () => { + const lowerCaseLetters = 'abcdefghijklmnopqrstuvwxyz'; + const upperCaseLetters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + const numbers = '0123456789'; + + let result = ''; + + // 生成5位随机小写字母 + for (let i = 0; i < 5; i++) { + const randomIndex = Math.floor(Math.random() * lowerCaseLetters.length); + result += lowerCaseLetters[randomIndex]; + } + + // 生成5位随机大写字母 + for (let i = 0; i < 5; i++) { + const randomIndex = Math.floor(Math.random() * upperCaseLetters.length); + result += upperCaseLetters[randomIndex]; + } + + // 生成2位随机数字 + for (let i = 0; i < 2; i++) { + const randomIndex = Math.floor(Math.random() * numbers.length); + result += numbers[randomIndex]; + } + + // 打乱整个字符串 + const characters = result.split(''); + for (let i = characters.length - 1; i > 0; i--) { + const j = Math.floor(Math.random() * (i + 1)); + [characters[i], characters[j]] = [characters[j], characters[i]]; + } + + return characters.join(''); + } + + // 随机生成12位客户端id + generateClientId = () => { + const numbers = '0123456789'; + + let result = ''; + + // 生成4位随机数字 + for (let i = 0; i < 4; i++) { + const randomIndex = Math.floor(Math.random() * numbers.length); + result += numbers[randomIndex]; + } + + // 打乱整个字符串 + const characters = result.split(''); + for (let i = characters.length - 1; i > 0; i--) { + const j = Math.floor(Math.random() * (i + 1)); + [characters[i], characters[j]] = [characters[j], characters[i]]; + } + + // 获取当前日期(年月日) + const now = new Date(); + const year = String(now.getFullYear()).padStart(4, '0'); + const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以加1 + const date = String(now.getDate()).padStart(2, '0'); + const dateString = year + month + date; + + const fullNumberString = dateString + characters.join(''); + + return fullNumberString; + } + + checkUid = async (ctx) => { + const token = ctx.request.header.authorization; + const redis = ctx.app.redis; + const topic = await redis.get('db3').get(this.decryptRequest(token).split('?')[0]); + return topic || false; + }; + + setResponse = (ctx, code, msg, model, data = {}) => { + const modelType = { + "none": { code, msg }, + "deconstruction": { code, msg, ...data }, + "polymerization": { code, msg, data } + } + ctx.body = modelType[model]; + } +} + +module.exports = BaseController; \ No newline at end of file diff --git a/app/core/base_service.js b/app/core/base_service.js new file mode 100644 index 0000000..5bf3b3a --- /dev/null +++ b/app/core/base_service.js @@ -0,0 +1,88 @@ +const { Service } = require('egg'); + +const { Op } = require('sequelize'); + +const sha256 = require("crypto-js/sha256"); + +const CryptoJS = require("crypto-js"); + +const KEY = CryptoJS.enc.Utf8.parse('BDQH'); + +class BaseService extends Service { + shaForm = (body, salt) => { + return sha256(sha256(body).toString() + salt).toString(); + } + + encryptRequest = (body) => { + return CryptoJS.AES.encrypt(body, KEY, { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7 + }).toString(); + } + + decryptRequest = (body) => { + return CryptoJS.AES.decrypt(body, KEY, { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7 + }).toString(CryptoJS.enc.Utf8); + } + + // uid生成函数 + generateNumberString = () => { + // 获取当前日期(年月日) + const now = new Date(); + const year = String(now.getFullYear()).padStart(4, '0'); + const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以加1 + const date = String(now.getDate()).padStart(2, '0'); + const dateString = year + month + date; + + // 获取当前时间戳的后四位 + const timestamp = String(Date.now()).slice(-4); + + // 生成四位随机数字 + const randomDigits = Math.floor(Math.random() * 10000).toString().padStart(4, '0'); + + // 组合成最终的16位数字字符串 + const fullNumberString = dateString + timestamp + randomDigits; + + return fullNumberString; + } + + // 随机盐生成函数 + generateRandomString = () => { + const lowerCaseLetters = 'abcdefghijklmnopqrstuvwxyz'; + const upperCaseLetters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + const numbers = '0123456789'; + + let result = ''; + + // 生成5位随机小写字母 + for (let i = 0; i < 5; i++) { + const randomIndex = Math.floor(Math.random() * lowerCaseLetters.length); + result += lowerCaseLetters[randomIndex]; + } + + // 生成5位随机大写字母 + for (let i = 0; i < 5; i++) { + const randomIndex = Math.floor(Math.random() * upperCaseLetters.length); + result += upperCaseLetters[randomIndex]; + } + + // 生成2位随机数字 + for (let i = 0; i < 2; i++) { + const randomIndex = Math.floor(Math.random() * numbers.length); + result += numbers[randomIndex]; + } + + // 打乱整个字符串 + const characters = result.split(''); + for (let i = characters.length - 1; i > 0; i--) { + const j = Math.floor(Math.random() * (i + 1)); + [characters[i], characters[j]] = [characters[j], characters[i]]; + } + + return characters.join(''); + } +} + +module.exports = BaseService; \ No newline at end of file diff --git a/app/middleware/log.js b/app/middleware/log.js new file mode 100644 index 0000000..6d7323a --- /dev/null +++ b/app/middleware/log.js @@ -0,0 +1,72 @@ +// 错误日志 +const fs = require('fs'); +const os = require('os'); +const path = require('path'); + +const dirCheck = (dirPath) => { + // 检查文件夹是否存在 + fs.access(dirPath, fs.constants.F_OK, (err) => { + if (err) { + // 文件夹不存在 + console.log('文件夹不存在,正在创建...'); + fs.mkdir(dirPath, { recursive: true }, (err) => { + if (err) throw err; + console.log('文件夹已创建'); + }); + } else { + // 文件夹存在 + console.log('文件夹已存在'); + } + }); +} + +module.exports = (filePath, msg) => { + // 获取时间 + let now = new Date(), + times = { + year: now.getFullYear(), + month: now.getMonth() + 1, + day: now.getDate(), + hour: now.getHours(), + minute: now.getMinutes(), + second: now.getSeconds() + }; + // 获取操作系统类型 + const type = os.type(); + console.log(`操作系统类型: ${type}`); + filePath = path.join(__dirname, filePath); + dirCheck(filePath); + const yearPath = filePath + '/' + times.year; + dirCheck(yearPath); + const monthPath = yearPath + '/' + times.month; + dirCheck(monthPath); + const dayPath = monthPath + '/' + times.day + '.txt'; + const logTime = '[' + times.year + '-' + times.month + '-' + times.day + '>>>' + times.hour + ':' + times.minute + ':' + times.second + ']' + '>>>'; + let crlf; + // 判断操作系统类型,设置换行符 + if (type === 'Windows_NT') { + crlf = '\n'; + } else { + crlf = '\r\n'; + } + // 读取文件内容 + fs.readFile(dayPath, 'utf8', (err, data) => { + if (err) { + if (err.code === 'ENOENT') { + // 文件不存在,直接写入新内容(这里实际上还是使用了覆盖的方式) + fs.writeFile(dayPath, logTime + msg + crlf, (err) => { + if (err) throw err; + console.log('文件已创建并写入新内容'); + }); + } else { + throw err; + } + } else { + // 文件存在,追加新内容 + fs.appendFile(dayPath, logTime + msg + crlf, (err) => { + if (err) throw err; + console.log('新内容已追加到文件'); + }); + } + }); +}; \ No newline at end of file diff --git a/app/model/Examinee.js b/app/model/Examinee.js new file mode 100644 index 0000000..7a1a495 --- /dev/null +++ b/app/model/Examinee.js @@ -0,0 +1,31 @@ +'use strict'; + +module.exports = (app) => { + const { INTEGER, CHAR, STRING, DATE } = app.Sequelize; + + const Examinee = app.model.define('examinee', { + id: { type: INTEGER(8), primaryKey: true, autoIncrement: true }, + uid: CHAR(15), + salt: CHAR(24), + password: CHAR(64), + user_name: STRING(10), + identity_card: CHAR(18), + real_check: INTEGER(3), + workplace: STRING(60), + address: STRING(120), + phone: CHAR(11), + email: STRING(60), + referrers: STRING(60), + status: INTEGER(3), + created_at: DATE, + updated_at: DATE, + login_status: INTEGER(3), + },{ + freezeTableName: true, + timestamp: true, + createdAt: true, + updatedAt: true, + }); + + return Examinee; +}; \ No newline at end of file diff --git a/app/model/Whitelist.js b/app/model/Whitelist.js new file mode 100644 index 0000000..71261da --- /dev/null +++ b/app/model/Whitelist.js @@ -0,0 +1,19 @@ +'use strict'; + +module.exports = (app) => { + const { INTEGER, CHAR, DATE } = app.Sequelize; + + const Whitelist = app.model.define('whitelist', { + id: { type: INTEGER(5), primaryKey: true, autoIncrement: true }, + user_uid: CHAR(15), + type: INTEGER(3), + expired_at: DATE, + },{ + freezeTableName: true, + timestamp: true, + createdAt: false, + updatedAt: false, + }); + + return Whitelist; +}; \ No newline at end of file diff --git a/app/model2/Interlocution.js b/app/model2/Interlocution.js new file mode 100644 index 0000000..516e19e --- /dev/null +++ b/app/model2/Interlocution.js @@ -0,0 +1,19 @@ +'use strict'; + +module.exports = (app) => { + const { INTEGER, STRING } = app.Sequelize; + + const Interlocution = app.model2.define('interlocution', { + id: { type: INTEGER(5), primaryKey: true, autoIncrement: true }, + stem: STRING(400), + answer: STRING(400), + difficulty: INTEGER(3), + },{ + freezeTableName: true, + timestamp: false, + createdAt: false, + updatedAt: false, + }); + + return Interlocution; +}; \ No newline at end of file diff --git a/app/model2/Judgment.js b/app/model2/Judgment.js new file mode 100644 index 0000000..4c91502 --- /dev/null +++ b/app/model2/Judgment.js @@ -0,0 +1,19 @@ +'use strict'; + +module.exports = (app) => { + const { INTEGER, STRING } = app.Sequelize; + + const Judgment = app.model2.define('judgment', { + id: { type: INTEGER(5), primaryKey: true, autoIncrement: true }, + stem: STRING(400), + answer: INTEGER(1), + difficulty: INTEGER(3), + },{ + freezeTableName: true, + timestamp: false, + createdAt: false, + updatedAt: false, + }); + + return Judgment; +}; \ No newline at end of file diff --git a/app/model2/Multiple.js b/app/model2/Multiple.js new file mode 100644 index 0000000..12f05c5 --- /dev/null +++ b/app/model2/Multiple.js @@ -0,0 +1,24 @@ +'use strict'; + +module.exports = (app) => { + const { INTEGER, STRING } = app.Sequelize; + + const Multiple = app.model2.define('multiple', { + id: { type: INTEGER(5), primaryKey: true, autoIncrement: true }, + stem: STRING(400), + options_a: STRING(400), + options_b: STRING(400), + options_c: STRING(400), + options_d: STRING(400), + options_e: STRING(400), + answer: STRING(5), + difficulty: INTEGER(3), + },{ + freezeTableName: true, + timestamp: false, + createdAt: false, + updatedAt: false, + }); + + return Multiple; +}; \ No newline at end of file diff --git a/app/model2/Radio.js b/app/model2/Radio.js new file mode 100644 index 0000000..1517e9e --- /dev/null +++ b/app/model2/Radio.js @@ -0,0 +1,23 @@ +'use strict'; + +module.exports = (app) => { + const { INTEGER, STRING, CHAR } = app.Sequelize; + + const Radio = app.model2.define('radio', { + id: { type: INTEGER(5), primaryKey: true, autoIncrement: true }, + stem: STRING(400), + options_a: STRING(400), + options_b: STRING(400), + options_c: STRING(400), + options_d: STRING(400), + answer: CHAR(1), + difficulty: INTEGER(3), + },{ + freezeTableName: true, + timestamp: false, + createdAt: false, + updatedAt: false, + }); + + return Radio; +}; \ No newline at end of file diff --git a/app/router.js b/app/router.js new file mode 100644 index 0000000..37ed612 --- /dev/null +++ b/app/router.js @@ -0,0 +1,19 @@ +/** + * @param {Egg.Application} app - egg application + */ +module.exports = app => { + const { router, controller } = app; + + // 题库登录接口 + router.post("/login", controller.home.login); + // 获取题库登录状态接口 + router.post("/loginStatus", controller.home.loginStatus); + // 获取单选题接口 + router.post("/radio", controller.home.radio); + // 获取多选题接口 + router.post("/multiple", controller.home.multiple); + // 获取判断题接口 + router.post("/judgment", controller.home.judgment); + // 获取问答题接口 + router.post("/interlocution", controller.home.interlocution); +}; diff --git a/app/service/home.js b/app/service/home.js new file mode 100644 index 0000000..5006901 --- /dev/null +++ b/app/service/home.js @@ -0,0 +1,119 @@ +'use strict'; + +const Service = require('../core/base_service'); + +const { Op } = require('sequelize'); + +const fileName = "Home"; + +class HomeService extends Service { + // 题库登录接口 + async login(body) { + const { ctx } = this; + try { + const phone = this.decryptRequest(body.phone); + const password = this.decryptRequest(body.password); + let attributes = ['uid', 'salt', 'password'], where = { phone }, dbOptions; + dbOptions = { attributes, where } + const user = await ctx.model.Examinee.findOne(dbOptions); + if (user == null) return false; + if (user.dataValues.password != this.shaForm(password, this.decryptRequest(user.dataValues.salt))) return false; + const result = await ctx.model.Whitelist.findOne({ where: { user_uid: user.dataValues.uid } }); + if (result == null) return false; + if (result.dataValues.type == '0') return result; + console.log(result.dataValues) + console.log(new Date()) + if (result.dataValues.type == '1' && result.dataValues.expired_at < new Date()) { + return false; + } else { + return result; + } + } catch (error) { + const blockName = fileName + "--" + "login"; + ctx.app.middleware.log('../../serviceLog', blockName + ">>>>" + error); + return 'error'; + } + } + + // 获取单选题接口 + async radio(body) { + const { ctx } = this; + try { + let limit = 1; + let { offset } = body; + offset = (offset - 1) * limit; + let dbOptions = { offset, limit } + const result = await ctx.model2.Radio.findAndCountAll(dbOptions); + await ctx.model2.Radio.min('id').then(min => { + result.min = min; + }); + return result.rows.length == 0 ? false : result; + } catch (error) { + const blockName = fileName + "--" + "radio"; + ctx.app.middleware.log('../../serviceLog', blockName + ">>>>" + error); + return 'error'; + } + } + + // 获取多选题接口 + async multiple(body) { + const { ctx } = this; + try { + let limit = 1; + let { offset } = body; + offset = (offset - 1) * limit; + let dbOptions = { offset, limit } + const result = await ctx.model2.Multiple.findAndCountAll(dbOptions); + await ctx.model2.Multiple.min('id').then(min => { + result.min = min; + }); + return result.rows.length == 0 ? false : result; + } catch (error) { + const blockName = fileName + "--" + "multiple"; + ctx.app.middleware.log('../../serviceLog', blockName + ">>>>" + error); + return 'error'; + } + } + + // 获取判断题接口 + async judgment(body) { + const { ctx } = this; + try { + let limit = 1; + let { offset } = body; + offset = (offset - 1) * limit; + let dbOptions = { offset, limit } + const result = await ctx.model2.Judgment.findAndCountAll(dbOptions); + await ctx.model2.Judgment.min('id').then(min => { + result.min = min; + }); + return result.rows.length == 0 ? false : result; + } catch (error) { + const blockName = fileName + "--" + "judgment"; + ctx.app.middleware.log('../../serviceLog', blockName + ">>>>" + error); + return 'error'; + } + } + + // 获取问答题接口 + async interlocution(body) { + const { ctx } = this; + try { + let limit = 1; + let { offset } = body; + offset = (offset - 1) * limit; + let dbOptions = { offset, limit } + const result = await ctx.model2.Interlocution.findAndCountAll(dbOptions); + await ctx.model2.Interlocution.min('id').then(min => { + result.min = min; + }); + return result.rows.length == 0 ? false : result; + } catch (error) { + const blockName = fileName + "--" + "interlocution"; + ctx.app.middleware.log('../../serviceLog', blockName + ">>>>" + error); + return 'error'; + } + } +} + +module.exports = HomeService; \ No newline at end of file diff --git a/config/config.default.js b/config/config.default.js new file mode 100644 index 0000000..b14ff9f --- /dev/null +++ b/config/config.default.js @@ -0,0 +1,109 @@ +/* eslint valid-jsdoc: "off" */ + +/** + * @param {Egg.EggAppInfo} appInfo app info + */ + +module.exports = appInfo => { + /** + * built-in config + * @type {Egg.EggAppConfig} + **/ + const config = exports = {}; + + // use for cookie sign key, should change to your own and keep security + config.keys = appInfo.name + '_1715070315660_7890'; + + // add your middleware config here + // config.middleware = []; + + config.multipart = { + mode: 'file', // 使用文件模式保存上传的文件 + whitelist: () => true, // 允许所有文件类型上传 + }; + + config.security = { + csrf:{ + enable:false + }, + }; + + config.redis = { + // 开发/测试环境 + clients: { + db3: { + port: 6379, + host: '127.0.0.1', + password: '74191221', + db: 3 + } + } + + // 生产环境 + // clients: { + // db3: { + // port: 6379, + // host: '127.0.0.1', + // password: 'bd3@htcc2023', + // db: 5 + // } + // } + }; + + config.sequelize = { + // 开发/测试环境 + datasources: [ + { + dialect: 'mariadb', + host: 'localhost', + port: 3306, + username: 'root', + password: '74191221', + database: 'bdTrainingExam' + }, + { + dialect: 'mariadb', + host: 'localhost', + port: 3306, + username: 'root', + password: '74191221', + database: 'trainingTopic', + delegate: 'model2', + baseDir: 'model2', + }, + ] + + // 生产环境 + // datasources: [ + // { + // dialect: 'mariadb', + // host: 'localhost', + // port: 3306, + // username: 'bdqh_platform', + // password: '124689@XXxx', + // database: 'bdTrainingExam' + // }, + // { + // dialect: 'mariadb', + // host: 'localhost', + // port: 3306, + // username: 'bdqh_platform', + // password: '124689@XXxx', + // database: 'trainingTopic', + // delegate: 'model2', + // baseDir: 'model2', + // } + // ] + }; + + // add your user config here + const userConfig = { + // myAppName: 'egg', + salt:'bdTrainingExam' + }; + + return { + ...config, + ...userConfig, + }; +}; diff --git a/config/plugin.js b/config/plugin.js new file mode 100644 index 0000000..0964205 --- /dev/null +++ b/config/plugin.js @@ -0,0 +1,21 @@ +/** @type Egg.EggPlugin */ +module.exports = { + // had enabled by egg + // static: { + // enable: true, + // } + redis: { + enable: true, + package: 'egg-redis', + }, + + sequelize: { + enable: true, + package: 'egg-sequelize', + }, + + validate: { + enable: true, + package: 'egg-validate', + }, +}; diff --git a/controllerLog/2025/2/28.txt b/controllerLog/2025/2/28.txt new file mode 100644 index 0000000..38f4433 --- /dev/null +++ b/controllerLog/2025/2/28.txt @@ -0,0 +1,8 @@ +[2025-2-28>>>11:45:1]>>>System--examMsg>>>>TypeError: this.checkUid is not a function +[2025-2-28>>>11:49:11]>>>System--examMsg>>>>TypeError: Cannot read properties of undefined (reading 'get') +[2025-2-28>>>11:58:40]>>>System--examMsg>>>>TypeError: Cannot read properties of undefined (reading 'get') +[2025-2-28>>>11:58:59]>>>System--examMsg>>>>TypeError: Cannot read properties of undefined (reading 'get') +[2025-2-28>>>13:57:5]>>>System--examMsg>>>>TypeError: Cannot read properties of undefined (reading 'get') +[2025-2-28>>>13:58:15]>>>System--examMsg>>>>TypeError: Cannot read properties of undefined (reading 'get') +[2025-2-28>>>13:59:26]>>>System--examMsg>>>>TypeError: Cannot read properties of undefined (reading 'get') +[2025-2-28>>>13:59:43]>>>System--examMsg>>>>TypeError: Cannot read properties of undefined (reading 'get') diff --git a/controllerLog/2025/3/11.txt b/controllerLog/2025/3/11.txt new file mode 100644 index 0000000..ceeabf7 --- /dev/null +++ b/controllerLog/2025/3/11.txt @@ -0,0 +1,23 @@ +[2025-3-11>>>15:47:43]>>>User--CNTEV>>>>TypeError: Cannot read properties of null (reading 'real_check') +[2025-3-11>>>15:49:1]>>>User--CNTEV>>>>TypeError: Cannot read properties of null (reading 'real_check') +[2025-3-11>>>15:49:26]>>>User--CNTEV>>>>ResponseTimeoutError: Response timeout for 3000ms, POST http://127.0.0.1:8011/CNTEV -1 (connected: true, keepalive socket: false, agent status: {"createSocketCount":1,"createSocketErrorCount":0,"closeSocketCount":1,"errorSocketCount":0,"timeoutSocketCount":0,"requestCount":0,"freeSockets":{},"sockets":{},"requests":{}}, socketHandledRequests: 1, socketHandledResponses: 0) +headers: {} +[2025-3-11>>>16:39:57]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>16:41:4]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>16:41:29]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>16:41:41]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>16:45:5]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>16:46:22]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>16:47:19]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>16:48:21]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>16:48:57]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>16:49:26]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>16:49:45]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>16:51:28]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>16:52:16]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>16:52:49]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>16:53:12]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>16:53:48]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>17:18:21]>>>User--uploadPhoto>>>>ReferenceError: result is not defined +[2025-3-11>>>17:20:47]>>>User--uploadPhoto>>>>Error: ENOENT: no such file or directory, rename 'D:\bdqh-technology-education-platform\back-end\bd-training-exam\app\controller\1741681282631.jpg' -> 'D:\bdqh-technology-education-platform\back-end\bd-training-exam\app\controller\142327200010180611.jpg' +[2025-3-11>>>17:26:20]>>>User--uploadPhoto>>>>Error: EXDEV: cross-device link not permitted, rename 'C:\Users\23577\AppData\Local\Temp\egg-multipart-tmp\bd-training-exam\2025\03\11\17\23234a9a-7469-46ab-9a6c-04e5ab9768d9.jpg' -> 'D:\bdqh-technology-education-platform\back-end\bd-training-exam\app\public\userPhoto\142327200010180611.jpg' diff --git a/controllerLog/2025/3/12.txt b/controllerLog/2025/3/12.txt new file mode 100644 index 0000000..19a716e --- /dev/null +++ b/controllerLog/2025/3/12.txt @@ -0,0 +1 @@ +[2025-3-12>>>11:20:57]>>>System--diffCode>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') diff --git a/controllerLog/2025/3/13.txt b/controllerLog/2025/3/13.txt new file mode 100644 index 0000000..9f4e307 --- /dev/null +++ b/controllerLog/2025/3/13.txt @@ -0,0 +1,21 @@ +[2025-3-13>>>11:10:26]>>>System--diffIdentityCard>>>>TypeError: data.join is not a function +[2025-3-13>>>11:12:21]>>>System--diffPhone>>>>ReferenceError: Cannot access 'data' before initialization +[2025-3-13>>>11:12:25]>>>System--diffPhone>>>>ReferenceError: Cannot access 'data' before initialization +[2025-3-13>>>11:12:27]>>>System--diffPhone>>>>ReferenceError: Cannot access 'data' before initialization +[2025-3-13>>>11:12:28]>>>System--diffPhone>>>>ReferenceError: Cannot access 'data' before initialization +[2025-3-13>>>11:13:41]>>>System--diffPhone>>>>ReferenceError: Cannot access 'data' before initialization +[2025-3-13>>>11:14:17]>>>System--diffPhone>>>>ReferenceError: Cannot access 'data' before initialization +[2025-3-13>>>17:48:7]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'forEach') +[2025-3-13>>>17:48:7]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'forEach') +[2025-3-13>>>17:48:7]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'forEach') +[2025-3-13>>>17:48:7]>>>Exam--gradesList>>>>TypeError: Cannot read properties of undefined (reading 'forEach') +[2025-3-13>>>17:48:7]>>>Exam--gradesList>>>>TypeError: Cannot read properties of undefined (reading 'forEach') +[2025-3-13>>>17:48:7]>>>Exam--gradesList>>>>TypeError: Cannot read properties of undefined (reading 'forEach') +[2025-3-13>>>17:48:7]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'forEach') +[2025-3-13>>>17:48:7]>>>Exam--gradesList>>>>TypeError: Cannot read properties of undefined (reading 'forEach') +[2025-3-13>>>17:48:12]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'forEach') +[2025-3-13>>>17:49:34]>>>Exam--applicationList>>>>TypeError: Cannot read properties of undefined (reading 'forEach') +[2025-3-13>>>19:13:0]>>>Exam--application>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-3-13>>>19:31:7]>>>User--checkInfo>>>>TypeError: Cannot read properties of undefined (reading 'dataValues') +[2025-3-13>>>19:38:41]>>>Exam--application>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-3-13>>>19:40:24]>>>Exam--application>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') diff --git a/controllerLog/2025/3/14.txt b/controllerLog/2025/3/14.txt new file mode 100644 index 0000000..e7b3c0c --- /dev/null +++ b/controllerLog/2025/3/14.txt @@ -0,0 +1 @@ +[2025-3-14>>>15:40:24]>>>Exam--cancelApplication>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') diff --git a/controllerLog/2025/4/2.txt b/controllerLog/2025/4/2.txt new file mode 100644 index 0000000..f44c364 --- /dev/null +++ b/controllerLog/2025/4/2.txt @@ -0,0 +1,29 @@ +[2025-4-2>>>14:25:13]>>>Home--radio>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>14:58:51]>>>Home--multiple>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>14:59:25]>>>Home--multiple>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:0:28]>>>Home--radio>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:0:29]>>>Home--radio>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:0:32]>>>Home--judgment>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:0:32]>>>Home--interlocution>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:0:32]>>>Home--radio>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:0:32]>>>Home--multiple>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:1:39]>>>Home--radio>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:1:39]>>>Home--multiple>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:1:39]>>>Home--judgment>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:1:39]>>>Home--interlocution>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:4:22]>>>Home--radio>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:4:22]>>>Home--multiple>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:4:22]>>>Home--judgment>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:4:22]>>>Home--interlocution>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:4:42]>>>Home--judgment>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:4:42]>>>Home--radio>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:4:42]>>>Home--multiple>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:4:42]>>>Home--interlocution>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:8:15]>>>Home--radio>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:8:15]>>>Home--multiple>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:8:15]>>>Home--judgment>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:8:15]>>>Home--interlocution>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:8:22]>>>Home--multiple>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:8:22]>>>Home--judgment>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:8:22]>>>Home--radio>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-2>>>17:8:22]>>>Home--interlocution>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') diff --git a/controllerLog/2025/4/21.txt b/controllerLog/2025/4/21.txt new file mode 100644 index 0000000..8fb2282 --- /dev/null +++ b/controllerLog/2025/4/21.txt @@ -0,0 +1,6 @@ +[2025-4-21>>>11:31:57]>>>Home--judgment>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +xt') +[2025-4-21>>>11:39:20]>>>Home--radio>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-21>>>11:39:20]>>>Home--multiple>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-21>>>11:39:20]>>>Home--interlocution>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-21>>>11:39:20]>>>Home--judgment>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') diff --git a/controllerLog/2025/4/3.txt b/controllerLog/2025/4/3.txt new file mode 100644 index 0000000..adbfe77 --- /dev/null +++ b/controllerLog/2025/4/3.txt @@ -0,0 +1,4 @@ +[2025-4-3>>>17:39:45]>>>Home--radio>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-3>>>17:39:45]>>>Home--judgment>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-3>>>17:39:45]>>>Home--interlocution>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') +[2025-4-3>>>17:39:45]>>>Home--multiple>>>>TypeError: Cannot read properties of undefined (reading 'ciphertext') diff --git a/database/config.json b/database/config.json new file mode 100644 index 0000000..1b65e53 --- /dev/null +++ b/database/config.json @@ -0,0 +1,23 @@ +{ + "development": { + "username": "root", + "password": 74191221, + "database": "vm_centos", + "host": "127.0.0.1", + "dialect": "mariadb" + }, + "test": { + "username": "root", + "password": 74191221, + "database": "vm_centos", + "host": "127.0.0.1", + "dialect": "mariadb" + }, + "production": { + "username": "root", + "password": 74191221, + "database": "vm_centos", + "host": "127.0.0.1", + "dialect": "mariadb" + } +} diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..1bbed3f --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,5 @@ +{ + "include": [ + "**/*" + ] +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..c629456 --- /dev/null +++ b/package.json @@ -0,0 +1,49 @@ +{ + "name": "bd-training-exam-topic", + "version": "1.0.0", + "description": "", + "private": true, + "egg": { + "declarations": true + }, + "dependencies": { + "crypto-js": "^4.2.0", + "egg": "^3.17.5", + "egg-multipart": "^3.5.0", + "egg-redis": "^2.6.0", + "egg-schedule": "^4.0.1", + "egg-scripts": "2", + "egg-sequelize": "^6.0.0", + "egg-validate": "^2.0.2", + "ioredis": "^5.4.1", + "mariadb": "^3.3.0", + "mysql2": "^3.9.7", + "sequelize": "^6.37.3" + }, + "devDependencies": { + "egg-bin": "6", + "egg-mock": "5", + "eslint": "8", + "eslint-config-egg": "13", + "sequelize-cli": "^6.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "scripts": { + "start": "egg-scripts start --daemon --port=8021 --title=egg-server-bd-training-exam-topic", + "stop": "egg-scripts stop --title=egg-server-bd-training-exam-topic", + "dev": "egg-bin dev --port=8021", + "test": "npm run lint -- --fix && npm run test:local", + "test:local": "egg-bin test", + "cov": "egg-bin cov", + "lint": "eslint .", + "ci": "npm run lint && npm run cov" + }, + "repository": { + "type": "git", + "url": "" + }, + "author": "", + "license": "MIT" +} diff --git a/serviceLog/2025/3/11.txt b/serviceLog/2025/3/11.txt new file mode 100644 index 0000000..3bf7e71 --- /dev/null +++ b/serviceLog/2025/3/11.txt @@ -0,0 +1,8 @@ +[2025-3-11>>>15:45:31]>>>User--CNTEV>>>>SequelizeDatabaseError: (conn:148, no: 1054, SQLState: 42S22) Unknown column 'examinee.idCard' in 'where clause' +sql: SELECT `real_check` FROM `examinee` AS `examinee` WHERE `examinee`.`idCard` = '142327200010180611' AND `examinee`.`name` = '屈彪彪' LIMIT 1; - parameters:[] +[2025-3-11>>>17:38:53]>>>User--uploadPhoto>>>>TypeError: Cannot read properties of undefined (reading '0') +[2025-3-11>>>17:39:16]>>>User--uploadPhoto>>>>TypeError: Cannot read properties of undefined (reading '0') +[2025-3-11>>>17:40:5]>>>User--uploadPhoto>>>>TypeError: Cannot read properties of undefined (reading '0') +[2025-3-11>>>17:40:47]>>>User--uploadPhoto>>>>TypeError: Cannot read properties of undefined (reading '0') +[2025-3-11>>>17:40:54]>>>User--uploadPhoto>>>>TypeError: Cannot read properties of undefined (reading '0') +[2025-3-11>>>17:41:18]>>>User--uploadPhoto>>>>TypeError: Cannot read properties of undefined (reading '0') diff --git a/serviceLog/2025/3/12.txt b/serviceLog/2025/3/12.txt new file mode 100644 index 0000000..6ad1130 --- /dev/null +++ b/serviceLog/2025/3/12.txt @@ -0,0 +1,9 @@ +[2025-3-12>>>11:0:51]>>>User--checkInfo>>>>Error: WHERE parameter "account_name" has invalid "undefined" value +[2025-3-12>>>11:1:47]>>>User--checkInfo>>>>Error: WHERE parameter "account_name" has invalid "undefined" value +[2025-3-12>>>11:1:58]>>>User--checkInfo>>>>Error: WHERE parameter "identity_card" has invalid "undefined" value +[2025-3-12>>>12:40:45]>>>System--registered>>>>SequelizeDatabaseError: (conn:209, no: 1406, SQLState: 22001) Data too long for column 'gender' at row 1 +sql: INSERT INTO `examinee` (`id`,`uid`,`salt`,`account_name`,`password`,`identity_card`,`user_name`,`real_check`,`gender`,`age`,`email`,`phone`,`address`,`workplace`,`status`,`created_at`,`updated_at`,`login_status`) VALUES (DEFAULT,?,?,?,?,?,?,?,?,?,?,?,?,?,?... +[2025-3-12>>>12:42:40]>>>System--registered>>>>SequelizeDatabaseError: (conn:217, no: 1406, SQLState: 22001) Data too long for column 'gender' at row 1 +sql: INSERT INTO `examinee` (`id`,`uid`,`salt`,`account_name`,`password`,`identity_card`,`user_name`,`real_check`,`gender`,`age`,`email`,`phone`,`address`,`workplace`,`status`,`created_at`,`updated_at`,`login_status`) VALUES (DEFAULT,?,?,?,?,?,?,?,?,?,?,?,?,?,?... +[2025-3-12>>>12:47:17]>>>System--registered>>>>SequelizeDatabaseError: (conn:232, no: 1406, SQLState: 22001) Data too long for column 'gender' at row 1 +sql: INSERT INTO `examinee` (`id`,`uid`,`salt`,`account_name`,`password`,`identity_card`,`user_name`,`real_check`,`gender`,`age`,`email`,`phone`,`address`,`workplace`,`status`,`created_at`,`updated_at`,`login_status`) VALUES (DEFAULT,?,?,?,?,?,?,?,?,?,?,?,?,?,?... diff --git a/serviceLog/2025/3/13.txt b/serviceLog/2025/3/13.txt new file mode 100644 index 0000000..e33f5c6 --- /dev/null +++ b/serviceLog/2025/3/13.txt @@ -0,0 +1,18 @@ +[2025-3-13>>>11:7:16]>>>System--diffIdentityCard>>>>TypeError: Cannot read properties of null (reading 'dataValues') +[2025-3-13>>>11:28:29]>>>System--diffIdentityCard>>>>ReferenceError: dbOptions is not defined +[2025-3-13>>>11:54:12]>>>System--diffIdentityCard>>>>TypeError: Cannot read properties of null (reading 'dataValues') +[2025-3-13>>>16:23:15]>>>User--checkInfo>>>>Error: WHERE parameter "account_name" has invalid "undefined" value +[2025-3-13>>>19:12:52]>>>User--checkInfo>>>>Error: WHERE parameter "account_name" has invalid "undefined" value +[2025-3-13>>>19:20:34]>>>User--checkInfo>>>>Error: WHERE parameter "account_name" has invalid "undefined" value +[2025-3-13>>>19:21:48]>>>User--checkInfo>>>>Error: WHERE parameter "account_name" has invalid "undefined" value +[2025-3-13>>>19:22:32]>>>User--checkInfo>>>>Error: WHERE parameter "account_name" has invalid "undefined" value +[2025-3-13>>>19:26:5]>>>User--checkInfo>>>>Error: WHERE parameter "account_name" has invalid "undefined" value +[2025-3-13>>>19:26:25]>>>User--checkInfo>>>>Error: WHERE parameter "account_name" has invalid "undefined" value +[2025-3-13>>>19:44:51]>>>Exam--application>>>>SequelizeForeignKeyConstraintError: (conn:1065, no: 1452, SQLState: 23000) Cannot add or update a child row: a foreign key constraint fails (`bdtrainingexam`.`application`, CONSTRAINT `FK_application_examination` FOREIGN KEY (`exam_uid`) REFERENCES `examination` (`uid`)) +sql: INSERT INTO `application` (`id`,`user_uid`,`exam_uid`,`source`,`status`,`pay_status`,`result`,`created_at`) VALUES (DEFAULT,?,?,?,?,?,?,?); - parameters:['20250312837014E','','个人',0,0,'用户个人报名','2025-03-13 11:44:51.948'] +[2025-3-13>>>19:44:55]>>>Exam--application>>>>SequelizeForeignKeyConstraintError: (conn:1065, no: 1452, SQLState: 23000) Cannot add or update a child row: a foreign key constraint fails (`bdtrainingexam`.`application`, CONSTRAINT `FK_application_examination` FOREIGN KEY (`exam_uid`) REFERENCES `examination` (`uid`)) +sql: INSERT INTO `application` (`id`,`user_uid`,`exam_uid`,`source`,`status`,`pay_status`,`result`,`created_at`) VALUES (DEFAULT,?,?,?,?,?,?,?); - parameters:['20250312837014E','','个人',0,0,'用户个人报名','2025-03-13 11:44:55.936'] +[2025-3-13>>>20:19:1]>>>User--checkInfo>>>>ReferenceError: identity_card is not defined +[2025-3-13>>>20:19:35]>>>User--checkInfo>>>>ReferenceError: identity_card is not defined +[2025-3-13>>>20:26:49]>>>User--checkInfo>>>>ResponseTimeoutError: Response timeout for 3000ms, POST http://127.0.0.1:8011/CNTEV -1 (connected: true, keepalive socket: false, agent status: {"createSocketCount":1,"createSocketErrorCount":0,"closeSocketCount":1,"errorSocketCount":0,"timeoutSocketCount":0,"requestCount":0,"freeSockets":{},"sockets":{},"requests":{}}, socketHandledRequests: 1, socketHandledResponses: 0) +headers: {} diff --git a/serviceLog/2025/3/14.txt b/serviceLog/2025/3/14.txt new file mode 100644 index 0000000..c7498ab --- /dev/null +++ b/serviceLog/2025/3/14.txt @@ -0,0 +1,24 @@ +[2025-3-14>>>11:6:27]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:215, no: 1054, SQLState: 42S22) Unknown column 'application.uid' in 'where clause' +sql: SELECT `id`, `user_uid`, `exam_uid`, `source`, `status`, `pay_status`, `result`, `created_at`, `created_at` AS `createdAt` FROM `application` AS `application` WHERE `application`.`uid` = '20250312837014E'; - parameters:[] +[2025-3-14>>>11:6:27]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:220, no: 1054, SQLState: 42S22) Unknown column 'application.uid' in 'where clause' +sql: SELECT `id`, `user_uid`, `exam_uid`, `source`, `status`, `pay_status`, `result`, `created_at`, `created_at` AS `createdAt` FROM `application` AS `application` WHERE `application`.`uid` = '20250312837014E'; - parameters:[] +[2025-3-14>>>11:6:27]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:219, no: 1054, SQLState: 42S22) Unknown column 'application.uid' in 'where clause' +sql: SELECT `id`, `user_uid`, `exam_uid`, `source`, `status`, `pay_status`, `result`, `created_at`, `created_at` AS `createdAt` FROM `application` AS `application` WHERE `application`.`uid` = '20250312837014E'; - parameters:[] +[2025-3-14>>>11:6:27]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:219, no: 1054, SQLState: 42S22) Unknown column 'application.uid' in 'where clause' +sql: SELECT `id`, `user_uid`, `exam_uid`, `source`, `status`, `pay_status`, `result`, `created_at`, `created_at` AS `createdAt` FROM `application` AS `application` WHERE `application`.`uid` = '20250312837014E'; - parameters:[] +[2025-3-14>>>11:6:27]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:221, no: 1054, SQLState: 42S22) Unknown column 'application.uid' in 'where clause' +sql: SELECT `id`, `user_uid`, `exam_uid`, `source`, `status`, `pay_status`, `result`, `created_at`, `created_at` AS `createdAt` FROM `application` AS `application` WHERE `application`.`uid` = '20250312837014E'; - parameters:[] +[2025-3-14>>>11:6:27]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:219, no: 1054, SQLState: 42S22) Unknown column 'application.uid' in 'where clause' +sql: SELECT `id`, `user_uid`, `exam_uid`, `source`, `status`, `pay_status`, `result`, `created_at`, `created_at` AS `createdAt` FROM `application` AS `application` WHERE `application`.`uid` = '20250312837014E'; - parameters:[] +[2025-3-14>>>11:6:40]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:225, no: 1054, SQLState: 42S22) Unknown column 'application.uid' in 'where clause' +sql: SELECT `id`, `user_uid`, `exam_uid`, `source`, `status`, `pay_status`, `result`, `created_at`, `created_at` AS `createdAt` FROM `application` AS `application` WHERE `application`.`uid` = '20250312837014E'; - parameters:[] +[2025-3-14>>>11:6:40]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:227, no: 1054, SQLState: 42S22) Unknown column 'application.uid' in 'where clause' +sql: SELECT `id`, `user_uid`, `exam_uid`, `source`, `status`, `pay_status`, `result`, `created_at`, `created_at` AS `createdAt` FROM `application` AS `application` WHERE `application`.`uid` = '20250312837014E'; - parameters:[] +[2025-3-14>>>11:6:40]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:224, no: 1054, SQLState: 42S22) Unknown column 'application.uid' in 'where clause' +sql: SELECT `id`, `user_uid`, `exam_uid`, `source`, `status`, `pay_status`, `result`, `created_at`, `created_at` AS `createdAt` FROM `application` AS `application` WHERE `application`.`uid` = '20250312837014E'; - parameters:[] +[2025-3-14>>>11:6:40]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:228, no: 1054, SQLState: 42S22) Unknown column 'application.uid' in 'where clause' +sql: SELECT `id`, `user_uid`, `exam_uid`, `source`, `status`, `pay_status`, `result`, `created_at`, `created_at` AS `createdAt` FROM `application` AS `application` WHERE `application`.`uid` = '20250312837014E'; - parameters:[] +[2025-3-14>>>11:6:40]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:225, no: 1054, SQLState: 42S22) Unknown column 'application.uid' in 'where clause' +sql: SELECT `id`, `user_uid`, `exam_uid`, `source`, `status`, `pay_status`, `result`, `created_at`, `created_at` AS `createdAt` FROM `application` AS `application` WHERE `application`.`uid` = '20250312837014E'; - parameters:[] +[2025-3-14>>>11:6:40]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:226, no: 1054, SQLState: 42S22) Unknown column 'application.uid' in 'where clause' +sql: SELECT `id`, `user_uid`, `exam_uid`, `source`, `status`, `pay_status`, `result`, `created_at`, `created_at` AS `createdAt` FROM `application` AS `application` WHERE `application`.`uid` = '20250312837014E'; - parameters:[] diff --git a/serviceLog/2025/3/17.txt b/serviceLog/2025/3/17.txt new file mode 100644 index 0000000..f151697 --- /dev/null +++ b/serviceLog/2025/3/17.txt @@ -0,0 +1,75 @@ +[2025-3-17>>>10:31:14]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:117, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:31:14]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:120, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:31:14]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:123, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:31:14]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:120, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:31:14]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:123, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:31:15]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:120, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:33:27]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:127, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:33:27]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:129, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:33:27]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:127, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:33:27]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:129, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:33:27]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:127, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:33:28]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:126, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:35:41]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:133, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:35:41]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:133, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:35:41]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:135, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:35:41]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:133, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:35:41]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:131, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:35:41]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:135, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:35:49]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:133, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:35:49]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:132, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:35:49]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:133, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:35:49]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:132, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:35:49]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:135, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:35:49]>>>Exam--examList>>>>SequelizeDatabaseError: (conn:135, no: 1054, SQLState: 42S22) Unknown column 'examination.user_uid' in 'where clause' +sql: SELECT count(*) AS `count` FROM `examination` AS `examination` WHERE `examination`.`user_uid` = '20250312837014E'; - parameters:[] +[2025-3-17>>>10:45:44]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:45:49]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:48:14]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:49:39]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:49:40]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:49:40]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:49:40]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:49:40]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:50:28]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:50:28]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:50:28]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:50:28]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:50:28]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:51:11]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:51:11]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:51:11]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:51:11]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:51:11]>>>Exam--gradesList>>>>ReferenceError: body is not defined +[2025-3-17>>>10:55:24]>>>Exam--gradesList>>>>TypeError: s.replace is not a function +[2025-3-17>>>10:56:0]>>>Exam--gradesList>>>>TypeError: s.replace is not a function +[2025-3-17>>>11:23:54]>>>Exam--gradesList>>>>TypeError: s.replace is not a function +[2025-3-17>>>11:24:45]>>>Exam--gradesList>>>>TypeError: s.replace is not a function +[2025-3-17>>>11:24:53]>>>Exam--gradesList>>>>TypeError: s.replace is not a function +[2025-3-17>>>11:24:53]>>>Exam--gradesList>>>>TypeError: s.replace is not a function +[2025-3-17>>>11:24:53]>>>Exam--gradesList>>>>TypeError: s.replace is not a function +[2025-3-17>>>11:24:54]>>>Exam--gradesList>>>>TypeError: s.replace is not a function +[2025-3-17>>>11:24:54]>>>Exam--gradesList>>>>TypeError: s.replace is not a function diff --git a/serviceLog/2025/3/21.txt b/serviceLog/2025/3/21.txt new file mode 100644 index 0000000..ca7a1d4 --- /dev/null +++ b/serviceLog/2025/3/21.txt @@ -0,0 +1,2 @@ +[2025-3-21>>>18:31:12]>>>User--checkPhoto>>>>ReferenceError: monitoring is not defined +[2025-3-21>>>18:31:24]>>>User--checkPhoto>>>>ReferenceError: monitoring is not defined diff --git a/serviceLog/2025/3/24.txt b/serviceLog/2025/3/24.txt new file mode 100644 index 0000000..4d770ec --- /dev/null +++ b/serviceLog/2025/3/24.txt @@ -0,0 +1,34 @@ +[2025-3-24>>>17:13:38]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'belongsTo') +[2025-3-24>>>17:13:38]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'belongsTo') +[2025-3-24>>>17:13:38]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'belongsTo') +[2025-3-24>>>17:13:38]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'belongsTo') +[2025-3-24>>>17:13:38]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'belongsTo') +[2025-3-24>>>17:13:38]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'belongsTo') +[2025-3-24>>>17:15:28]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'hasMany') +[2025-3-24>>>17:15:28]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'hasMany') +[2025-3-24>>>17:15:28]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'hasMany') +[2025-3-24>>>17:15:28]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'hasMany') +[2025-3-24>>>17:15:28]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'hasMany') +[2025-3-24>>>17:15:28]>>>Exam--examList>>>>TypeError: Cannot read properties of undefined (reading 'hasMany') +[2025-3-24>>>17:16:6]>>>Exam--examList>>>>SequelizeEagerLoadingError: application is not associated to examination! +[2025-3-24>>>17:16:6]>>>Exam--applicationList>>>>SequelizeDatabaseError: (conn:928, no: 1054, SQLState: 42S22) Unknown column 'examinations.exam_uid' in 'on clause' +sql: SELECT count(`application`.`id`) AS `count` FROM `application` AS `application` LEFT OUTER JOIN `examinee` AS `examinee` ON `application`.`user_uid` = `examinee`.`uid` INNER JOIN `examination` AS `examinations` ON `application`.`id` = `examinations`.`exam_... - parameters:[] +[2025-3-24>>>17:16:6]>>>Exam--examList>>>>SequelizeEagerLoadingError: application is not associated to examination! +[2025-3-24>>>17:16:6]>>>Exam--examList>>>>SequelizeEagerLoadingError: application is not associated to examination! +[2025-3-24>>>17:16:6]>>>Exam--examList>>>>SequelizeEagerLoadingError: application is not associated to examination! +[2025-3-24>>>17:16:6]>>>Exam--examList>>>>SequelizeEagerLoadingError: application is not associated to examination! +[2025-3-24>>>17:16:6]>>>Exam--applicationList>>>>SequelizeDatabaseError: (conn:930, no: 1054, SQLState: 42S22) Unknown column 'examinations.exam_uid' in 'on clause' +sql: SELECT count(`application`.`id`) AS `count` FROM `application` AS `application` LEFT OUTER JOIN `examinee` AS `examinee` ON `application`.`user_uid` = `examinee`.`uid` INNER JOIN `examination` AS `examinations` ON `application`.`id` = `examinations`.`exam_... - parameters:[] +[2025-3-24>>>17:16:6]>>>Exam--examList>>>>SequelizeEagerLoadingError: application is not associated to examination! +[2025-3-24>>>17:16:22]>>>Exam--examList>>>>SequelizeEagerLoadingError: application is not associated to examination! +[2025-3-24>>>17:16:22]>>>Exam--examList>>>>SequelizeEagerLoadingError: application is not associated to examination! +[2025-3-24>>>17:16:22]>>>Exam--examList>>>>SequelizeEagerLoadingError: application is not associated to examination! +[2025-3-24>>>17:16:22]>>>Exam--examList>>>>SequelizeEagerLoadingError: application is not associated to examination! +[2025-3-24>>>17:16:22]>>>Exam--examList>>>>SequelizeEagerLoadingError: application is not associated to examination! +[2025-3-24>>>17:16:22]>>>Exam--examList>>>>SequelizeEagerLoadingError: application is not associated to examination! +[2025-3-24>>>17:19:36]>>>Exam--examList>>>>TypeError: result.rows.map(...).split is not a function +[2025-3-24>>>17:19:36]>>>Exam--examList>>>>TypeError: result.rows.map(...).split is not a function +[2025-3-24>>>17:19:36]>>>Exam--examList>>>>TypeError: result.rows.map(...).split is not a function +[2025-3-24>>>17:19:36]>>>Exam--examList>>>>TypeError: result.rows.map(...).split is not a function +[2025-3-24>>>17:19:36]>>>Exam--examList>>>>TypeError: result.rows.map(...).split is not a function +[2025-3-24>>>17:19:36]>>>Exam--examList>>>>TypeError: result.rows.map(...).split is not a function diff --git a/serviceLog/2025/3/26.txt b/serviceLog/2025/3/26.txt new file mode 100644 index 0000000..38fbb14 --- /dev/null +++ b/serviceLog/2025/3/26.txt @@ -0,0 +1 @@ +[2025-3-26>>>14:19:18]>>>User--uploadPhoto>>>>TypeError: Cannot set properties of undefined (setting 'filename') diff --git a/serviceLog/2025/3/5.txt b/serviceLog/2025/3/5.txt new file mode 100644 index 0000000..6c32caf --- /dev/null +++ b/serviceLog/2025/3/5.txt @@ -0,0 +1,3 @@ +[2025-3-5>>>17:36:3]>>>Exam--grades>>>>SequelizeEagerLoadingError: examination is not associated to grades! +[2025-3-5>>>17:36:5]>>>Exam--historyExam>>>>SequelizeEagerLoadingError: examination is not associated to application! +[2025-3-5>>>17:45:41]>>>Exam--grades>>>>SequelizeEagerLoadingError: examinee is not associated to grades! diff --git a/serviceLog/2025/4/2.txt b/serviceLog/2025/4/2.txt new file mode 100644 index 0000000..15213be --- /dev/null +++ b/serviceLog/2025/4/2.txt @@ -0,0 +1,9 @@ +[2025-4-2>>>14:26:11]>>>Home--radio>>>>TypeError: Cannot read properties of undefined (reading 'findAndCountAll') +[2025-4-2>>>14:26:23]>>>Home--radio>>>>TypeError: Cannot read properties of undefined (reading 'findAndCountAll') +[2025-4-2>>>14:27:3]>>>Home--radio>>>>TypeError: Cannot read properties of undefined (reading 'findAndCountAll') +[2025-4-2>>>14:27:54]>>>Home--radio>>>>SequelizeDatabaseError: (conn:68, no: 1054, SQLState: 42S22) Unknown column 'options_a' in 'field list' +sql: SELECT `id`, `stem`, `options_a` AS `optionsA`, `options_b` AS `optionsB`, `options_c` AS `optionsC`, `options_d` AS `optionsD`, `answer` FROM `radio` AS `radio` LIMIT 0, 1; - parameters:[] +[2025-4-2>>>16:49:32]>>>Home--login>>>>ReferenceError: Cannot access 'result' before initialization +[2025-4-2>>>16:50:11]>>>Home--login>>>>ReferenceError: Cannot access 'result' before initialization +[2025-4-2>>>16:50:34]>>>Home--login>>>>ReferenceError: Cannot access 'result' before initialization +[2025-4-2>>>16:53:27]>>>Home--login>>>>ReferenceError: Cannot access 'result' before initialization diff --git a/serviceLog/2025/4/3.txt b/serviceLog/2025/4/3.txt new file mode 100644 index 0000000..fb33774 --- /dev/null +++ b/serviceLog/2025/4/3.txt @@ -0,0 +1,12 @@ +[2025-4-3>>>17:0:18]>>>Home--radio>>>>ReferenceError: minId is not defined +[2025-4-3>>>17:0:32]>>>Home--radio>>>>ReferenceError: minId is not defined +[2025-4-3>>>17:1:36]>>>Home--radio>>>>ReferenceError: minId is not defined +[2025-4-3>>>17:3:28]>>>Home--radio>>>>ReferenceError: minId is not defined +[2025-4-3>>>17:4:24]>>>Home--radio>>>>SequelizeDatabaseError: (conn:674, no: 1305, SQLState: 42000) FUNCTION trainingtopic.id does not exist +sql: SELECT id(`min`) AS `id` FROM `radio` AS `radio`; - parameters:[] +[2025-4-3>>>17:5:40]>>>Home--radio>>>>SequelizeDatabaseError: (conn:680, no: 1305, SQLState: 42000) FUNCTION trainingtopic.id does not exist +sql: SELECT id(`min`) AS `id` FROM `radio` AS `radio`; - parameters:[] +[2025-4-3>>>17:10:1]>>>Home--radio>>>>SequelizeDatabaseError: (conn:691, no: 1054, SQLState: 42S22) Unknown column 'age' in 'field list' +sql: SELECT min(`age`) AS `min` FROM `radio` AS `radio`; - parameters:[] +[2025-4-3>>>17:10:30]>>>Home--radio>>>>SequelizeDatabaseError: (conn:696, no: 1054, SQLState: 42S22) Unknown column 'age' in 'field list' +sql: SELECT min(`age`) AS `min` FROM `radio` AS `radio`; - parameters:[] diff --git a/test/app/controller/home.test.js b/test/app/controller/home.test.js new file mode 100644 index 0000000..ea43dbb --- /dev/null +++ b/test/app/controller/home.test.js @@ -0,0 +1,23 @@ +const { strict: assert } = require('node:assert'); +const path = require('node:path'); +const { statSync } = require('node:fs'); +const { app } = require('egg-mock/bootstrap'); + +describe('test/app/controller/home.test.js', () => { + it('should assert', async () => { + const pkg = require('../../../package.json'); + assert(app.config.keys.startsWith(pkg.name)); + }); + + it('should typings exists', async () => { + const typings = path.join(__dirname, '../../../typings'); + assert(statSync(typings)); + }); + + it('should GET /', async () => { + return app.httpRequest() + .get('/') + .expect('hi, egg') + .expect(200); + }); +});