koishi-plugin-rocom 1.0.8 → 1.0.9

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/lib/client.js CHANGED
@@ -99,6 +99,9 @@ class RocomClient {
99
99
  if (/缺少\s*API\s*Key|API\s*Key.*required|missing\s+api\s*key/i.test(message)) {
100
100
  return true;
101
101
  }
102
+ if (/请提供有效的认证凭证|有效的?认证凭证|valid\s+credentials?\s+required|X-API-Key|Authorization\s*:\s*Bearer|X-Anonymous-Token/i.test(message)) {
103
+ return true;
104
+ }
102
105
  if (/HTTP\s*(401|403)/i.test(message)) {
103
106
  return true;
104
107
  }
@@ -280,7 +283,11 @@ class RocomClient {
280
283
  const status = Number(response?.status ?? response?.statusCode ?? 200);
281
284
  const body = response?.data !== undefined ? response.data : response;
282
285
  if (body?.code !== undefined && body.code !== 0) {
283
- this.setLastError(body.message || body.msg || '接口返回异常');
286
+ const rawMessage = body.message || body.msg || '接口返回异常';
287
+ const message = !acceptedStatuses.includes(status)
288
+ ? `HTTP ${status}: ${rawMessage}`
289
+ : rawMessage;
290
+ this.setLastError(message);
284
291
  if (!options.silentFailureDetails) {
285
292
  this.logRequestFailureDetails(method, path, headers, options.params, options.json, body);
286
293
  }
@@ -1058,12 +1058,6 @@ function buildPlayerSearchRenderData(payload, uid) {
1058
1058
  ['舒适度', playerField(parsed, 'home_comfort_level')],
1059
1059
  ['访客数量', playerField(parsed, 'visitor_num')],
1060
1060
  ]),
1061
- pack('名片信息', [
1062
- ['名片皮肤', playerField(parsed, 'card_skin_selected')],
1063
- ['名片头像', playerField(parsed, 'card_icon_selected')],
1064
- ['首标签', playerField(parsed, 'card_label_first_selected')],
1065
- ['尾标签', playerField(parsed, 'card_label_last_selected')],
1066
- ]),
1067
1061
  ].filter(Boolean);
1068
1062
  const summaryCards = [
1069
1063
  { label: '等级', value: parsed.level },
@@ -1076,7 +1070,6 @@ function buildPlayerSearchRenderData(payload, uid) {
1076
1070
  const signature = parsed.signature && parsed.signature !== '未设置' ? parsed.signature : '';
1077
1071
  return {
1078
1072
  title: '洛克玩家',
1079
- subtitle: parsed.title,
1080
1073
  heroTitle: '玩家信息',
1081
1074
  heroValue: parsed.nickname,
1082
1075
  heroSubvalue: `UID ${parsed.uid}`,
package/lib/index.js CHANGED
@@ -96,7 +96,7 @@ function buildMenuFallbackText() {
96
96
  exports.Config = koishi_1.Schema.intersect([
97
97
  koishi_1.Schema.object({
98
98
  apiBaseUrl: koishi_1.Schema.string().default('https://wegame.shallow.ink').description('API 基础地址'),
99
- wegameApiKey: koishi_1.Schema.string().default('').description('WeGame API Key'),
99
+ wegameApiKey: koishi_1.Schema.string().default('').description('WeGame API Key(获取 key 查看 Github:https://github.com/Entropy-Increase-Team/koishi-plugin-rocom )'),
100
100
  qqLoginDebugMode: koishi_1.Schema.boolean().default(false).description('QQ 扫码登录调试模式,仅调试时开启'),
101
101
  adminUserIds: koishi_1.Schema.array(String).default([]).description('管理员用户 ID 列表'),
102
102
  autoRefreshEnabled: koishi_1.Schema.boolean().default(false).description('启用自动刷新凭证'),
@@ -1,60 +1,68 @@
1
- <!DOCTYPE html>
2
- <html lang="zh-CN">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=1200, initial-scale=1">
6
- <link rel="stylesheet" href="{{_res_path}}render/player-search/style.css">
7
- </head>
8
- <body>
9
- <div class="player-search-page player-page">
10
- <div class="page-header">
11
- <div class="page-title">{{title}}</div>
12
- <div class="page-subtitle">{{subtitle}}</div>
13
- </div>
14
-
15
- <div class="hero-card">
16
- <div class="hero-title">{{heroTitle}}</div>
17
- <div class="hero-value">{{heroValue}}</div>
18
- <div class="hero-subvalue">{{heroSubvalue}}</div>
19
- </div>
20
-
21
- <div class="summary-grid">
22
- {{each summaryCards item}}
23
- <div class="summary-card">
24
- <div class="summary-label">{{item.label}}</div>
25
- <div class="summary-value">{{item.value}}</div>
26
- </div>
27
- {{/each}}
28
- </div>
29
-
30
- {{if showSignature}}
31
- <div class="panel-card signature-panel">
32
- <div class="section-title">个性签名</div>
33
- <div class="signature-box">{{signature}}</div>
34
- </div>
35
- {{/if}}
36
-
37
- <div class="section-grid">
38
- {{each sections section}}
39
- <div class="panel-card info-panel">
40
- <div class="section-title">{{section.title}}</div>
41
- <div class="detail-card">
42
- {{each section["items"] item}}
43
- <div class="detail-row">
44
- <div class="detail-label">{{item.label}}</div>
45
- <div class="detail-value">{{item.value}}</div>
46
- </div>
47
- {{/each}}
48
- </div>
49
- </div>
50
- {{/each}}
51
- </div>
52
-
53
- {{if commandHint}}
54
- <div class="command-hint">{{commandHint}}</div>
55
- {{/if}}
56
-
57
- <div class="footer">{{copyright}}</div>
58
- </div>
59
- </body>
60
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=1280, initial-scale=1">
6
+ <link rel="stylesheet" href="{{_res_path}}render/player-search/style.css">
7
+ </head>
8
+ <body>
9
+ <div class="player-search-page player-page">
10
+ <div class="page-bg"></div>
11
+
12
+ <header class="page-header">
13
+ <div class="page-title">{{title}}</div>
14
+ <div class="page-title-ghost">ROCOM PLAYER</div>
15
+ </header>
16
+
17
+ <section class="profile-strip">
18
+ <div class="profile-main">
19
+ <div class="profile-name-row">
20
+ <span class="player-name">{{heroValue}}</span>
21
+ <span class="uid-pill">{{heroSubvalue}}</span>
22
+ </div>
23
+ </div>
24
+ </section>
25
+
26
+ <section class="summary-strip">
27
+ {{each summaryCards item}}
28
+ <div class="summary-item">
29
+ <div class="summary-label">{{item.label}}</div>
30
+ <div class="summary-value">{{item.value}}</div>
31
+ </div>
32
+ {{/each}}
33
+ </section>
34
+
35
+ {{if showSignature}}
36
+ <section class="signature-strip">
37
+ <div class="signature-label">个性签名</div>
38
+ <div class="signature-text">{{signature}}</div>
39
+ </section>
40
+ {{/if}}
41
+
42
+ <main class="content-grid">
43
+ {{each sections section}}
44
+ <section class="panel">
45
+ <div class="panel-head">
46
+ <h2>{{section.title}}</h2>
47
+ </div>
48
+ <div class="detail-list">
49
+ {{each section["items"] item}}
50
+ <div class="detail-row">
51
+ <span class="detail-label">{{item.label}}</span>
52
+ <span class="detail-value">{{item.value}}</span>
53
+ </div>
54
+ {{/each}}
55
+ </div>
56
+ </section>
57
+ {{/each}}
58
+ </main>
59
+
60
+ <footer class="page-footer">
61
+ {{if commandHint}}
62
+ <div class="command-hint">用法:{{commandHint}}</div>
63
+ {{/if}}
64
+ <div class="copyright">{{copyright}}</div>
65
+ </footer>
66
+ </div>
67
+ </body>
68
+ </html>
@@ -1,192 +1,300 @@
1
- @font-face {
2
- font-family: "rocom-player";
3
- src: url("../../ttf/HYWenHei-85W-1.ttf") format("truetype");
4
- font-display: swap;
5
- }
6
-
7
- html,
8
- body {
9
- margin: 0;
10
- padding: 26px;
11
- background: #efe6d8;
12
- display: inline-block;
13
- font-family: "rocom-player", "Microsoft YaHei", "PingFang SC", sans-serif;
14
- }
15
-
16
- .player-page {
17
- width: 1180px;
18
- padding: 34px 36px 30px;
19
- box-sizing: border-box;
20
- border-radius: 28px;
21
- color: #322618;
22
- background:
23
- linear-gradient(rgba(40, 29, 18, 0.10), rgba(40, 29, 18, 0.10)),
24
- url("../../img/ercode-bg.D1ccSQKH.png") center/cover no-repeat;
25
- }
26
-
27
- .page-header {
28
- padding-bottom: 18px;
29
- border-bottom: 2px dashed rgba(141, 106, 68, 0.28);
30
- }
31
-
32
- .page-title {
33
- font-size: 44px;
34
- line-height: 1.1;
35
- font-weight: 800;
36
- }
37
-
38
- .page-subtitle {
39
- margin-top: 10px;
40
- font-size: 22px;
41
- line-height: 1.4;
42
- color: #6d5944;
43
- }
44
-
45
- .hero-card,
46
- .summary-card,
47
- .panel-card,
48
- .command-hint {
49
- border: 1px solid rgba(141, 106, 68, 0.16);
50
- border-radius: 20px;
51
- background: rgba(255, 252, 247, 0.82);
52
- box-shadow: 0 10px 26px rgba(83, 58, 35, 0.08);
53
- }
54
-
55
- .hero-card {
56
- margin-top: 22px;
57
- padding: 24px 26px;
58
- background:
59
- linear-gradient(135deg, rgba(237, 179, 89, 0.24), rgba(255, 251, 245, 0.88)),
60
- rgba(255, 252, 247, 0.86);
61
- }
62
-
63
- .hero-title {
64
- font-size: 20px;
65
- color: #8b735b;
66
- }
67
-
68
- .hero-value {
69
- margin-top: 8px;
70
- font-size: 42px;
71
- line-height: 1.15;
72
- font-weight: 800;
73
- color: #2e2418;
74
- }
75
-
76
- .hero-subvalue {
77
- margin-top: 8px;
78
- font-size: 22px;
79
- color: #6d5944;
80
- }
81
-
82
- .summary-grid {
83
- display: grid;
84
- grid-template-columns: repeat(3, 1fr);
85
- gap: 16px;
86
- margin-top: 22px;
87
- }
88
-
89
- .summary-card {
90
- padding: 18px 20px;
91
- }
92
-
93
- .summary-label {
94
- font-size: 18px;
95
- color: #8b735b;
96
- }
97
-
98
- .summary-value {
99
- margin-top: 10px;
100
- font-size: 30px;
101
- line-height: 1.2;
102
- font-weight: 800;
103
- }
104
-
105
- .panel-card {
106
- margin-top: 18px;
107
- padding: 20px;
108
- }
109
-
110
- .signature-panel {
111
- margin-top: 20px;
112
- }
113
-
114
- .section-grid {
115
- display: grid;
116
- grid-template-columns: repeat(2, minmax(0, 1fr));
117
- gap: 18px;
118
- margin-top: 18px;
119
- }
120
-
121
- .info-panel {
122
- margin-top: 0;
123
- }
124
-
125
- .section-title {
126
- margin-bottom: 14px;
127
- font-size: 28px;
128
- font-weight: 800;
129
- }
130
-
131
- .signature-box {
132
- padding: 18px 20px;
133
- border-radius: 18px;
134
- background: rgba(255,255,255,0.42);
135
- border: 1px solid rgba(141, 106, 68, 0.10);
136
- font-size: 22px;
137
- line-height: 1.5;
138
- color: #4f3c29;
139
- }
140
-
141
- .detail-card {
142
- overflow: hidden;
143
- border-radius: 18px;
144
- background: rgba(255,255,255,0.42);
145
- border: 1px solid rgba(141, 106, 68, 0.10);
146
- padding: 0 16px;
147
- }
148
-
149
- .detail-row {
150
- display: grid;
151
- grid-template-columns: 220px 1fr;
152
- gap: 16px;
153
- padding: 14px 0;
154
- border-bottom: 1px solid rgba(141, 106, 68, 0.10);
155
- }
156
-
157
- .detail-row:last-child {
158
- border-bottom: none;
159
- }
160
-
161
- .detail-label {
162
- font-size: 20px;
163
- font-weight: 700;
164
- color: #6d5944;
165
- }
166
-
167
- .detail-value {
168
- font-size: 20px;
169
- color: #322618;
170
- word-break: break-word;
171
- text-align: right;
172
- }
173
-
174
- .command-hint {
175
- margin-top: 20px;
176
- padding: 14px 18px;
177
- font-size: 20px;
178
- color: #6d5944;
179
- }
180
-
181
- .footer {
182
- margin-top: 18px;
183
- text-align: center;
184
- font-size: 16px;
185
- color: rgba(113, 93, 73, 0.88);
186
- }
187
-
188
- @media (max-width: 1280px) {
189
- .section-grid {
190
- grid-template-columns: 1fr;
191
- }
192
- }
1
+ @font-face {
2
+ font-family: "rocom-player";
3
+ src: url("../../ttf/HYWenHei-85W-1.ttf") format("truetype");
4
+ font-display: swap;
5
+ }
6
+
7
+ * {
8
+ box-sizing: border-box;
9
+ }
10
+
11
+ html,
12
+ body {
13
+ margin: 0;
14
+ padding: 20px;
15
+ display: inline-block;
16
+ background: #f4ecdc;
17
+ color: #33271a;
18
+ font-family: "rocom-player", "Microsoft YaHei", "PingFang SC", sans-serif;
19
+ }
20
+
21
+ .player-page {
22
+ position: relative;
23
+ width: 1240px;
24
+ overflow: hidden;
25
+ border-radius: 28px;
26
+ padding: 0 32px 28px;
27
+ background: #f4ecdc;
28
+ box-shadow: 0 26px 58px rgba(76, 55, 32, 0.18);
29
+ }
30
+
31
+ .page-bg {
32
+ position: absolute;
33
+ inset: 0;
34
+ background:
35
+ radial-gradient(circle at 10% 12%, rgba(255, 231, 177, 0.52), transparent 28%),
36
+ radial-gradient(circle at 96% 18%, rgba(255, 188, 85, 0.24), transparent 30%);
37
+ pointer-events: none;
38
+ }
39
+
40
+ .page-header,
41
+ .profile-strip,
42
+ .summary-strip,
43
+ .signature-strip,
44
+ .content-grid,
45
+ .page-footer {
46
+ position: relative;
47
+ z-index: 1;
48
+ }
49
+
50
+ /* ── Header ── */
51
+
52
+ .page-header {
53
+ position: relative;
54
+ min-height: 88px;
55
+ display: grid;
56
+ place-items: center;
57
+ overflow: hidden;
58
+ margin: 0 -32px;
59
+ background: linear-gradient(90deg, #ffc95f, #f5b64c);
60
+ }
61
+
62
+ .page-title {
63
+ position: relative;
64
+ z-index: 2;
65
+ color: #10100e;
66
+ font-size: 42px;
67
+ line-height: 1;
68
+ letter-spacing: 4px;
69
+ text-shadow: 0 3px 0 rgba(255, 255, 255, 0.22);
70
+ }
71
+
72
+ .page-title-ghost {
73
+ position: absolute;
74
+ inset: -12px 0 auto;
75
+ z-index: 1;
76
+ text-align: center;
77
+ color: rgba(255, 228, 152, 0.24);
78
+ font-size: 100px;
79
+ line-height: 1.1;
80
+ letter-spacing: 8px;
81
+ white-space: nowrap;
82
+ }
83
+
84
+ /* ── Profile Strip ── */
85
+
86
+ .profile-strip {
87
+ display: flex;
88
+ align-items: center;
89
+ justify-content: center;
90
+ gap: 22px;
91
+ margin-top: 20px;
92
+ padding: 20px 32px;
93
+ border-radius: 22px;
94
+ background: rgba(250, 247, 238, 0.78);
95
+ border: 1px solid rgba(143, 113, 73, 0.16);
96
+ box-shadow: 0 12px 26px rgba(88, 64, 38, 0.08);
97
+ }
98
+
99
+ .profile-main {
100
+ min-width: 0;
101
+ flex: 1;
102
+ text-align: center;
103
+ }
104
+
105
+ .profile-name-row {
106
+ display: flex;
107
+ align-items: center;
108
+ justify-content: center;
109
+ flex-wrap: wrap;
110
+ gap: 14px;
111
+ }
112
+
113
+ .player-name {
114
+ max-width: 820px;
115
+ overflow: hidden;
116
+ color: #171411;
117
+ font-size: 40px;
118
+ line-height: 1.12;
119
+ text-overflow: ellipsis;
120
+ white-space: nowrap;
121
+ font-weight: 800;
122
+ }
123
+
124
+ .uid-pill {
125
+ padding: 8px 18px;
126
+ border-radius: 999px;
127
+ background: #ffc65f;
128
+ color: #3c2a12;
129
+ font-size: 20px;
130
+ line-height: 1;
131
+ box-shadow: inset 0 -2px 0 rgba(141, 94, 30, 0.12);
132
+ }
133
+
134
+ .profile-subtitle {
135
+ margin-top: 8px;
136
+ color: #7f6e57;
137
+ font-size: 20px;
138
+ }
139
+
140
+ /* ── Summary Strip ── */
141
+
142
+ .summary-strip {
143
+ display: grid;
144
+ grid-template-columns: repeat(3, minmax(0, 1fr));
145
+ gap: 12px;
146
+ margin-top: 16px;
147
+ }
148
+
149
+ .summary-item {
150
+ display: flex;
151
+ flex-direction: column;
152
+ align-items: center;
153
+ justify-content: center;
154
+ min-height: 72px;
155
+ padding: 12px 16px;
156
+ border-radius: 999px;
157
+ border: 1px solid rgba(143, 113, 73, 0.14);
158
+ background: rgba(250, 247, 238, 0.82);
159
+ box-shadow: 0 12px 26px rgba(88, 64, 38, 0.08);
160
+ text-align: center;
161
+ }
162
+
163
+ .summary-label {
164
+ color: #7e6a50;
165
+ font-size: 15px;
166
+ }
167
+
168
+ .summary-value {
169
+ margin-top: 4px;
170
+ color: #33271a;
171
+ font-size: 26px;
172
+ line-height: 1.1;
173
+ white-space: nowrap;
174
+ font-weight: 800;
175
+ }
176
+
177
+ /* ── Signature Strip ── */
178
+
179
+ .signature-strip {
180
+ margin-top: 14px;
181
+ padding: 16px 24px;
182
+ border-radius: 20px;
183
+ background: rgba(250, 247, 238, 0.78);
184
+ border: 1px solid rgba(143, 113, 73, 0.16);
185
+ box-shadow: 0 12px 26px rgba(88, 64, 38, 0.08);
186
+ text-align: center;
187
+ }
188
+
189
+ .signature-label {
190
+ color: #907b5e;
191
+ font-size: 14px;
192
+ margin-bottom: 6px;
193
+ }
194
+
195
+ .signature-text {
196
+ color: #4a3a28;
197
+ font-size: 20px;
198
+ line-height: 1.55;
199
+ }
200
+
201
+ /* ── Content Grid ── */
202
+
203
+ .content-grid {
204
+ display: grid;
205
+ grid-template-columns: repeat(2, minmax(0, 1fr));
206
+ gap: 14px;
207
+ align-items: start;
208
+ margin-top: 14px;
209
+ }
210
+
211
+ .panel {
212
+ border-radius: 22px;
213
+ padding: 20px 22px;
214
+ border: 1px solid rgba(143, 113, 73, 0.14);
215
+ background: rgba(250, 247, 238, 0.82);
216
+ box-shadow: 0 12px 26px rgba(88, 64, 38, 0.08);
217
+ }
218
+
219
+ .panel-head {
220
+ margin-bottom: 14px;
221
+ text-align: center;
222
+ }
223
+
224
+ .panel-head h2 {
225
+ margin: 0;
226
+ color: #171411;
227
+ font-size: 26px;
228
+ line-height: 1.1;
229
+ font-weight: 800;
230
+ }
231
+
232
+ .detail-list {
233
+ border-radius: 16px;
234
+ overflow: hidden;
235
+ background: rgba(255, 255, 255, 0.52);
236
+ border: 1px solid rgba(143, 113, 73, 0.10);
237
+ }
238
+
239
+ .detail-row {
240
+ display: flex;
241
+ align-items: center;
242
+ justify-content: space-between;
243
+ gap: 14px;
244
+ padding: 12px 20px;
245
+ border-bottom: 1px solid rgba(143, 113, 73, 0.08);
246
+ }
247
+
248
+ .detail-row:last-child {
249
+ border-bottom: none;
250
+ }
251
+
252
+ .detail-label {
253
+ flex-shrink: 0;
254
+ color: #8c7354;
255
+ font-size: 18px;
256
+ font-weight: 700;
257
+ min-width: 80px;
258
+ }
259
+
260
+ .detail-value {
261
+ color: #33271a;
262
+ font-size: 18px;
263
+ text-align: right;
264
+ word-break: break-word;
265
+ min-width: 0;
266
+ flex: 1;
267
+ }
268
+
269
+ /* ── Footer ── */
270
+
271
+ .page-footer {
272
+ margin-top: 18px;
273
+ padding: 12px 0 0;
274
+ text-align: center;
275
+ }
276
+
277
+ .command-hint {
278
+ display: inline-block;
279
+ padding: 7px 18px;
280
+ border-radius: 999px;
281
+ background: rgba(255, 198, 95, 0.22);
282
+ color: #795f3f;
283
+ font-size: 16px;
284
+ margin-bottom: 8px;
285
+ }
286
+
287
+ .copyright {
288
+ color: rgba(113, 93, 73, 0.72);
289
+ font-size: 14px;
290
+ }
291
+
292
+ @media (max-width: 1280px) {
293
+ .content-grid {
294
+ grid-template-columns: 1fr;
295
+ }
296
+
297
+ .summary-strip {
298
+ grid-template-columns: repeat(2, 1fr);
299
+ }
300
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-rocom",
3
3
  "description": "洛克王国查询与订阅插件",
4
- "version": "1.0.8",
4
+ "version": "1.0.9",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "homepage": "https://github.com/staytomorrow/koishi-plugin-rocom",