主要改动: - 重新设计登录页面,使用原生input替代antd-mobile组件以更好控制样式 - 添加密码可见性切换功能(眼睛图标) - 实现登录/注册切换UI,注册链接移至底部 - 优化输入框样式,添加明显的边框和背景色 - 实现移动端防缩放功能(touch-action + JS事件监听) - 配置Vite代理解决CORS问题,API请求使用相对路径 - 完善CLAUDE.md和README.md文档,添加文档同步更新规范 - 更新技术栈说明,明确使用yarn作为包管理工具 技术细节: - 渐变背景(紫色主题) - 白色输入框带半透明边框,聚焦时显示光晕效果 - 防止移动端双指缩放和双击缩放 - Vite代理配置: /api/* -> http://localhost:8080 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
49 lines
935 B
TypeScript
49 lines
935 B
TypeScript
import React from 'react'
|
|
import ReactDOM from 'react-dom/client'
|
|
import App from './App'
|
|
import './index.less'
|
|
|
|
// 防止移动端双指缩放
|
|
document.addEventListener('gesturestart', function (e) {
|
|
e.preventDefault()
|
|
})
|
|
|
|
document.addEventListener('gesturechange', function (e) {
|
|
e.preventDefault()
|
|
})
|
|
|
|
document.addEventListener('gestureend', function (e) {
|
|
e.preventDefault()
|
|
})
|
|
|
|
// 防止双击缩放
|
|
let lastTouchEnd = 0
|
|
document.addEventListener(
|
|
'touchend',
|
|
function (e) {
|
|
const now = Date.now()
|
|
if (now - lastTouchEnd <= 300) {
|
|
e.preventDefault()
|
|
}
|
|
lastTouchEnd = now
|
|
},
|
|
false
|
|
)
|
|
|
|
// 防止通过touch事件进行缩放
|
|
document.addEventListener(
|
|
'touchstart',
|
|
function (e) {
|
|
if (e.touches.length > 1) {
|
|
e.preventDefault()
|
|
}
|
|
},
|
|
{ passive: false }
|
|
)
|
|
|
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
<React.StrictMode>
|
|
<App />
|
|
</React.StrictMode>,
|
|
)
|