release: v1.2.1 — login captcha, docs site, and bug fixes
Add slider captcha for web login, VitePress documentation on GitHub Pages, and fixes for gallery delete refresh, pagination jump, and copy-format persistence.
This commit is contained in:
1 parent
469d3be735
commit
ff20f97522
66 files changed
+2497
-616
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import { createApiError } from '../../../utils/api-error'
|
||||
import { confirmLoginCaptcha } from '../../../utils/login-captcha'
|
||||
|
||||
interface ConfirmBody {
|
||||
id?: string
|
||||
captchaPosition?: number
|
||||
}
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const body = await readBody<ConfirmBody>(event)
|
||||
const id = body?.id?.trim() ?? ''
|
||||
const position = Number(body?.captchaPosition)
|
||||
|
||||
if (!id || !confirmLoginCaptcha(id, position)) {
|
||||
createApiError(event, 'INVALID_REQUEST', '滑块未对齐,请重试', 400)
|
||||
}
|
||||
|
||||
return { success: true }
|
||||
})
|
||||
Reference in new issue
Block a user