diff --git a/README.md b/README.md index 88e5f979..680f45e1 100644 --- a/README.md +++ b/README.md @@ -183,3 +183,10 @@ npm run serve ## QQ [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=P61UJI_q8AzizyBLGOm-bUvzNrUnSQq-&authKey=yZFtL9biGB5yiIME3%2Bi%2Bf6XMOdTNiuf0pCIaviEEAIryySNzVy6LJ4xl7uHdEcrM&noverify=0&group_code=920623419) + +# Feature +[官方Feature](https://github.com/didi/xiaoju-survey/issues/45) + +# CHANGELOG +[MAJOR CHANGELOG](https://github.com/didi/xiaoju-survey/issues/48) + diff --git a/server/package.json b/server/package.json index 50b166ee..d0b5c031 100644 --- a/server/package.json +++ b/server/package.json @@ -19,7 +19,6 @@ "@types/koa-bodyparser": "^4.3.10", "@types/koa-router": "^7.4.4", "@types/koa-static": "^4.0.4", - "@types/node": "^20.10.8", "@typescript-eslint/eslint-plugin": "^6.15.0", "@typescript-eslint/parser": "^6.15.0", "cross-env": "^7.0.3", @@ -33,7 +32,6 @@ "dependencies": { "cheerio": "^1.0.0-rc.12", "crypto-js": "^4.2.0", - "dotenv": "^16.3.1", "glob": "^10.3.10", "joi": "^17.9.2", "jsonwebtoken": "^9.0.1", diff --git a/server/src/apps/surveyManage/index.ts b/server/src/apps/surveyManage/index.ts index 4ec3a54b..8fcd5fc2 100644 --- a/server/src/apps/surveyManage/index.ts +++ b/server/src/apps/surveyManage/index.ts @@ -141,7 +141,7 @@ export default class SurveyManage { } private getFilter(filterList: Array) { - const allowFilterField = ['title', 'remark', 'surveyType', 'curStatus.status']; + const allowFilterField = ['title', 'remark', 'questionType', 'curStatus.status']; return filterList.reduce((preItem, curItem) => { const condition = curItem.condition.filter(item => allowFilterField.includes(item.field)).reduce((pre, cur) => { switch(cur.comparator) { diff --git a/server/src/apps/user/index.ts b/server/src/apps/user/index.ts index 3a67e597..0c133b85 100644 --- a/server/src/apps/user/index.ts +++ b/server/src/apps/user/index.ts @@ -1,15 +1,16 @@ - import { SurveyApp, SurveyServer } from '../../decorator'; +import { Request, Response } from 'koa'; import * as Joi from 'joi'; import { userService } from './service/userService'; import { captchaService } from './service/captchaService'; import { getValidateValue } from './utils/index'; + import { CommonError } from '../../types/index'; @SurveyApp('/api/user') export default class User { @SurveyServer({ type: 'http', method: 'post', routerName: '/register' }) - async register({ req }) { + async register({ req }: { req: Request, res: Response }) { const userInfo = getValidateValue(Joi.object({ username: Joi.string().required(), password: Joi.string().required(), @@ -33,7 +34,7 @@ export default class User { } @SurveyServer({ type: 'http', method: 'post', routerName: '/login' }) - async login({ req }) { + async login({ req }: { req: Request, res: Response }) { const userInfo = getValidateValue(Joi.object({ username: Joi.string().required(), password: Joi.string().required(), diff --git a/server/src/apps/user/service/captchaService.ts b/server/src/apps/user/service/captchaService.ts index e7db4e96..75599fc5 100644 --- a/server/src/apps/user/service/captchaService.ts +++ b/server/src/apps/user/service/captchaService.ts @@ -1,6 +1,5 @@ import { mongo } from '../db/mongo'; import { create } from 'svg-captcha'; - class CaptchaService { createCaptcha() { @@ -39,4 +38,3 @@ class CaptchaService { } export const captchaService = new CaptchaService(); - diff --git a/server/src/apps/user/utils/index.ts b/server/src/apps/user/utils/index.ts index 4cf47b97..8233dbca 100644 --- a/server/src/apps/user/utils/index.ts +++ b/server/src/apps/user/utils/index.ts @@ -7,7 +7,6 @@ export function getStatusObject({ status }: { status: SURVEY_STATUS }) { date: Date.now(), }; } - export function getValidateValue(validationResult: Joi.ValidationResult): T { if (validationResult.error) { throw new CommonError(validationResult.error.details.map(e => e.message).join()); diff --git a/server/src/index.ts b/server/src/index.ts index a3c505ca..0331d2cc 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -1,4 +1,3 @@ -import 'dotenv/config'; import * as os from 'os'; import * as Koa from 'koa'; import * as KoaBodyparser from 'koa-bodyparser'; diff --git a/web/src/management/pages/list/components/baseList.vue b/web/src/management/pages/list/components/baseList.vue index eec22256..0786a2cf 100644 --- a/web/src/management/pages/list/components/baseList.vue +++ b/web/src/management/pages/list/components/baseList.vue @@ -1,11 +1,20 @@