wjx 5 months ago
parent
commit
46abe03ae0
3 changed files with 9 additions and 7 deletions
  1. 1 1
      index.html
  2. 7 6
      src/App.tsx
  3. 1 0
      vite.config.ts

+ 1 - 1
index.html

@@ -3,7 +3,7 @@
   <head>
     <meta charset="UTF-8" />
     <link rel="icon" type="image/svg+xml" href="/vite.svg" />
-    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> 
     <title>发码器</title>
   </head>
   <body>

+ 7 - 6
src/App.tsx

@@ -86,7 +86,7 @@ function App() {
 				setSucc(true)
 				setCode(res?.data?.msg)
 			} else {
-				message.error(res?.data?.msg || '领取失败')
+				res?.data?.msg && message.error(res?.data?.msg || '暂无可领取的礼包')
 			}
 		})
 	};
@@ -127,6 +127,7 @@ function App() {
 							filterOption={(input, option) =>
 								(option?.label as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
 							}
+							size="large"
 							onChange={() => {
 								setIsCheckRoleSucc(false)
 							}}
@@ -136,11 +137,11 @@ function App() {
 					<Form.Item style={{ marginBottom: 40 }}>
 						<div style={{ display: 'flex', gap: 10 }}>
 							<Form.Item name="roleName" rules={[{ required: true, message: '请输入角色名!' }]} noStyle>
-								<Input placeholder="请输入角色名" className='inputReset' onChange={() => {
+								<Input placeholder="请输入角色名" className='inputReset' size="large" onChange={() => {
 									setIsCheckRoleSucc(false)
 								}} />
 							</Form.Item>
-							<Button style={{ backgroundColor: '#DFD4C5' }} onClick={handleCheckRole} loading={checkRole.loading} disabled={!(serverId && roleName)}><strong>角色名检测</strong></Button>
+							<Button style={{ backgroundColor: '#DFD4C5' }} onClick={handleCheckRole} size="large" loading={checkRole.loading} disabled={!(serverId && roleName)}><strong>角色名检测</strong></Button>
 						</div>
 					</Form.Item>
 
@@ -165,15 +166,15 @@ function App() {
 							}
 						]}
 					>
-						<Input placeholder="请输入手机号" className='inputReset' disabled={!isCheckRoleSucc || !!phone} />
+						<Input placeholder="请输入手机号" className='inputReset' size="large" disabled={!isCheckRoleSucc || !!phone} />
 					</Form.Item>
 
 					<Form.Item style={{ marginBottom: 50 }}>
 						<div style={{ display: 'flex', gap: 10 }}>
 							<Form.Item name="randomCode" rules={[{ required: true, message: '请输入验证码!' }]} noStyle>
-								<Input placeholder="请输入验证码" className='inputReset' disabled={!isCheckRoleSucc} />
+								<Input placeholder="请输入验证码" className='inputReset' size="large" disabled={!isCheckRoleSucc} />
 							</Form.Item>
-							<Button style={{ backgroundColor: '#DFD4C5' }} disabled={!userPhone || msg !== '发送验证码'} onClick={handleSendCode}><strong>{msg === '发送验证码' ? msg : msg + 's'}</strong></Button>
+							<Button style={{ backgroundColor: '#DFD4C5' }} size="large" disabled={!userPhone || msg !== '发送验证码'} onClick={handleSendCode}><strong>{msg === '发送验证码' ? msg : msg + 's'}</strong></Button>
 						</div>
 					</Form.Item>
 

+ 1 - 0
vite.config.ts

@@ -4,6 +4,7 @@ import reactRefresh from '@vitejs/plugin-react-refresh';
 
 // https://vitejs.dev/config/
 export default defineConfig({
+  base: './',
   build: {
     target: 'es2015',  // 设置目标浏览器为 ES2015
     minify: 'terser',  // 使用 Terser 插件进行代码压缩