feat: Gist 备份默认为 Base64 编码方式
Some checks failed
build / build (push) Has been cancelled

This commit is contained in:
xream
2025-07-18 17:21:11 +08:00
parent e81245a5bb
commit 63064bc596
2 changed files with 9 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.19.85",
"version": "2.19.86",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js",
"scripts": {

View File

@@ -128,14 +128,14 @@ async function gistBackupAction(action, keep, encode) {
content = $.read('#sub-store');
content = content ? JSON.parse(content) : {};
if ($.env.isNode) content = JSON.parse(JSON.stringify($.cache));
if (encode === 'base64') {
content = Base64.encode(
JSON.stringify(content, null, ` `),
);
} else {
if (encode === 'plaintext') {
content.settings.gistToken =
'恢复后请重新设置 GitHub Token';
content = JSON.stringify(content, null, ` `);
} else {
content = Base64.encode(
JSON.stringify(content, null, ` `),
);
}
$.info(`下载备份, 与本地内容对比...`);
@@ -156,11 +156,11 @@ async function gistBackupAction(action, keep, encode) {
content = $.read('#sub-store');
content = content ? JSON.parse(content) : {};
if ($.env.isNode) content = JSON.parse(JSON.stringify($.cache));
if (encode) {
content = Base64.encode(JSON.stringify(content, null, ` `));
} else {
if (encode === 'plaintext') {
content.settings.gistToken = '恢复后请重新设置 GitHub Token';
content = JSON.stringify(content, null, ` `);
} else {
content = Base64.encode(JSON.stringify(content, null, ` `));
}
$.info(`上传备份中...`);
try {