1
0

verify.ts 832 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import {
  2. Length,
  3. IsString,
  4. IsEmail,
  5. ValidateIf,
  6. Allow,
  7. } from 'class-validator';
  8. import { Expose } from 'class-transformer';
  9. export class LoginInfoDto {
  10. @IsString()
  11. @Expose()
  12. username: string;
  13. @IsString()
  14. @Expose()
  15. password: string;
  16. @IsString()
  17. @Expose()
  18. captchaId: string;
  19. @Length(4)
  20. @Expose()
  21. verifyCode: string;
  22. }
  23. export class UpdatePersonInfoDto {
  24. @Length(2, 20)
  25. @Expose()
  26. name: string;
  27. @Allow()
  28. @Expose()
  29. nickName: string;
  30. @ValidateIf((_o, v) => { return !(v === '' || v === undefined || v === null); })
  31. @IsEmail()
  32. @Expose()
  33. email: string;
  34. @Allow()
  35. @Expose()
  36. phone: string;
  37. @Allow()
  38. @Expose()
  39. originPassword: string;
  40. @Allow()
  41. @Expose()
  42. newPassword: string;
  43. @Allow()
  44. @Expose()
  45. remark: string;
  46. @Allow()
  47. @Expose()
  48. headImg: string;
  49. }