Add:api-register
This commit is contained in:
parent
3ab76e7a43
commit
e087ab9b0e
7 changed files with 21 additions and 12 deletions
|
|
@ -1 +1 @@
|
|||
{"id":"dev","timestamp":1768378394619}
|
||||
{"id":"dev","timestamp":1768444934817}
|
||||
|
|
@ -1 +1 @@
|
|||
{"id":"dev","timestamp":1768378394619,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
||||
{"id":"dev","timestamp":1768444934817,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"date": "2026-01-14T08:13:20.972Z",
|
||||
"date": "2026-01-15T02:42:23.499Z",
|
||||
"preset": "nitro-dev",
|
||||
"framework": {
|
||||
"name": "nuxt",
|
||||
|
|
@ -9,9 +9,9 @@
|
|||
"nitro": "2.12.8"
|
||||
},
|
||||
"dev": {
|
||||
"pid": 17488,
|
||||
"pid": 19744,
|
||||
"workerAddress": {
|
||||
"socketPath": "\\\\.\\pipe\\nitro-worker-17488-1-1-6654.sock"
|
||||
"socketPath": "\\\\.\\pipe\\nitro-worker-19744-1-1-2469.sock"
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Frontend-Learner/.nuxt/nuxt.d.ts
vendored
2
Frontend-Learner/.nuxt/nuxt.d.ts
vendored
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference types="quasar" />
|
||||
/// <reference types="nuxt-quasar-ui" />
|
||||
/// <reference types="@nuxtjs/tailwindcss" />
|
||||
/// <reference types="@nuxt/devtools" />
|
||||
/// <reference types="@nuxtjs/tailwindcss" />
|
||||
/// <reference types="@nuxt/telemetry" />
|
||||
/// <reference path="types/builder-env.d.ts" />
|
||||
/// <reference types="nuxt" />
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// generated by the @nuxtjs/tailwindcss <https://github.com/nuxt-modules/tailwindcss> module at 14/1/2569 16:44:22
|
||||
// generated by the @nuxtjs/tailwindcss <https://github.com/nuxt-modules/tailwindcss> module at 15/1/2569 09:45:34
|
||||
import "@nuxtjs/tailwindcss/config-ctx"
|
||||
import configMerger from "@nuxtjs/tailwindcss/merger";
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ export const useAuth = () => {
|
|||
console.error('Register failed:', err)
|
||||
return {
|
||||
success: false,
|
||||
error: err.data?.message || err.data?.error || 'ลงทะเบียนไม่สำเร็จ'
|
||||
error: err.data?.error?.message || err.data?.message || err.message || 'ลงทะเบียนไม่สำเร็จ'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,15 @@ const loginRules = {
|
|||
* Validates form and attempts login.
|
||||
* Currently simulates an API call for demonstration.
|
||||
*/
|
||||
/**
|
||||
* Handles input updates, stripping Thai characters and clearing errors.
|
||||
*/
|
||||
const handleInput = (field: keyof typeof loginForm, value: string) => {
|
||||
// Remove Thai characters range \u0E00-\u0E7F
|
||||
loginForm[field] = value.replace(/[\u0E00-\u0E7F]/g, '')
|
||||
clearFieldError(field)
|
||||
}
|
||||
|
||||
const handleLogin = async () => {
|
||||
if (!validate(loginForm, loginRules)) return
|
||||
|
||||
|
|
@ -99,23 +108,23 @@ const handleLogin = async () => {
|
|||
<form @submit.prevent="handleLogin" novalidate>
|
||||
<!-- Email Input -->
|
||||
<FormInput
|
||||
v-model="loginForm.email"
|
||||
:model-value="loginForm.email"
|
||||
label="อีเมล"
|
||||
type="email"
|
||||
placeholder="student@example.com"
|
||||
:error="errors.email"
|
||||
required
|
||||
@update:model-value="clearFieldError('email')"
|
||||
@update:model-value="val => handleInput('email', val)"
|
||||
/>
|
||||
<!-- Password Input -->
|
||||
<FormInput
|
||||
v-model="loginForm.password"
|
||||
:model-value="loginForm.password"
|
||||
label="รหัสผ่าน"
|
||||
type="password"
|
||||
placeholder="••••••••"
|
||||
:error="errors.password"
|
||||
required
|
||||
@update:model-value="clearFieldError('password')"
|
||||
@update:model-value="val => handleInput('password', val)"
|
||||
/>
|
||||
|
||||
<!-- Helpers: Remember Me & Forgot Password -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue