mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
чиним билд06
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
"vite": "^5.1.4",
|
"vite": "^5.1.4",
|
||||||
"vue-tsc": "^2.0.6",
|
"vue-tsc": "^2.0.6",
|
||||||
"@tailwindcss/forms": "^0.5.7"
|
"@tailwindcss/forms": "^0.5.7",
|
||||||
|
"@types/axios": "^0.14.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
15
frontend/src/env.d.ts
vendored
Normal file
15
frontend/src/env.d.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
|
declare module '*.vue' {
|
||||||
|
import type { DefineComponent } from 'vue'
|
||||||
|
const component: DefineComponent<{}, {}, any>
|
||||||
|
export default component
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ImportMetaEnv {
|
||||||
|
readonly VITE_API_URL: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ImportMeta {
|
||||||
|
readonly env: ImportMetaEnv
|
||||||
|
}
|
@@ -56,7 +56,13 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import axios from 'axios'
|
import axios, { AxiosError } from 'axios'
|
||||||
|
|
||||||
|
interface LoginResponse {
|
||||||
|
access_token: string
|
||||||
|
token_type: string
|
||||||
|
[key: string]: any
|
||||||
|
}
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const lastName = ref('')
|
const lastName = ref('')
|
||||||
@@ -70,7 +76,7 @@ const handleLogin = async () => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
console.log('Отправка запроса на авторизацию...')
|
console.log('Отправка запроса на авторизацию...')
|
||||||
const response = await axios.post('/api/auth/login', {
|
const response = await axios.post<LoginResponse>('/api/auth/login', {
|
||||||
last_name: lastName.value,
|
last_name: lastName.value,
|
||||||
password: password.value
|
password: password.value
|
||||||
})
|
})
|
||||||
@@ -83,9 +89,10 @@ const handleLogin = async () => {
|
|||||||
console.log('Перенаправление на /requests...')
|
console.log('Перенаправление на /requests...')
|
||||||
// Перенаправляем на страницу заявок
|
// Перенаправляем на страницу заявок
|
||||||
await router.push('/requests')
|
await router.push('/requests')
|
||||||
} catch (e: any) {
|
} catch (e) {
|
||||||
console.error('Ошибка при авторизации:', e)
|
console.error('Ошибка при авторизации:', e)
|
||||||
error.value = e.response?.data?.detail || 'Неверная фамилия или пароль'
|
const axiosError = e as AxiosError<{ detail: string }>
|
||||||
|
error.value = axiosError.response?.data?.detail || 'Неверная фамилия или пароль'
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
@@ -16,16 +16,27 @@
|
|||||||
|
|
||||||
/* Linting */
|
/* Linting */
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": false,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": false,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
|
||||||
/* Paths */
|
/* Paths */
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["src/*"]
|
"@/*": ["src/*"]
|
||||||
}
|
},
|
||||||
|
|
||||||
|
/* Additional Options */
|
||||||
|
"allowJs": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
|
"include": [
|
||||||
|
"src/**/*.ts",
|
||||||
|
"src/**/*.d.ts",
|
||||||
|
"src/**/*.tsx",
|
||||||
|
"src/**/*.vue",
|
||||||
|
"vite.config.ts"
|
||||||
|
],
|
||||||
"references": [{ "path": "./tsconfig.node.json" }]
|
"references": [{ "path": "./tsconfig.node.json" }]
|
||||||
}
|
}
|
@@ -4,7 +4,8 @@
|
|||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"allowSyntheticDefaultImports": true
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"strict": true
|
||||||
},
|
},
|
||||||
"include": ["vite.config.ts"]
|
"include": ["vite.config.ts"]
|
||||||
}
|
}
|
Reference in New Issue
Block a user