wx-auth-sdk 1.2.39 → 1.2.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -49
- package/dist/index.d.ts +14 -2
- package/dist/wx-auth.css +1 -1
- package/dist/wx-auth.js +217 -235
- package/dist/wx-auth.umd.js +9 -32
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
# 微信登录 SDK
|
|
2
2
|
|
|
3
|
-
轻量级前端认证 SDK —
|
|
3
|
+
轻量级前端认证 SDK — 弹窗内置小程序扫码登录:
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
|
|
5
|
+
- **小程序扫码**:网页展示小程序码 → 微信扫码 → 小程序内点「确认登录」→ 网页自动登录,全程无需输入验证码
|
|
6
|
+
|
|
7
|
+
> **⚠️ 公众号验证码登录已临时停用(2026-09-16)**
|
|
8
|
+
> 弹窗不再展示「公众号登录」Tab 与 6 位验证码输入面板,也不再向后端拉取公众号名称 / 关注二维码(`/api/sdk/config`)。
|
|
9
|
+
> SDK 保留 `WxAuth.verifyCode()` 与 `switchMode()` 等方法及原面板实现(源码中以「公众号验证码登录临时停用」注释块标注),
|
|
10
|
+
> 恢复时按注释还原即可。后端 `GET /api/auth/check?authToken=` 验证码通道未改动。
|
|
11
|
+
> 停用期间的降级行为:出码失败不再切到验证码 Tab,而是在扫码面板内给出「刷新二维码」重试入口。
|
|
7
12
|
|
|
8
13
|
基于 Vite 构建,**零依赖,gzip 后 < 10 KB**。
|
|
9
14
|
|
|
@@ -33,26 +38,24 @@ WxAuth.init({
|
|
|
33
38
|
SDK 会自动:
|
|
34
39
|
|
|
35
40
|
- 从 `document.referrer` 或当前域名自动获取站点标识(`siteId`,无需配置)
|
|
36
|
-
- 从后端拉取公众号名称和二维码
|
|
37
41
|
- 使用内置 API 地址
|
|
38
42
|
|
|
39
43
|
---
|
|
40
44
|
|
|
41
|
-
##
|
|
45
|
+
## 登录方式:小程序扫码(唯一)
|
|
42
46
|
|
|
43
|
-
|
|
47
|
+
> **⚠️ 2026-09-16 起公众号验证码登录临时停用**:弹窗不再有「小程序登录 / 公众号登录」Tab 切换,
|
|
48
|
+
> 打开即渲染小程序扫码面板并立即出码。
|
|
44
49
|
|
|
45
50
|
```
|
|
46
51
|
┌──────────────────────────────────┐
|
|
47
52
|
│ 微信登录 [×] │
|
|
48
|
-
│
|
|
49
|
-
│ │
|
|
50
|
-
│ └──────────┴──────────┘ │
|
|
51
|
-
│ (内容区随 Tab 切换) │
|
|
53
|
+
│ │
|
|
54
|
+
│ (小程序码,打开弹窗即出码) │
|
|
52
55
|
└──────────────────────────────────┘
|
|
53
56
|
```
|
|
54
57
|
|
|
55
|
-
### Tab
|
|
58
|
+
### 小程序扫码(原「Tab 一」)
|
|
56
59
|
|
|
57
60
|
网页出码 → 用户微信扫码打开小程序确认页 → 点「确认登录」→ 网页每 2 秒轮询,确认后自动完成登录。
|
|
58
61
|
|
|
@@ -73,13 +76,16 @@ SDK 会自动:
|
|
|
73
76
|
|
|
74
77
|
- **无需输入验证码**,也不用关注公众号(小程序用户与公众号用户是两条独立身份记录,见下方 `user.type`)
|
|
75
78
|
- 二维码 **5 分钟有效**,过期后画面盖「二维码已过期」遮罩,点「刷新二维码」重新出码
|
|
76
|
-
-
|
|
77
|
-
- 出码失败(后端未配置小程序 /
|
|
79
|
+
- **主要面向桌面端浏览器**——手机屏幕上的二维码无法用同一部微信长按识别;手机端可截图后用微信「扫一扫 → 相册」识别,或在微信内打开页面时长按识别
|
|
80
|
+
- 出码失败(后端未配置小程序 / 微信接口异常)**不再回落公众号验证码 Tab**(该面板已临时停用),而是停留在扫码面板:收起 loading、盖「二维码生成失败,请点下方按钮重试」遮罩 + 提示,并提供「刷新二维码」重试入口
|
|
78
81
|
|
|
79
|
-
###
|
|
82
|
+
### (已临时停用)公众号验证码
|
|
80
83
|
|
|
81
84
|
传统方式:微信扫码关注公众号 → 向公众号发送"验证码" → 输入收到的 6 位数字 → 认证成功。
|
|
82
85
|
|
|
86
|
+
> ⚠️ 2026-09-16 起该面板不再渲染。源码中对应实现(`tabsHtml` / `codePanelHtml`、验证码输入框与登录按钮重置、
|
|
87
|
+
> `/api/sdk/config` 配置拉取、出码失败回落)均以「公众号验证码登录临时停用」注释块保留,恢复时按注释还原。
|
|
88
|
+
|
|
83
89
|
---
|
|
84
90
|
|
|
85
91
|
## 登录态与 Cookie 域
|
|
@@ -97,7 +103,7 @@ SDK 会自动:
|
|
|
97
103
|
- **同一注册域内一个认证,全域自动登录**:`sub1.mysite.com` 认证后,`sub2.mysite.com`、根域 `mysite.com` 都能静默通过(凭根域 Cookie)。
|
|
98
104
|
- **跨注册域不共享**:`mysite.com` 与 `other.com` 是相互独立的登录态,需各自认证一次(浏览器安全机制,无法绕过)。
|
|
99
105
|
- **主站已登录 → 子站有登录态**:`panhub.shenzjd.com` 认证后,访问 `parse.shenzjd.com` 等其他子站同样静默通过。
|
|
100
|
-
- **登录态统一会话级(2026-09-05)**:Cookie 不设 `expires`,浏览器进程关闭即失效、重新打开需重新扫码(2026-09-04 曾临时改为 3
|
|
106
|
+
- **登录态统一会话级(2026-09-05)**:Cookie 不设 `expires`,浏览器进程关闭即失效、重新打开需重新扫码(2026-09-04 曾临时改为 3 天持久,随激励解锁下线回退);同一浏览器会话内刷新/开新标签不丢(策略沿革见主仓库 AGENTS.md「登录态有效期」)。
|
|
101
107
|
- **⚠️ 多级公共后缀**:若页面域名属于 `.com.cn` / `.co.uk` 等多级后缀(如 `site.mysite.com.cn`),"取最后两段"会推导出 `.com.cn`,浏览器会拒绝写入。此类接入需确认域名后再接入。
|
|
102
108
|
|
|
103
109
|
> **为什么 cookie 不跟 apiBase 走?** 早期版本 SDK 曾按 apiBase 域名写 Cookie,导致部署在第三方域名(`apiBase` 指向微信认证后端、页面域名不同)时 Cookie 落错域、后端起总不到凭证、前端反复弹窗(死循环)。SDK 已改为始终按「页面所在域」写 Cookie,与后端地址无关。
|
|
@@ -106,12 +112,12 @@ SDK 会自动:
|
|
|
106
112
|
|
|
107
113
|
### `WxAuth.init(options)`
|
|
108
114
|
|
|
109
|
-
初始化 SDK。自动检测 Cookie
|
|
115
|
+
初始化 SDK。自动检测 Cookie,已登录静默通过,未登录弹出认证窗(小程序扫码)。
|
|
110
116
|
|
|
111
117
|
```ts
|
|
112
118
|
WxAuth.init({
|
|
113
119
|
apiBase?: string, // 后端地址(可选,默认官方服务)
|
|
114
|
-
required?: boolean, //
|
|
120
|
+
required?: boolean, // 弹窗是否强制(默认 false:带 × 可关闭;true = 不可关闭)
|
|
115
121
|
silent?: boolean, // 静默初始化(默认 false),true 时不弹窗
|
|
116
122
|
onVerified?: (user) => void,
|
|
117
123
|
onError?: (err) => void,
|
|
@@ -120,12 +126,22 @@ WxAuth.init({
|
|
|
120
126
|
```
|
|
121
127
|
|
|
122
128
|
> `siteId` 无需配置:SDK 自动从 `document.referrer` 或当前域名获取并上报。
|
|
123
|
-
> `wechatName` / `qrcodeUrl`
|
|
129
|
+
> `wechatName` / `qrcodeUrl` 随公众号验证码登录一并临时停用(SDK 不再拉取 `/api/sdk/config`);恢复后仍由后端统一下发,接入方配置无效。
|
|
124
130
|
|
|
125
|
-
### `WxAuth.requireAuth()`
|
|
131
|
+
### `WxAuth.requireAuth(options?)`
|
|
126
132
|
|
|
127
133
|
手动触发认证(用于"登录"按钮、切换账号)。返回 `Promise<boolean>`。
|
|
128
134
|
|
|
135
|
+
```ts
|
|
136
|
+
await WxAuth.requireAuth(); // 用 init 的 required
|
|
137
|
+
await WxAuth.requireAuth({ required: false }); // 本次弹窗可关闭(用户主动点登录)
|
|
138
|
+
await WxAuth.requireAuth({ required: true }); // 本次弹窗强制不可关闭(后端 401 拦截)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
`options.required` 只作用于**本次弹出的弹窗**,不改 init 的全局配置——同一次页面会话里
|
|
142
|
+
可以先弹「用户主动登录(可关)」,再弹「后端校验强制登录(不可关)」,互不污染。
|
|
143
|
+
`showAuthModal(options?)` 同样接受该入参(两者都是「打开登录弹窗」的入口)。
|
|
144
|
+
|
|
129
145
|
### `WxAuth.close()`
|
|
130
146
|
|
|
131
147
|
关闭弹窗。`required=false` 时触发 `onClose` 回调。
|
|
@@ -153,31 +169,27 @@ WxAuth.init({
|
|
|
153
169
|
│
|
|
154
170
|
├── 有效 ──────────── onVerified() ✅ 静默通过
|
|
155
171
|
│
|
|
156
|
-
└── 无效 ──→
|
|
172
|
+
└── 无效 ──→ 显示弹窗(小程序扫码,立即出码)
|
|
157
173
|
│
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
└───────┬─────────────────┘
|
|
169
|
-
▼
|
|
170
|
-
保存 Cookie
|
|
171
|
-
onVerified()
|
|
174
|
+
▼
|
|
175
|
+
微信扫码打开小程序
|
|
176
|
+
│
|
|
177
|
+
小程序内「确认登录」
|
|
178
|
+
│
|
|
179
|
+
网页轮询自动领取 Token
|
|
180
|
+
│
|
|
181
|
+
▼
|
|
182
|
+
保存 Cookie
|
|
183
|
+
onVerified()
|
|
172
184
|
```
|
|
173
185
|
|
|
174
|
-
>
|
|
186
|
+
> 出码失败时停留在扫码面板,提供「刷新二维码」重试入口(原「自动切换到公众号验证码 Tab」降级路径已随该面板临时停用)。
|
|
175
187
|
|
|
176
188
|
---
|
|
177
189
|
|
|
178
190
|
## `onVerified(user)` 回调数据
|
|
179
191
|
|
|
180
|
-
|
|
192
|
+
登录成功后回调结构(对齐 `/api/auth/check`):
|
|
181
193
|
|
|
182
194
|
```ts
|
|
183
195
|
interface AuthUser {
|
|
@@ -197,7 +209,18 @@ interface AuthUser {
|
|
|
197
209
|
|
|
198
210
|
## 两种模式
|
|
199
211
|
|
|
200
|
-
|
|
212
|
+
**默认是「可选认证」**:用户主动点登录(头像、登录按钮)属于可反悔操作,允许关掉;
|
|
213
|
+
「必须登录才能继续」属于业务判断,由调用方显式声明 `required: true`。
|
|
214
|
+
|
|
215
|
+
| 场景 | 写法 | 形态 |
|
|
216
|
+
| --- | --- | --- |
|
|
217
|
+
| 用户主动点登录(头像 / 登录按钮) | `requireAuth({ required: false })`(或不传,走 init 默认) | 带 × 可关闭 |
|
|
218
|
+
| 后端 401 / 功能前置校验 | `requireAuth({ required: true })` 或 `showAuthModal({ required: true })` | 无 ×,遮罩不可点穿 |
|
|
219
|
+
|
|
220
|
+
> 前端传入的 `required` 只是 UI 语义,**不构成安全边界**——真正的门禁始终在后端
|
|
221
|
+
> (`requireWxAuth` 校验 Token),前端把强制窗改成可关也走不到业务。
|
|
222
|
+
|
|
223
|
+
### 强制认证 `required: true`(需显式声明)
|
|
201
224
|
|
|
202
225
|
必须完成认证才能继续,关闭按钮隐藏,点击遮罩无效。
|
|
203
226
|
|
|
@@ -205,16 +228,15 @@ interface AuthUser {
|
|
|
205
228
|
弹窗
|
|
206
229
|
┌──────────────────────────────────┐
|
|
207
230
|
│ 微信登录 │
|
|
208
|
-
│ [ 小程序登录 ] [ 公众号登录 ] │
|
|
209
231
|
│ │
|
|
210
232
|
│ ┌──────────┐ │
|
|
211
|
-
│ │ 小程序码 │ ←
|
|
233
|
+
│ │ 小程序码 │ ← 打开即出码 │
|
|
212
234
|
│ └──────────┘ │
|
|
213
235
|
│ 微信扫描二维码,打开小程序确认登录 │
|
|
214
236
|
└──────────────────────────────────┘
|
|
215
237
|
```
|
|
216
238
|
|
|
217
|
-
### 可选认证 `required: false
|
|
239
|
+
### 可选认证 `required: false`(默认)
|
|
218
240
|
|
|
219
241
|
用户可主动关闭弹窗,关闭时执行 `onClose` 回调。
|
|
220
242
|
|
|
@@ -236,23 +258,20 @@ interface AuthUser {
|
|
|
236
258
|
|
|
237
259
|
| 功能 | 支持 |
|
|
238
260
|
|------|------|
|
|
239
|
-
|
|
|
240
|
-
| 默认小程序扫码、打开弹窗立即出码 | ✅ |
|
|
261
|
+
| 小程序扫码登录(打开弹窗立即出码) | ✅ |
|
|
241
262
|
| 小程序扫码无需输验证码(扫码 → 小程序内确认 → 网页自动登录) | ✅ |
|
|
242
|
-
| 出码失败自动回落公众号验证码 Tab | ✅ |
|
|
243
263
|
| 小程序码 5 分钟过期 + 一键刷新 | ✅ |
|
|
244
|
-
|
|
|
245
|
-
| 输入一位自动跳到下一格 | ✅ |
|
|
246
|
-
| 粘贴 6 位数字自动识别 | ✅ |
|
|
247
|
-
| 键盘左右/退格导航 | ✅ |
|
|
248
|
-
| 输入完成自动提交 | ✅ |
|
|
264
|
+
| 出码失败可在面板内「刷新二维码」重试 | ✅ |
|
|
249
265
|
| 有 Cookie 静默认证 | ✅ |
|
|
250
266
|
| Cookie 按页面根域写入(跨子域共享) | ✅ |
|
|
251
267
|
| 会话 Cookie 登录态(浏览器进程内共享,关闭即失效) | ✅ |
|
|
252
268
|
| 服务抖动/限流重试,不误清凭证、不误弹码框 | ✅ |
|
|
253
269
|
| F12 删弹窗自动恢复 | ✅ |
|
|
270
|
+
| ~~双 Tab 登录方式(小程序扫码 / 公众号验证码)~~ | ⛔ 2026-09-16 临时停用 |
|
|
271
|
+
| ~~出码失败自动回落公众号验证码 Tab~~ | ⛔ 改为面板内重试 |
|
|
272
|
+
| ~~验证码输入框(自动跳格 / 粘贴识别 / 键盘导航 / 自动提交)~~ | ⛔ 随公众号登录临时停用 |
|
|
254
273
|
|
|
255
|
-
> **登录态有效期(2026-09-05)**:web 登录态为**会话级**——Cookie 不设 `expires
|
|
274
|
+
> **登录态有效期(2026-09-05)**:web 登录态为**会话级**——Cookie 不设 `expires`,浏览器进程关闭即失效,重新打开浏览器需重新扫码。同一浏览器会话内刷新/开新标签页不丢登录态;不写 localStorage 备份。2026-09-04 曾短暂改为 3 天持久,随激励解锁下线回退(详见主仓库 AGENTS.md)。
|
|
256
275
|
|
|
257
276
|
---
|
|
258
277
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
declare type LoginMode = "mp" | "code";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* 单次登录调用的可选项(requireAuth / showAuthModal 入参)。
|
|
5
|
+
*
|
|
6
|
+
* `required` 只作用于「本次弹出的这个弹窗」,不污染 init 的全局配置:
|
|
7
|
+
* - 不传 → 用 init 时的 config.required;
|
|
8
|
+
* - false → 本次弹窗带 × 可关闭(用户主动点登录的场景,如右上角头像);
|
|
9
|
+
* - true → 本次弹窗强制不可关闭(后台校验 / 后端 401 拦截的场景)。
|
|
10
|
+
*/
|
|
11
|
+
export declare interface RequireAuthOptions {
|
|
12
|
+
required?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
3
15
|
export declare const WxAuth: {
|
|
4
16
|
init(options?: Partial<WxAuthConfig>): void;
|
|
5
17
|
/**
|
|
@@ -13,10 +25,10 @@ export declare const WxAuth: {
|
|
|
13
25
|
*/
|
|
14
26
|
silentCheck(): Promise<boolean>;
|
|
15
27
|
autoCheck(): Promise<boolean>;
|
|
16
|
-
showAuthModal(): Promise<void>;
|
|
28
|
+
showAuthModal(options?: RequireAuthOptions): Promise<void>;
|
|
17
29
|
switchMode(mode: LoginMode): void;
|
|
18
30
|
startMpLogin(): Promise<void>;
|
|
19
|
-
requireAuth(): Promise<boolean>;
|
|
31
|
+
requireAuth(options?: RequireAuthOptions): Promise<boolean>;
|
|
20
32
|
completeLogin(result: {
|
|
21
33
|
token?: string;
|
|
22
34
|
user?: any;
|
package/dist/wx-auth.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.wx-auth-modal{position:fixed;inset:0;z-index:9999;display:none;align-items:center;justify-content:center;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,sans-serif}.wx-auth-overlay{position:absolute;width:100%;height:100%;background:#00000080;animation:wxAuthFadeIn .2s ease}.wx-auth-content{position:relative;width:350px;max-width:90vw;background:#fff;border-radius:12px;overflow:hidden;box-shadow:0 10px 40px #0003;animation:wxAuthSlideUp .3s ease}.wx-auth-header{background:#07c160;color:#fff;padding:16px
|
|
1
|
+
.wx-auth-modal{position:fixed;inset:0;z-index:9999;display:none;align-items:center;justify-content:center;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,sans-serif}.wx-auth-overlay{position:absolute;width:100%;height:100%;background:#00000080;animation:wxAuthFadeIn .2s ease}.wx-auth-content{position:relative;width:350px;max-width:90vw;background:#fff;border-radius:12px;overflow:hidden;box-shadow:0 10px 40px #0003;animation:wxAuthSlideUp .3s ease}.wx-auth-modal .wx-auth-header{position:relative;background:#07c160;color:#fff;padding:10px 16px;display:flex;align-items:center;justify-content:space-between}.wx-auth-modal .wx-auth-title{font-size:16px;font-weight:600;flex:1;text-align:center}.wx-auth-modal .wx-auth-close{position:absolute;right:8px;top:6px;background:none;border:none;color:#fff;font-size:24px;cursor:pointer;width:30px;height:30px;line-height:30px;padding:0;opacity:.85;flex-shrink:0}.wx-auth-close:hover{opacity:1}.wx-auth-body{padding:20px;text-align:center}.wx-auth-desc{font-size:15px;color:#333;margin-bottom:16px;font-weight:500}.wx-auth-hint{font-size:15px;color:#333;margin-top:12px;margin-bottom:4px;font-weight:500}.wx-auth-note{font-size:12px;color:#888;margin-bottom:14px;line-height:1.4;white-space:nowrap}.wx-auth-qrcode-container{width:180px;height:180px;margin:0 auto 8px;border:2px solid #07C160;border-radius:8px;overflow:hidden;background:#f5f5f5}.wx-auth-qrcode{width:100%;height:100%;display:none;object-fit:contain}.wx-auth-tabs{display:flex;gap:8px;margin-bottom:16px}.wx-auth-tab{flex:1;padding:8px 0;font-size:13px;border:1px solid #DCDCDC;background:#f7f7f7;color:#666;border-radius:6px;cursor:pointer;transition:all .2s}.wx-auth-tab:active{transform:scale(.98)}.wx-auth-tab-active{background:#07c160;border-color:#07c160;color:#fff;font-weight:600}.wx-auth-mp-loading{height:100%;display:flex;align-items:center;justify-content:center}.wx-auth-spinner{width:28px;height:28px;border:3px solid #e5e5e5;border-top-color:#07c160;border-radius:50%;animation:wxAuthSpin 1s linear infinite}@keyframes wxAuthSpin{to{transform:rotate(360deg)}}.wx-auth-mp-qrcode{width:100%;height:100%;display:none;object-fit:contain}.wx-auth-mp-container{position:relative}.wx-auth-mp-expired{position:absolute;inset:0;z-index:1;display:none;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:#ffffffeb}.wx-auth-mp-expired-text{font-size:13px;color:#666}.wx-auth-mp-expired .wx-auth-mp-refresh{flex:none;width:auto;margin:0;padding:8px 18px;font-size:13px}.wx-auth-mp-status{font-size:13px;color:#666;margin:4px 0 12px;min-height:18px;line-height:1.4}.wx-auth-mp-hint{margin:12px 0 4px}.wx-auth-inputs{display:flex;gap:8px;justify-content:center;margin:20px 0}.wx-auth-input{width:42px;height:50px;font-size:20px;font-weight:600;text-align:center;border:2px solid #DCDCDC;border-radius:8px;outline:none;transition:all .2s;color:#333}.wx-auth-input:focus{border-color:#07c160;box-shadow:0 0 0 2px #07c16033}.wx-auth-input:disabled{background:#f5f5f5;color:#999}.wx-auth-success-icon{font-size:48px;margin-bottom:8px}.wx-auth-success-text{font-size:16px;color:#07c160;font-weight:600}.wx-auth-message{font-size:13px;padding:8px 12px;border-radius:6px;margin:8px 0;line-height:1.4}.wx-auth-message-info{background:#e8f4ff;color:#06c;border:1px solid #B3D9FF}.wx-auth-message-success{background:#f0fdf4;color:#07c160;border:1px solid #07C160}.wx-auth-message-error{background:#fef2f2;color:#dc2626;border:1px solid #DC2626}.wx-auth-actions{display:flex;gap:10px;margin-top:16px}.wx-auth-btn{flex:1;padding:12px 16px;border:none;border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;transition:all .2s;outline:none}.wx-auth-btn:active{transform:scale(.98)}.wx-auth-btn:disabled{opacity:.5;cursor:not-allowed}.wx-auth-btn-primary{background:#07c160;color:#fff}.wx-auth-btn-primary:hover:not(:disabled){background:#06ad56}.wx-auth-btn-secondary{background:#f2f2f2;color:#333}.wx-auth-btn-secondary:hover:not(:disabled){background:#e5e5e5}@keyframes wxAuthFadeIn{0%{opacity:0}to{opacity:1}}@keyframes wxAuthSlideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@media(max-width:480px){.wx-auth-content{width:95vw;margin:20px}.wx-auth-qrcode-container{width:160px;height:160px}.wx-auth-inputs{gap:6px}.wx-auth-input{width:38px;height:46px;font-size:18px}}@media(prefers-color-scheme:dark){.wx-auth-content{background:#1a1a1a}.wx-auth-desc,.wx-auth-hint{color:#e5e5e5}.wx-auth-note{color:#aaa}.wx-auth-input{background:#2a2a2a;border-color:#444;color:#e5e5e5}.wx-auth-input:focus{border-color:#07c160;box-shadow:0 0 0 2px #07c16040}.wx-auth-input:disabled{background:#333;color:#888}.wx-auth-qrcode-container{background:#2a2a2a}.wx-auth-tab{background:#2a2a2a;border-color:#444;color:#aaa}.wx-auth-tab-active{background:#07c160;border-color:#07c160;color:#fff}.wx-auth-spinner{border-color:#444;border-top-color:#07c160}.wx-auth-mp-status{color:#aaa}.wx-auth-mp-expired{background:#1a1a1aeb}.wx-auth-mp-expired-text{color:#aaa}.wx-auth-btn-secondary{background:#2a2a2a;color:#e5e5e5}.wx-auth-btn-secondary:hover:not(:disabled){background:#333}.wx-auth-message-info{background:#0d2a1f;color:#7cc4ff;border-color:#1f4a6b}.wx-auth-message-success{background:#0d2a1a;color:#4ade80;border-color:#1f6b3a}.wx-auth-message-error{background:#2a0d0d;color:#f87171;border-color:#6b1f1f}}.wx-auth-required .wx-auth-close{display:none!important}.wx-auth-optional .wx-auth-overlay{cursor:pointer}
|