mirror of
https://github.com/Cccc-owo/CheckInApp.git
synced 2026-10-25 11:11:14 +08:00
feat: improve error handling and code quality
后端改进: - 添加统一异常处理系统 (exceptions.py, response.py) - 实现自定义异常类 (ValidationError, AuthorizationError, ResourceNotFoundError, BusinessLogicError) - 配置全局异常处理器,统一 API 错误响应格式 - 迁移业务逻辑错误到自定义异常 (users.py, auth.py) - 添加 SQL LIKE 通配符转义,防止通配符滥用 - 使用 EmailStr 进行邮箱格式验证 - 移除敏感字段暴露 (jwt_sub) 前端改进: - 配置 ESLint 9 (flat config) 和 Prettier - 修复所有 ESLint 错误和警告 - 移除未使用的变量和导入 - 为组件添加 PropTypes 默认值 - 统一代码格式和风格
This commit is contained in:
@@ -8,16 +8,16 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted } from 'vue'
|
||||
import Navbar from './Navbar.vue'
|
||||
import { useTokenMonitor } from '@/composables/useTokenMonitor'
|
||||
import { onMounted } from 'vue';
|
||||
import Navbar from './Navbar.vue';
|
||||
import { useTokenMonitor } from '@/composables/useTokenMonitor';
|
||||
|
||||
// 启动全局 Token 监控
|
||||
const { startMonitoring } = useTokenMonitor()
|
||||
const { startMonitoring } = useTokenMonitor();
|
||||
|
||||
onMounted(() => {
|
||||
startMonitoring()
|
||||
})
|
||||
startMonitoring();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -26,7 +26,11 @@ onMounted(() => {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: linear-gradient(135deg, var(--md-sys-color-surface-container-lowest) 0%, var(--md-sys-color-surface-container-low) 100%);
|
||||
background: linear-gradient(
|
||||
135deg,
|
||||
var(--md-sys-color-surface-container-lowest) 0%,
|
||||
var(--md-sys-color-surface-container-low) 100%
|
||||
);
|
||||
}
|
||||
|
||||
.main-content {
|
||||
|
||||
Reference in New Issue
Block a user