a
File size: 10,303 Bytes
c556001
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4cbca2a
 
 
 
8724711
 
 
 
c556001
 
 
 
4cbca2a
 
c556001
4cbca2a
c556001
 
 
 
 
 
4cbca2a
c556001
 
4cbca2a
 
c556001
 
 
 
4cbca2a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c556001
 
4cbca2a
c556001
 
 
 
 
 
 
 
 
 
 
 
 
 
4cbca2a
 
 
 
 
 
 
c556001
 
 
 
 
4cbca2a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8724711
 
c556001
4cbca2a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c556001
4cbca2a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c556001
4cbca2a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c556001
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>布拉迪找人</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
            margin: 0;
            padding: 0;
        }

        header {
            background-color: #1f84d4;
            color: #fff;
            padding: 10px;
            text-align: center;
        }

        .container {
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
        }

        .input-group {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 10px;
        }

        input[type="text"] {
            flex: 1;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 4px;
            outline: none;
        }

        #search {
            background-color: #1f84d4;
            color: #fff;
            border: none;
            padding: 10px 20px;
            border-radius: 4px;
            cursor: pointer;
            margin-left: 10px;
        }

        .result-item {
            margin-top: 20px;
            text-align: center;
            border: 1px solid #eee;
            padding: 15px;
            border-radius: 8px;
            background-color: #fafafa;
            box-sizing: border-box;
            /* 关键:包含 padding 和 border 在 width 内 */
            max-width: 100%;
            /* 确保不超过容器 */
        }

        .result-item img {
            display: block;
            max-width: 100px;
            height: auto;
            margin: 0 auto 10px;
            border-radius: 50%;
        }

        .result-item button {
            background-color: #1f84d4;
            color: #fff;
            border: none;
            padding: 8px 16px;
            border-radius: 4px;
            cursor: pointer;
            margin-top: 10px;
            margin-right: 5px;
        }

        .result-item p {
            margin: 5px 0;
            font-size: 14px;
        }

        /* Modal Styles */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7);
        }

        .modal-content {
            position: relative;
            background-color: #fff;
            margin: 10% auto;
            padding: 20px;
            border-radius: 8px;
            width: 90%;
            max-width: 400px;
            text-align: center;
        }

        .close-btn {
            position: absolute;
            top: 10px;
            right: 15px;
            font-size: 24px;
            color: #aaa;
            cursor: pointer;
        }

        .close-btn:hover {
            color: #000;
        }

        .detail-info p {
            margin: 8px 0;
            font-size: 16px;
        }
    </style>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"></script>
</head>

<body>
    <header>
        <h1>布拉迪昵称找人</h1>
    </header>
    <div class="container">
        <div class="input-group">
            <input type="text" id="name" placeholder="输入昵称">
            <input type="button" value="查询" onclick="search()" id="search">
        </div>
        <div id="result-container"></div>
    </div>

    <!-- Detail Modal -->
    <div id="detailModal" class="modal">
        <div class="modal-content">
            <div class="detail-info" id="detailInfo"></div>
        </div>
    </div>

    <script>
        function search() {
            var name = document.getElementById("name").value;
            if (name === "") {
                alert("请先输入昵称哦~");
                return;
            }

            const url = `/search?name=${encodeURIComponent(name)}`;
            fetch(url)
                .then(response => {
                    if (!response.ok) {
                        throw new Error('Network response was not ok');
                    }
                    return response.json();
                })
                .then(data => {
                    var code = data.code;
                    var resultContainer = document.getElementById("result-container");
                    resultContainer.innerHTML = '';

                    if (code === 200) {
                        var list = data.data.list;
                        list.forEach(item => {
                            var itemDiv = document.createElement('div');
                            itemDiv.classList.add('result-item');

                            var img = document.createElement('img');
                            img.src = item.avatar || 'https://web.bldimg.com/cblued/static/default.1c2b240hi2sg3rh.png';
                            itemDiv.appendChild(img);

                            var uidP = document.createElement('p');
                            uidP.textContent = `UID: ${item.uid}`;
                            itemDiv.appendChild(uidP);

                            var unionUidP = document.createElement('p');
                            unionUidP.textContent = `ID: ${item.uuid}`;
                            itemDiv.appendChild(unionUidP);

                            // 普通跳转按钮
                            var homeBtn = document.createElement('button');
                            homeBtn.textContent = "打开主页";
                            homeBtn.addEventListener('click', function () {
                                var url = "https://app.blued.cn/user?id=" + item.uid;
                                window.open(url);
                            });
                            itemDiv.appendChild(homeBtn);

                            // 查看详细信息按钮
                            var detailBtn = document.createElement('button');
                            detailBtn.textContent = "查看信息";
                            detailBtn.addEventListener('click', function () {
                                fetchDetail(item.uid, item.uuid);
                            });
                            itemDiv.appendChild(detailBtn);

                            resultContainer.appendChild(itemDiv);
                        });
                    } else {
                        alert("查无此人");
                    }
                })
                .catch(error => {
                    console.error('Fetch Error:', error);
                    alert("查询出错,请稍后再试");
                });
        }

        function fetchDetail(uid, uuid) {
            fetch(`/getDetail?id=${encodeURIComponent(uid)}`)
                .then(response => response.json())
                .then(data => {
                    if (data && data.userInfo) {
                        fetch('/viewPhone?id=' + a(uuid))
                            .then(response => response.json())
                            .then(phonedata => {
                                const info = data.userInfo;
                                const detailHtml = `
                            <p><strong>昵称:</strong>${info.name || '未知'}</p>
                            <p><strong>信息:</strong>${info.age}/${info.height}/${info.weight}</p>
                            <p><strong>角色:</strong>${info.role}</p>
                            <p><strong>地区:</strong>${info.area || '未知'}</p>
                            <p><strong>bind:</strong>${phonedata.data[0].bind}</p>
                            <p><strong>relation:</strong>${phonedata.data[0].relation}</p>
                        `;
                                document.getElementById('detailInfo').innerHTML = detailHtml;
                                document.getElementById('detailModal').style.display = 'block';
                            })
                            .catch(err => {
                                console.error('Phone fetch error:', err);
                            })



                    } else {
                        alert("未获取到详细信息");
                    }
                })
                .catch(err => {
                    console.error('Detail fetch error:', err);
                    alert("加载详细信息失败");
                });
        }

        function closeDetailModal() {
            document.getElementById('detailModal').style.display = 'none';
        }

        window.onclick = function (event) {
            const modal = document.getElementById('detailModal');
            if (event.target === modal) {
                closeDetailModal();
            }
        };

        const PREFIX = "df0b".toLowerCase();
        const KEY = CryptoJS.enc.Base64.parse("VlEc5qsEDXWChrWJ0AzMXQ==");
        const IV = CryptoJS.enc.Base64.parse("MC8Lpxk9zqyuRPXMdO8rJQ==");

        // 加密函数
        function a(strData) {
            // 生成16字节随机密钥
            const randomKey = CryptoJS.lib.WordArray.random(16);

            // 加密数据
            const encryptedData = encryptData(KEY, strData, randomKey);
            const encryptedHex = bytesToHex(encryptedData);

            // 编码随机密钥
            const encodedKey = bytesToHex(randomKey);

            // 计算前缀的第一个字符作为十六进制数的值
            const prefixValue = parseInt(PREFIX[0], 16);

            // 组合结果
            return PREFIX + encryptedHex.substring(0, prefixValue) + encodedKey + encryptedHex.substring(prefixValue);
        }

        function encryptData(key, data, iv) {
            // 使用CBC模式和PKCS7填充
            const encrypted = CryptoJS.AES.encrypt(
                data,
                key,
                {
                    iv: iv,
                    mode: CryptoJS.mode.CBC,
                    padding: CryptoJS.pad.Pkcs7
                }
            );
            return encrypted.ciphertext;
        }

        function bytesToHex(byteArray) {
            return byteArray.toString(CryptoJS.enc.Hex).toUpperCase();
        }


    </script>
</body>

</html>