1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-05 23:11:24 +08:00

Added lowercase letters to captcha

This commit is contained in:
2023-05-25 06:36:23 +08:00
parent 94a03b52eb
commit 09e0fbe31b
2 changed files with 2 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ function getCaptchaSrc(): string {
} }
function verifyCaptcha(value: string): boolean { function verifyCaptcha(value: string): boolean {
return captcha.value === value.replace(/\s*/g, '').toUpperCase() return captcha.value.toLowerCase() === value.replace(/\s*/g, '').toLowerCase()
} }
export { login, logout, getLoginStatus, getUser, getUsername, getCaptchaSrc, verifyCaptcha } export { login, logout, getLoginStatus, getUser, getUsername, getCaptchaSrc, verifyCaptcha }

View File

@@ -101,7 +101,7 @@ function randomColor(start: number, end: number): string {
} }
function getCaptcha(width: number, high: number, num: number): Captcha { function getCaptcha(width: number, high: number, num: number): Captcha {
const CHARTS = '23456789ABCDEFGHJKLMNPQRSTUVWXYZ'.split('') const CHARTS = '23456789ABCDEFGHJKLMNPRSTUVWXYZabcdefghijklmnpqrstuvwxyz'.split('')
const canvas = document.createElement('canvas') const canvas = document.createElement('canvas')
const ctx = canvas.getContext('2d') as CanvasRenderingContext2D const ctx = canvas.getContext('2d') as CanvasRenderingContext2D