Skip to content

feat: 修改前端授权码登录页面的css样式,使其支持响应式布局#5893

Merged
KouShenhai merged 1 commit intomasterfrom
dev
Mar 18, 2026
Merged

feat: 修改前端授权码登录页面的css样式,使其支持响应式布局#5893
KouShenhai merged 1 commit intomasterfrom
dev

Conversation

@KouShenhai
Copy link
Owner

@KouShenhai KouShenhai commented Mar 18, 2026

Summary by Sourcery

将登录页面布局更新为基于 flex 的响应式布局,并改进视觉样式。

改进内容:

  • 使用 flexbox 替代固定定位,使登录页面容器具有响应式布局并在垂直方向居中。
  • 调整背景图片路径,并为卡片添加半透明背景和模糊效果,以在各种屏幕尺寸上提升可读性。
Original summary in English

Summary by Sourcery

Update the login page layout to be flex-based and responsive while improving visual styling.

Enhancements:

  • Make the login page container responsive and vertically centered using flexbox instead of fixed positioning.
  • Adjust background image path and enhance the card with semi-transparent background and blur for better readability on various screen sizes.

Summary by CodeRabbit

  • Style
    • Redesigned login page with improved visual layout and modern styling elements.
    • Enhanced responsive design for better display across various screen sizes and devices.
    • Updated spacing and margins for improved visual hierarchy and user experience.

@netlify
Copy link

netlify bot commented Mar 18, 2026

Deploy Preview for kcloud-platform-iot ready!

Name Link
🔨 Latest commit fbf123a
🔍 Latest deploy log https://app.netlify.com/projects/kcloud-platform-iot/deploys/69ba30c1b782920008514d83
😎 Deploy Preview https://deploy-preview-5893--kcloud-platform-iot.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@qodo-code-review
Copy link

ⓘ You are approaching your monthly quota for Qodo. Upgrade your plan

Review Summary by Qodo

Implement responsive layout for authorization login page

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Refactored login page CSS for responsive design support
• Replaced fixed positioning with flexbox layout for better adaptability
• Added backdrop blur effect and improved container styling
• Standardized indentation and formatting throughout HTML/CSS
Diagram
flowchart LR
  A["Fixed Layout<br/>margin-left: 65%<br/>transform: translateY"] -->|"Replace with"| B["Flexbox Layout<br/>display: flex<br/>justify-content: flex-end"]
  C["Static Positioning"] -->|"Add"| D["Responsive Padding<br/>clamp function<br/>6vw dynamic sizing"]
  E["Basic Container"] -->|"Enhance"| F["Backdrop Blur<br/>rgba background<br/>Modern styling"]
Loading

Grey Divider

File Changes

1. laokou-service/laokou-auth/laokou-auth-start/src/main/resources/templates/login.html ✨ Enhancement +101/-92

Responsive flexbox layout with modern styling

• Replaced fixed positioning (margin-left: 65%, transform: translateY) with flexbox layout
 (display: flex, justify-content: flex-end)
• Added responsive padding using CSS clamp() function for adaptive spacing across screen sizes
• Enhanced container styling with backdrop blur effect (backdrop-filter: blur(6px)) and
 semi-transparent background
• Standardized code indentation from spaces to tabs for consistency
• Updated background image path from /api/img/ to /api/images/

laokou-service/laokou-auth/laokou-auth-start/src/main/resources/templates/login.html


Grey Divider

Qodo Logo

@qodo-code-review
Copy link

qodo-code-review bot commented Mar 18, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Background path mismatch 🐞 Bug ✓ Correctness
Description
login.html 将背景图改为请求 /api/images/FfdJeJRQWjEeGTpqgBKj.png,但该服务配置的静态资源放行路径是 /img/** 且服务
context-path/api,因此登录页背景图会请求到未放行/不存在的路径导致加载失败。结果是登录页背景图 404 或被安全链重定向/拦截,影响登录页展示与可用性。
Code

laokou-service/laokou-auth/laokou-auth-start/src/main/resources/templates/login.html[R12-17]

+		body {
+			overflow-x: hidden;
+			min-height: 100vh;
+			font-family: Arial, Helvetica, sans-serif;
+			background: url('/api/images/FfdJeJRQWjEeGTpqgBKj.png') no-repeat center center;
+			background-size: cover;
Evidence
1) 登录页背景图现在硬编码为 /api/images/...;2) 该服务运行在 context-path: /api 下,静态资源对外路径会带 /api 前缀;3)
安全忽略/放行配置明确包含 /img/**(但不包含 /images/**),因此新路径不匹配现有静态资源放行与目录约定,导致资源无法在未登录时正常访问。

laokou-service/laokou-auth/laokou-auth-start/src/main/resources/templates/login.html[12-18]
laokou-service/laokou-auth/laokou-auth-start/src/main/resources/application.yml[39-42]
laokou-service/laokou-auth/laokou-auth-start/src/main/resources/application.yml[155-167]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`login.html` 背景图路径被改为 `/api/images/FfdJeJRQWjEeGTpqgBKj.png`,但当前服务配置的 context-path 为 `/api` 且未登录放行静态资源为 `/img/**`,导致登录页背景图请求路径与实际静态资源/放行规则不一致,从而出现 404 或被安全链拦截。

### Issue Context
- 服务运行在 `server.servlet.context-path: /api`
- 未登录放行包含 `/img/**`,未见 `/images/**`

### Fix Focus Areas
- laokou-service/laokou-auth/laokou-auth-start/src/main/resources/templates/login.html[12-18]
- laokou-service/laokou-auth/laokou-auth-start/src/main/resources/application.yml[155-167]

### Suggested change
优先建议:将 CSS 中的背景图改为指向 `/api/img/FfdJeJRQWjEeGTpqgBKj.png`(与现有 `/img/**` 放行一致)。

可选增强:将 `&lt;style&gt;` 改为 Thymeleaf 可解析的资源 URL(例如 `th:inline=&quot;css&quot;` + `url([[@{/img/FfdJeJRQWjEeGTpqgBKj.png}]])`),以避免硬编码 `/api`。

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@sourcery-ai
Copy link

sourcery-ai bot commented Mar 18, 2026

审阅者指南

此 PR 更新了登录页面的 HTML/CSS,使其采用更健壮、响应式的基于 flexbox 的布局,为登录容器增加了半透明背景以改进样式,并在保持现有表单结构和行为不变的前提下,修正了背景图片的路径。

文件级变更

变更 详情 文件
重构登录页面布局和样式,使其在保持表单字段和行为不变的情况下,更加响应式且视觉效果更佳。
  • 将 body 布局切换为基于 flexbox 的右对齐、垂直居中容器,并使用 clamp() 设置响应式水平内边距,以便在不同屏幕尺寸上有更好的表现。
  • 调整容器宽度,使其在最大 420px 范围内占用全部可用宽度,并移除固定的 margin/transform 定位,改用 flex 对齐方式。
  • 为容器添加半透明白色背景和模糊效果,以提升其与背景图片之间的对比度。
  • 将背景图片的 URL 路径从 /api/img/... 更新为 /api/images/...,并保持 cover 显示行为不变。
  • 规范缩进和 HTML 结构,保持所有表单输入、校验属性和验证码刷新逻辑不变。
laokou-service/laokou-auth/laokou-auth-start/src/main/resources/templates/login.html

可能关联的 issue

  • #(not specified): Issue 要求修改前端,PR 通过重构登录页 CSS 和背景路径实现前端界面优化
  • 欢迎反馈 #1: 该 PR 修改授权码登录页面 CSS 与布局,正对应 issue 中提出的授权码页面问题

提示与指令

与 Sourcery 交互

  • 触发新的代码审查: 在 pull request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub issue: 回复某条审查评论,请求 Sourcery 将其转换为 issue。你也可以在审查评论下回复 @sourcery-ai issue 来创建对应的 issue。
  • 生成 pull request 标题: 在 pull request 标题中任意位置写上 @sourcery-ai 即可随时生成标题。你也可以在 pull request 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 pull request 摘要: 在 pull request 正文任意位置写上 @sourcery-ai summary,即可在该位置生成 PR 摘要。你也可以在 pull request 中评论 @sourcery-ai summary 来(重新)生成摘要。
  • 生成审阅者指南: 在 pull request 中评论 @sourcery-ai guide,即可随时(重新)生成审阅者指南。
  • 一次性解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve,将标记所有 Sourcery 评论为已解决。如果你已经处理完所有评论且不希望再看到它们,这会很有用。
  • 一次性忽略所有 Sourcery 审查: 在 pull request 中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。特别适合在你希望重新开始一次全新的审查时使用——别忘了之后再评论 @sourcery-ai review 以触发新的审查!

自定义你的使用体验

打开你的 控制台 以:

  • 启用或禁用诸如 Sourcery 生成的 pull request 摘要、审阅者指南等审查功能。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查指令。
  • 调整其他审查设置。

获取帮助

Original review guide in English

Reviewer's Guide

This PR updates the login page’s HTML/CSS to use a more robust, responsive flexbox-based layout, improves the styling of the login container with a translucent background, and corrects the background image path while preserving the existing form structure and behavior.

File-Level Changes

Change Details Files
Refactor login page layout and styling to be responsive and visually improved while keeping the form fields and behavior intact.
  • Switch body layout to a flexbox-based, right-aligned, vertically centered container with responsive horizontal padding using clamp() for better behavior on different screen sizes.
  • Adjust the container width to use full available width up to 420px and remove fixed margin/transform positioning in favor of flex alignment.
  • Add a semi-transparent white background and blur effect to the container to improve contrast against the background image.
  • Update the background image URL path from /api/img/... to /api/images/... while keeping cover behavior.
  • Normalize indentation and HTML structure, keeping all form inputs, validation attributes, and captcha refresh logic unchanged.
laokou-service/laokou-auth/laokou-auth-start/src/main/resources/templates/login.html

Possibly linked issues

  • #(not specified): Issue要求修改前端,PR通过重构登录页CSS和背景路径实现前端界面优化
  • 欢迎反馈 #1: 该PR修改授权码登录页面CSS与布局,正对应 issue 中提出的授权码页面问题

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@KouShenhai KouShenhai merged commit 80a385d into master Mar 18, 2026
12 of 16 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4d31fa78-a36f-4f7b-889b-7da143e3698c

📥 Commits

Reviewing files that changed from the base of the PR and between 123f48c and fbf123a.

📒 Files selected for processing (1)
  • laokou-service/laokou-auth/laokou-auth-start/src/main/resources/templates/login.html

Walkthrough

Reworks the login page HTML and CSS styling with flex-based centering, increased padding, a translucent white container with backdrop blur effect, updated background image path, and adjusted spacing throughout. Preserves the original form fields and submission flow.

Changes

Cohort / File(s) Summary
Login Page Styling
laokou-service/laokou-auth/laokou-auth-start/src/main/resources/templates/login.html
Comprehensive CSS and layout rework including flex-based centering, translucent container with backdrop blur, updated padding, margins, container width adjustments, and background image path changes. Form structure and functionality remain unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Dev #5892: Modifies the same login.html file with concurrent layout and CSS styling changes to the login page.

Suggested labels

Review effort 2/5

Poem

🐰 A rabbit hops through styling code,
With flexbox paths and backdrop glow,
The login page now shines so bright,
Translucent, centered, pure delight! ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出了一些高层次的反馈:

  • body 设置为 display: flexjustify-content: flex-end 可能会限制或导致未来/全局注入到此模板中的内容错位;建议将登录卡片包裹在一个专用的 flex 容器中,而不是直接在 body 上应用布局样式。
  • .row 容器上重复出现的 style="width: 100%;" 可以去掉,或者移动到 .row 的 CSS 规则中,以便将布局定义集中管理、更加易于维护。
供 AI Agent 使用的提示
Please address the comments from this code review:

## Overall Comments
- Setting `body` to `display: flex` and `justify-content: flex-end` may constrain or misalign any future/global content injected into this template; consider wrapping the login card in a dedicated flex container instead of applying layout styles directly to `body`.
- The repeated `style="width: 100%;"` on the `.row` containers can be removed or moved into the CSS rule for `.row` to keep layout definitions centralized and easier to maintain.

Sourcery 对开源项目是免费的——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请对每条评论点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English

Hey - I've left some high level feedback:

  • Setting body to display: flex and justify-content: flex-end may constrain or misalign any future/global content injected into this template; consider wrapping the login card in a dedicated flex container instead of applying layout styles directly to body.
  • The repeated style="width: 100%;" on the .row containers can be removed or moved into the CSS rule for .row to keep layout definitions centralized and easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Setting `body` to `display: flex` and `justify-content: flex-end` may constrain or misalign any future/global content injected into this template; consider wrapping the login card in a dedicated flex container instead of applying layout styles directly to `body`.
- The repeated `style="width: 100%;"` on the `.row` containers can be removed or moved into the CSS rule for `.row` to keep layout definitions centralized and easier to maintain.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +12 to +17
body {
overflow-x: hidden;
min-height: 100vh;
font-family: Arial, Helvetica, sans-serif;
background: url('/api/images/FfdJeJRQWjEeGTpqgBKj.png') no-repeat center center;
background-size: cover;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Background path mismatch 🐞 Bug ✓ Correctness

login.html 将背景图改为请求 /api/images/FfdJeJRQWjEeGTpqgBKj.png,但该服务配置的静态资源放行路径是 /img/** 且服务
context-path/api,因此登录页背景图会请求到未放行/不存在的路径导致加载失败。结果是登录页背景图 404 或被安全链重定向/拦截,影响登录页展示与可用性。
Agent Prompt
### Issue description
`login.html` 背景图路径被改为 `/api/images/FfdJeJRQWjEeGTpqgBKj.png`,但当前服务配置的 context-path 为 `/api` 且未登录放行静态资源为 `/img/**`,导致登录页背景图请求路径与实际静态资源/放行规则不一致,从而出现 404 或被安全链拦截。

### Issue Context
- 服务运行在 `server.servlet.context-path: /api`
- 未登录放行包含 `/img/**`,未见 `/images/**`

### Fix Focus Areas
- laokou-service/laokou-auth/laokou-auth-start/src/main/resources/templates/login.html[12-18]
- laokou-service/laokou-auth/laokou-auth-start/src/main/resources/application.yml[155-167]

### Suggested change
优先建议:将 CSS 中的背景图改为指向 `/api/img/FfdJeJRQWjEeGTpqgBKj.png`(与现有 `/img/**` 放行一致)。

可选增强:将 `<style>` 改为 Thymeleaf 可解析的资源 URL(例如 `th:inline="css"` + `url([[@{/img/FfdJeJRQWjEeGTpqgBKj.png}]])`),以避免硬编码 `/api`。

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.27%. Comparing base (123f48c) to head (fbf123a).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5893      +/-   ##
============================================
- Coverage     58.35%   58.27%   -0.08%     
+ Complexity     1147     1146       -1     
============================================
  Files           270      270              
  Lines          5364     5364              
  Branches        339      339              
============================================
- Hits           3130     3126       -4     
- Misses         2056     2062       +6     
+ Partials        178      176       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant