|
53 | 53 | downloadImages: false, |
54 | 54 | migrateToOSS: false, |
55 | 55 | // 第三方图床配置 |
56 | | - aliyunOSS: { |
| 56 | + yourselfOSS: { |
57 | 57 | bucket: 'springrain-picturebed', |
58 | 58 | region: 'oss-cn-shenzhen', |
59 | 59 | folder: 'img/', |
|
211 | 211 | <label style="display: block; margin-bottom: 5px;">第三方图床设置:</label> |
212 | 212 | <div style="display: flex; margin-bottom: 5px;"> |
213 | 213 | <label style="width: 120px;">Bucket:</label> |
214 | | - <input id="oss-bucket" type="text" value="${this.config.aliyunOSS.bucket}" style="flex: 1; padding: 5px;"> |
| 214 | + <input id="oss-bucket" type="text" value="${this.config.yourselfOSS.bucket}" style="flex: 1; padding: 5px;"> |
215 | 215 | </div> |
216 | 216 | <div style="display: flex; margin-bottom: 5px;"> |
217 | 217 | <label style="width: 120px;">Region:</label> |
218 | | - <input id="oss-region" type="text" value="${this.config.aliyunOSS.region}" style="flex: 1; padding: 5px;"> |
| 218 | + <input id="oss-region" type="text" value="${this.config.yourselfOSS.region}" style="flex: 1; padding: 5px;"> |
219 | 219 | </div> |
220 | 220 | <div style="display: flex; margin-bottom: 5px;"> |
221 | 221 | <label style="width: 120px;">Folder:</label> |
222 | | - <input id="oss-folder" type="text" value="${this.config.aliyunOSS.folder}" style="flex: 1; padding: 5px;"> |
| 222 | + <input id="oss-folder" type="text" value="${this.config.yourselfOSS.folder}" style="flex: 1; padding: 5px;"> |
223 | 223 | </div> |
224 | 224 | <div style="display: flex; margin-bottom: 5px;"> |
225 | 225 | <label style="width: 120px;">Endpoint:</label> |
226 | | - <input id="oss-endpoint" type="text" value="${this.config.aliyunOSS.endpoint}" style="flex: 1; padding: 5px;"> |
| 226 | + <input id="oss-endpoint" type="text" value="${this.config.yourselfOSS.endpoint}" style="flex: 1; padding: 5px;"> |
227 | 227 | </div> |
228 | 228 | <div style="display: flex; margin-bottom: 5px; align-items: center;"> |
229 | | - <input id="save-without-dialog" type="checkbox" ${this.config.aliyunOSS.saveWithoutDialog ? 'checked' : ''}> |
| 229 | + <input id="save-without-dialog" type="checkbox" ${this.config.yourselfOSS.saveWithoutDialog ? 'checked' : ''}> |
230 | 230 | <label for="save-without-dialog" style="margin-left: 5px;">自动保存图片(无弹窗)</label> |
231 | 231 | </div> |
232 | 232 | </div> |
|
306 | 306 | this.config.migrateToOSS = document.getElementById('migrate-to-oss').checked; |
307 | 307 |
|
308 | 308 | // 第三方图床设置 |
309 | | - this.config.aliyunOSS = { |
| 309 | + this.config.yourselfOSS = { |
310 | 310 | bucket: document.getElementById('oss-bucket').value, |
311 | 311 | region: document.getElementById('oss-region').value, |
312 | 312 | folder: document.getElementById('oss-folder').value, |
|
828 | 828 | function buildOssUrl(filename) { |
829 | 829 | // 确保文件名是纯文件名,不包含路径 |
830 | 830 | const pureName = filename.split('/').pop(); |
831 | | - return `https://${config.aliyunOSS.bucket}.${config.aliyunOSS.endpoint}/${config.aliyunOSS.folder}${pureName}`; |
| 831 | + return `https://${config.yourselfOSS.bucket}.${config.yourselfOSS.endpoint}/${config.yourselfOSS.folder}${pureName}`; |
832 | 832 | } |
833 | 833 |
|
834 | 834 | // 下载单个图片 |
|
841 | 841 | GM_download({ |
842 | 842 | url: imageUrl, |
843 | 843 | name: filename, |
844 | | - saveAs: !config.aliyunOSS.saveWithoutDialog, // 是否显示保存对话框 |
| 844 | + saveAs: !config.yourselfOSS.saveWithoutDialog, // 是否显示保存对话框 |
845 | 845 | onload: function() { |
846 | 846 | console.log(`图片下载成功: ${filename}`); |
847 | 847 | resolve(filename); |
|
0 commit comments