-
Notifications
You must be signed in to change notification settings - Fork 21
[Feature] 新增异常页面 #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
[Feature] 新增异常页面 #176
Conversation
WalkthroughThree new exception pages (system-busy, load-failure, no-search-results) are added across multiple template platforms. This includes translation keys in English and Chinese, menu configurations, routing definitions, and Vue component implementations for the TinyVue template. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In @template/nestJs/locales.json:
- Line 336: Fix the typo in the locale key value for
"menu.exception.no-search-results": change "No Sarch Results" to "No Search
Results" (matching the same correction applied in the corresponding tinyvue
locales file).
In @template/springboot/src/main/resources/locales.json:
- Line 303: Fix the typo in the locales entry "menu.exception.no-search-results"
by changing its value from "No Sarch Results" to "No Search Results" in the
locales.json so the menu label displays correctly to users.
- Line 950: The JSON key "exception.result.systemBusy.d escription" is
malformed with extra spaces; rename it to
"exception.result.systemBusy.description" so the Vue component can find the
translation, ensuring the value "系统繁忙,请稍后再试" remains unchanged.
In @template/tinyvue/src/locales.json:
- Line 333: Fix the spelling typo in the localization key value for
"menu.exception.no-search-results": change "No Sarch Results" to "No Search
Results" in the locales JSON entry so the menu displays the correct word
"Search".
🧹 Nitpick comments (5)
template/springboot/src/main/resources/MenuData.json (1)
175-200: Inconsistentordervalues may cause unpredictable menu ordering.All three new menu items have
order: 1, same as existing items like403and500. This could lead to unpredictable ordering in the UI. Consider assigning sequential order values (e.g., 4, 5, 6) to ensure consistent menu display.Additionally, the
namefields use Chinese characters (系统繁忙,加载失败,暂无搜索结果) while existing exception items use English (403,404,500). Consider using English names for consistency (e.g.,SystemBusy,LoadFailure,NoSearchResults) since localization is handled via thelocalekey.Suggested fix for order values and naming consistency
"locale": "menu.exception.500" }, { - "name": "系统繁忙", - "order": 1, + "name": "SystemBusy", + "order": 4, "menuType": "normal", "icon": "", "component": "exception/system-busy/index", "path": "system-busy", "locale": "menu.exception.system-busy" }, { - "name": "加载失败", - "order": 1, + "name": "LoadFailure", + "order": 5, "menuType": "normal", "icon": "", "component": "exception/load-failure/index", "path": "load-failure", "locale": "menu.exception.load-failure" }, { - "name": "暂无搜索结果", - "order": 1, + "name": "NoSearchResults", + "order": 6, "menuType": "normal", "icon": "", "component": "exception/no-search-results/index", "path": "no-search-results", "locale": "menu.exception.no-search-results" }template/tinyvue/src/locales.json (1)
327-335: Inconsistent key naming convention for description keys.The
systemBusydescription key uses camelCase (exception.result.systemBusy.description) whileload-failureandno-search-resultsuse kebab-case (exception.result.load-failure.description). Consider aligning them for consistency.Suggested fix for consistency (use kebab-case)
- "exception.result.systemBusy.description": "The system is busy. Please try again later", + "exception.result.system-busy.description": "The system is busy. Please try again later",Note: If you apply this change, ensure the Vue components referencing this key are updated accordingly.
template/nestJs/src/menu/init/menuData.ts (1)
172-198: MissingparentIdproperty and inconsistent naming convention.The new menu items are missing the
parentId: nullproperty that exists in all other menu entries. Additionally, thenamefield uses Chinese text while existing items use English (e.g.,'Board','Exception','User').Proposed fix
{ - name: '系统繁忙', + name: 'SystemBusy', order: 1, + parentId: null, menuType: 'normal', icon: '', component: 'exception/system-busy/index', path: 'system-busy', locale: 'menu.exception.system-busy', }, { - name: '加载失败', - order: 1, + name: 'LoadFailure', + order: 2, + parentId: null, menuType: 'normal', icon: '', component: 'exception/load-failure/index', path: 'load-failure', locale: 'menu.exception.load-failure', }, { - name: '暂无搜索结果', - order: 1, + name: 'NoSearchResults', + order: 3, + parentId: null, menuType: 'normal', icon: '', component: 'exception/no-search-results/index', path: 'no-search-results', locale: 'menu.exception.no-search-results', },template/tinyvue/src/router/routes/modules/exception.ts (1)
52-87: Inconsistent naming convention and formatting issues.
The
nameandlabelfields use Chinese text while existing routes use identifiers like'403','404','500'. Consider using English identifiers for consistency.Lines 64 and 76 have inconsistent indentation (extra leading space).
Proposed fix
{ path: 'system-busy', - name: '系统繁忙', + name: 'system-busy', id: 'system-busy', - label: '系统繁忙', + label: 'system-busy', component: () => import('@/views/exception/system-busy/index.vue'), meta: { locale: 'menu.exception.system-busy', requiresAuth: true, roles: [RoleType.admin, RoleType.user], }, }, - { + { path: 'load-failure', - name: '加载失败', + name: 'load-failure', id: 'load-failure', - label: '加载失败', + label: 'load-failure', component: () => import('@/views/exception/load-failure/index.vue'), meta: { locale: 'menu.exception.load-failure', requiresAuth: true, roles: [RoleType.admin, RoleType.user], }, }, - { + { path: 'no-search-results', - name: '暂无搜索结果', + name: 'no-search-results', id: 'no-search-results', - label: '暂无搜索结果', + label: 'no-search-results', component: () => import('@/views/exception/no-search-results/index.vue'), meta: { locale: 'menu.exception.no-search-results', requiresAuth: true, roles: [RoleType.admin, RoleType.user], }, },template/nestJs/locales.json (1)
330-338: Same key naming inconsistency as tinyvue locales.The description key for system-busy uses camelCase (
systemBusy) while others use kebab-case. Consider aligning withexception.result.system-busy.descriptionfor consistency across both locale files.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
template/tinyvue/src/assets/images/load-failure.svgis excluded by!**/*.svgtemplate/tinyvue/src/assets/images/no-search-results.svgis excluded by!**/*.svgtemplate/tinyvue/src/assets/images/system-busy.svgis excluded by!**/*.svg
📒 Files selected for processing (9)
template/nestJs/locales.jsontemplate/nestJs/src/menu/init/menuData.tstemplate/springboot/src/main/resources/MenuData.jsontemplate/springboot/src/main/resources/locales.jsontemplate/tinyvue/src/locales.jsontemplate/tinyvue/src/router/routes/modules/exception.tstemplate/tinyvue/src/views/exception/load-failure/index.vuetemplate/tinyvue/src/views/exception/no-search-results/index.vuetemplate/tinyvue/src/views/exception/system-busy/index.vue
🧰 Additional context used
🧬 Code graph analysis (1)
template/tinyvue/src/router/routes/modules/exception.ts (1)
template/tinyvue/src/store/modules/user/types.ts (1)
RoleType(1-1)
🔇 Additional comments (4)
template/springboot/src/main/resources/locales.json (1)
297-305: Approve new English locale entries (with fixes above applied).The new English translations for the exception pages are well-structured and follow the existing pattern for exception-related keys.
template/tinyvue/src/views/exception/no-search-results/index.vue (1)
1-19: Component structure is consistent with other exception pages.The SVG asset exists at the correct path, all i18n keys are properly defined in
locales.json, and the component follows the established pattern for exception pages.template/tinyvue/src/views/exception/load-failure/index.vue (1)
1-19: Component structure and assets are valid.All referenced assets and i18n keys are properly defined. The SVG asset exists, all translation keys (
exception.result.load-failure.description,exception.result.permissions.load-failure,menu.exception,menu.exception.load-failure) are present in the locale files, and the Breadcrumb component is properly registered.template/tinyvue/src/views/exception/system-busy/index.vue (1)
1-19: The Vue 3 component follows the established pattern for exception pages with proper i18n integration and shared styling.All referenced assets and translation keys exist in the repository. The SVG asset is correctly located at
template/tinyvue/src/assets/images/system-busy.svg, the@alias is properly configured in vite config, and all three translation keys (menu.exception.system-busy,exception.result.systemBusy.description, andexception.result.permissions.system-busy) are defined in both English and Chinese locales.
| "menu.exception.load-failure": "Loading failed", | ||
| "exception.result.load-failure.description": "The system is busy. Please try again later", | ||
| "exception.result.permissions.load-failure": "The system is busy. Try again later", | ||
| "menu.exception.no-search-results": "No Sarch Results", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "Sarch" should be "Search"
Same typo as in template/tinyvue/src/locales.json.
Proposed fix
- "menu.exception.no-search-results": "No Sarch Results",
+ "menu.exception.no-search-results": "No Search Results",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "menu.exception.no-search-results": "No Sarch Results", | |
| "menu.exception.no-search-results": "No Search Results", |
🤖 Prompt for AI Agents
In @template/nestJs/locales.json at line 336, Fix the typo in the locale key
value for "menu.exception.no-search-results": change "No Sarch Results" to "No
Search Results" (matching the same correction applied in the corresponding
tinyvue locales file).
| "menu.exception.load-failure": "Loading failed", | ||
| "exception.result.load-failure.description": "The system is busy. Please try again later", | ||
| "exception.result.permissions.load-failure": "The system is busy. Try again later", | ||
| "menu.exception.no-search-results": "No Sarch Results", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "Sarch" should be "Search".
The menu label has a typo that will be visible to users.
Fix the typo
- "menu.exception.no-search-results": "No Sarch Results",
+ "menu.exception.no-search-results": "No Search Results",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "menu.exception.no-search-results": "No Sarch Results", | |
| "menu.exception.no-search-results": "No Search Results", |
🤖 Prompt for AI Agents
In @template/springboot/src/main/resources/locales.json at line 303, Fix the
typo in the locales entry "menu.exception.no-search-results" by changing its
value from "No Sarch Results" to "No Search Results" in the locales.json so the
menu label displays correctly to users.
| "menu.exception.500": "500", | ||
| "exception.result.500.description": "抱歉,服务器出了点问题~", | ||
| "menu.exception.system-busy": "系统繁忙", | ||
| "exception.result.systemBusy.d escription": "系统繁忙,请稍后再试", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Malformed key will cause missing translation.
The key exception.result.systemBusy.d escription has an extra space, making it d escription instead of description. The Vue component references exception.result.systemBusy.description, so this translation will not be found and the UI will display the raw key.
Fix the malformed key
- "exception.result.systemBusy.d escription": "系统繁忙,请稍后再试",
+ "exception.result.systemBusy.description": "系统繁忙,请稍后再试",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "exception.result.systemBusy.d escription": "系统繁忙,请稍后再试", | |
| "exception.result.systemBusy.description": "系统繁忙,请稍后再试", |
🤖 Prompt for AI Agents
In @template/springboot/src/main/resources/locales.json at line 950, The JSON
key "exception.result.systemBusy.d escription" is malformed with extra spaces;
rename it to "exception.result.systemBusy.description" so the Vue component can
find the translation, ensuring the value "系统繁忙,请稍后再试" remains unchanged.
| "menu.exception.load-failure": "Loading failed", | ||
| "exception.result.load-failure.description": "The system is busy. Please try again later", | ||
| "exception.result.permissions.load-failure": "The system is busy. Try again later", | ||
| "menu.exception.no-search-results": "No Sarch Results", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "Sarch" should be "Search"
The menu title has a spelling error.
Proposed fix
- "menu.exception.no-search-results": "No Sarch Results",
+ "menu.exception.no-search-results": "No Search Results",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "menu.exception.no-search-results": "No Sarch Results", | |
| "menu.exception.no-search-results": "No Search Results", |
🤖 Prompt for AI Agents
In @template/tinyvue/src/locales.json at line 333, Fix the spelling typo in the
localization key value for "menu.exception.no-search-results": change "No Sarch
Results" to "No Search Results" in the locales JSON entry so the menu displays
the correct word "Search".

PR tiny-pro新增
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.