@@ -6,11 +6,7 @@ import { sendRegisterEmailVerificationCodeSchema } from '~/validations/auth'
66import { checkKunCaptchaExist } from '~/app/api/utils/verifyKunCaptcha'
77import { prisma } from '~/prisma/index'
88import { getKv } from '~/lib/redis'
9- import { getRemoteIp } from '~/app/api/utils/getRemoteIp'
10- import {
11- KUN_PATCH_DISABLE_REGISTER_KEY ,
12- KUN_PATCH_PERMANENT_BAN_USER_KEY
13- } from '~/config/redis'
9+ import { KUN_PATCH_DISABLE_REGISTER_KEY } from '~/config/redis'
1410
1511export const sendRegisterCode = async (
1612input :z . infer < typeof sendRegisterEmailVerificationCodeSchema > ,
@@ -26,20 +22,6 @@ export const sendRegisterCode = async (
2622return '由于网站近日遭受大量攻击,当前时间段暂时不可注册,请明天下午再来,一定要来哦'
2723}
2824
29- const isDeletedUserEmail = await getKv (
30- `${ KUN_PATCH_PERMANENT_BAN_USER_KEY } :${ input . email } `
31- )
32- if ( isDeletedUserEmail ) {
33- return '您的邮箱已被永久封禁'
34- }
35- const authUserIp = getRemoteIp ( headers )
36- const isDeletedUserIp = await getKv (
37- `${ KUN_PATCH_PERMANENT_BAN_USER_KEY } :${ authUserIp } `
38- )
39- if ( isDeletedUserIp ) {
40- return '您的 IP 地址已被永久封禁'
41- }
42-
4325const normalizedName = input . name . toLowerCase ( )
4426const sameUsernameUser = await prisma . user . findFirst ( {
4527where :{ name :{ equals :normalizedName , mode :'insensitive' } }