feat: enhance login handling and message creation
- Updated main.ts to export createMessage and queryLogin. - Modified checkPluginLogin in login-handle.ts to return structured results. - Refactored query.ts to adjust imports and export queryLogin. - Cleaned up kv-login.ts by removing unused imports and improving method handling. - Adjusted Vite configuration for deployment path changes. - Simplified web.html by removing unnecessary import maps and scripts. - Created web.ts to handle login success events and user redirection logic.
This commit is contained in:
61
index.html
61
index.html
@@ -5,12 +5,27 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>KvMessage Demo</title>
|
||||
<script type="module" src="./src/main.ts"></script>
|
||||
<script type="module" src="./pages/web.ts"></script>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
padding: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
min-height: 100vh;
|
||||
background-image: url('https://zxj.tos-cn-shanghai.volces.com/img/20260119213348097_1768829628101.png');
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-attachment: fixed;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.demo-container {
|
||||
@@ -19,6 +34,8 @@
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
padding: 40px 20px;
|
||||
width: 100%;
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.button-group {
|
||||
@@ -30,42 +47,69 @@
|
||||
|
||||
.demo-button {
|
||||
padding: 10px 20px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
border: 2px solid rgba(255, 255, 255, 0.3);
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
transition: all 0.2s;
|
||||
transition: all 0.3s ease;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.demo-button.success {
|
||||
background: #52c41a;
|
||||
color: white;
|
||||
border-color: #52c41a;
|
||||
}
|
||||
|
||||
.demo-button.success:hover {
|
||||
background: #389e0d;
|
||||
border-color: #389e0d;
|
||||
box-shadow: 0 4px 12px rgba(82, 196, 26, 0.3);
|
||||
}
|
||||
|
||||
.demo-button.error {
|
||||
background: #ff4d4f;
|
||||
color: white;
|
||||
border-color: #ff4d4f;
|
||||
}
|
||||
|
||||
.demo-button.error:hover {
|
||||
background: #cf1322;
|
||||
border-color: #cf1322;
|
||||
box-shadow: 0 4px 12px rgba(255, 77, 79, 0.3);
|
||||
}
|
||||
|
||||
.demo-button.loading {
|
||||
background: #1890ff;
|
||||
color: white;
|
||||
border-color: #1890ff;
|
||||
}
|
||||
|
||||
.demo-button.loading:hover {
|
||||
background: #096dd9;
|
||||
border-color: #096dd9;
|
||||
box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
|
||||
}
|
||||
|
||||
.login-section {
|
||||
text-align: center;
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
padding: 40px 30px;
|
||||
border-radius: 16px;
|
||||
border: 2px solid rgba(255, 255, 255, 0.8);
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
|
||||
0 0 0 1px rgba(255, 255, 255, 0.5) inset;
|
||||
backdrop-filter: blur(10px);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.login-section h2 {
|
||||
margin-bottom: 30px;
|
||||
color: #1a1a1a;
|
||||
font-size: 28px;
|
||||
font-weight: 600;
|
||||
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
@@ -73,10 +117,9 @@
|
||||
<body>
|
||||
<div class="demo-container">
|
||||
<div class="login-section">
|
||||
<h2>登录组件</h2>
|
||||
<kv-login>
|
||||
<div id="weixinLogin"></div>
|
||||
</kv-login>
|
||||
<h2>登录</h2>
|
||||
<!-- <kv-login method="wechat,password"></kv-login> -->
|
||||
<kv-login></kv-login>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user