diff --git a/server/src/app.module.ts b/server/src/app.module.ts index 3faa2987..a030386f 100644 --- a/server/src/app.module.ts +++ b/server/src/app.module.ts @@ -41,6 +41,7 @@ import { PluginManagerProvider } from './securityPlugin/pluginManager.provider'; import { LogRequestMiddleware } from './middlewares/logRequest.middleware'; import { XiaojuSurveyPluginManager } from './securityPlugin/pluginManager'; import { Logger } from './logger'; +import { WhitelistVerify } from './models/whitelistVerify.entity'; @Module({ imports: [ @@ -81,6 +82,7 @@ import { Logger } from './logger'; Workspace, WorkspaceMember, Collaborator, + WhitelistVerify, ], }; }, diff --git a/server/src/modules/surveyResponse/controllers/responseSchema.controller.ts b/server/src/modules/surveyResponse/controllers/responseSchema.controller.ts index 9cd8f452..6755f09d 100644 --- a/server/src/modules/surveyResponse/controllers/responseSchema.controller.ts +++ b/server/src/modules/surveyResponse/controllers/responseSchema.controller.ts @@ -70,10 +70,7 @@ export class ResponseSchemaController { // 白名单验证 @Post('/:surveyPath/validate') @HttpCode(200) - async whitelistValidate( - @Param('surveyPath') surveyPath, - @Body() body, - ): Promise { + async whitelistValidate(@Param('surveyPath') surveyPath, @Body() body) { const { value, error } = Joi.object({ password: Joi.string().allow(null, ''), value: Joi.string().allow(null, ''), @@ -130,6 +127,12 @@ export class ResponseSchemaController { // 返回verifyId const res = await this.whitelistService.create(surveyPath); - return res._id.toString(); + + return { + code: 200, + data: { + verifyId: res._id.toString(), + }, + }; } }