refactor: standardize code formatting and linting configuration

- Replace .eslintrc.js with .eslintrc.cjs for better ES module compatibility
- Add .prettierrc configuration for consistent code formatting
- Update package.json with new lint and format scripts
- Add nodemon.json for development hot reloading configuration
- Standardize code formatting across all JavaScript and Vue files
- Update web admin SPA with improved linting rules and formatting
- Add prettier configuration to web admin SPA

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
千羽
2025-08-07 18:19:31 +09:00
parent 4a0eba117c
commit 8a74bf5afe
124 changed files with 20878 additions and 18757 deletions

View File

@@ -19,12 +19,12 @@ const routes = [
// 智能重定向:避免循环
const currentPath = window.location.pathname
const basePath = APP_CONFIG.basePath.replace(/\/$/, '') // 移除末尾斜杠
// 如果当前路径已经是 basePath 或 basePath/,重定向到 api-stats
if (currentPath === basePath || currentPath === basePath + '/') {
return '/api-stats'
}
// 否则保持默认重定向
return '/api-stats'
}
@@ -116,7 +116,7 @@ const router = createRouter({
// 路由守卫
router.beforeEach((to, from, next) => {
const authStore = useAuthStore()
console.log('路由导航:', {
to: to.path,
from: from.path,
@@ -124,12 +124,12 @@ router.beforeEach((to, from, next) => {
requiresAuth: to.meta.requiresAuth,
isAuthenticated: authStore.isAuthenticated
})
// 防止重定向循环:如果已经在目标路径,直接放行
if (to.path === from.path && to.fullPath === from.fullPath) {
return next()
}
// API Stats 页面不需要认证,直接放行
if (to.path === '/api-stats' || to.path.startsWith('/api-stats')) {
next()
@@ -142,4 +142,4 @@ router.beforeEach((to, from, next) => {
}
})
export default router
export default router