|
12 | 12 | <script src="./static/js/crypto-js.min.js"></script> |
13 | 13 | <script src="./static/js/core.js"></script> |
14 | 14 | <script src="./static/js/cookie.js"></script> |
| 15 | + <script src="./static/js/jsencrypt.min.js"></script> |
15 | 16 | </head> |
16 | 17 | <body class="bg-gray-100 font-sans"> |
17 | 18 | <div class="artboard phone-2 box p-4"> |
18 | 19 | <!-- Navigation Menu --> |
19 | 20 | <ul class="menu menu-horizontal lg:menu-horizontal bg-base-200 rounded-box mb-4"> |
20 | 21 | <li><a class="btn-scan" data-platform="ali">阿里</a></li> |
21 | 22 | <li><a class="btn-scan" data-platform="quark">夸克</a></li> |
| 23 | + <li><a class="btn-scan" data-platform="quark_token">夸克TV</a></li> |
22 | 24 | <li><a class="btn-scan" data-platform="uc">UC</a></li> |
23 | 25 | <li><a class="btn-scan" data-platform="uc_token">UC_TOKEN</a></li> |
24 | 26 | <li><a class="btn-scan" data-platform="bili">哔哩哔哩</a></li> |
| 27 | + <li><a class="btn-scan" data-platform="yun">移动</a></li> |
25 | 28 | <li><a class="btn-scan" data-platform="baidu">百度</a></li> |
| 29 | + <li><a class="btn-scan" data-platform="pikpak">PikPak</a></li> |
26 | 30 | </ul> |
27 | 31 |
|
28 | 32 | <!-- QR Code --> |
|
93 | 97 | const textValue = document.getElementById("cookie-res").value || ''; |
94 | 98 | const active_name = activeLi.textContent.trim(); |
95 | 99 | const active_key = activeLi.getAttribute('data-platform').trim(); |
96 | | - const save_key = active_key === 'ali' ? active_key + '_token' : active_key + '_cookie'; |
| 100 | + let save_key = '' |
| 101 | + if (/ali|pikpak/.test(active_key)) { |
| 102 | + save_key = active_key + '_token' |
| 103 | + } else { |
| 104 | + save_key = active_key + '_cookie'; |
| 105 | + } |
| 106 | + |
97 | 107 | console.log(`准备入库cookie:${active_name} ${save_key},值为:${textValue}`); |
98 | 108 |
|
99 | 109 | const cookie_auth_code = prompt('cookie入库功能需要管理员授权码,请你正确输入后继续'); |
100 | 110 | if (cookie_auth_code) { |
101 | | - // 使用 axios 发送 POST 请求 |
102 | | - axios.post('/admin/cookie-set', { |
103 | | - cookie_auth_code: cookie_auth_code, |
104 | | - key: save_key, |
105 | | - value: textValue.trim().replaceAll('\n', '') |
106 | | - }) |
107 | | - .then(response => { |
| 111 | + if (save_key.includes('pikpak')) { |
| 112 | + // 使用 axios 发送 POST 请求 |
| 113 | + axios.post('/admin/cookie-set', { |
| 114 | + cookie_auth_code: cookie_auth_code, |
| 115 | + key: save_key, |
| 116 | + value: textValue.split(';')[0].trim().replaceAll('\n', '') |
| 117 | + }).then(response => { |
108 | 118 | if (response.data.success) { |
109 | 119 | alert(`Cookie 入库成功:${active_name} (${save_key})`); |
110 | 120 | } else { |
111 | 121 | alert(`入库失败:${response.data.message}`); |
112 | 122 | } |
113 | | - }) |
114 | | - .catch(error => { |
| 123 | + }).catch(error => { |
| 124 | + console.error('请求失败:', error); |
| 125 | + alert(`入库失败,服务器出现问题,请稍后再试。\n${error.response.data.message}`); |
| 126 | + }); |
| 127 | + axios.post('/admin/cookie-set', { |
| 128 | + cookie_auth_code: cookie_auth_code, |
| 129 | + key: save_key.replace('token', 'refresh_token'), |
| 130 | + value: textValue.split(';')[1].trim().replaceAll('\n', '') |
| 131 | + }).then(response => { |
| 132 | + if (response.data.success) { |
| 133 | + alert(`Cookie 入库成功:${active_name} (${save_key.replace('token', 'refresh_token')})`); |
| 134 | + } else { |
| 135 | + alert(`入库失败:${response.data.message}`); |
| 136 | + } |
| 137 | + }).catch(error => { |
115 | 138 | console.error('请求失败:', error); |
116 | 139 | alert(`入库失败,服务器出现问题,请稍后再试。\n${error.response.data.message}`); |
117 | 140 | }); |
| 141 | + } else { |
| 142 | + // 使用 axios 发送 POST 请求 |
| 143 | + axios.post('/admin/cookie-set', { |
| 144 | + cookie_auth_code: cookie_auth_code, |
| 145 | + key: save_key, |
| 146 | + value: textValue.trim().replaceAll('\n', '') |
| 147 | + }) |
| 148 | + .then(response => { |
| 149 | + if (response.data.success) { |
| 150 | + alert(`Cookie 入库成功:${active_name} (${save_key})`); |
| 151 | + } else { |
| 152 | + alert(`入库失败:${response.data.message}`); |
| 153 | + } |
| 154 | + }) |
| 155 | + .catch(error => { |
| 156 | + console.error('请求失败:', error); |
| 157 | + alert(`入库失败,服务器出现问题,请稍后再试。\n${error.response.data.message}`); |
| 158 | + }); |
| 159 | + } |
| 160 | + |
118 | 161 | } |
119 | 162 | } else { |
120 | 163 | alert('至少选中一个cookie入库项目'); |
|
0 commit comments