@@ -128,14 +128,14 @@ async function gistBackupAction(action, keep, encode) {
128128 content = $ . read ( '#sub-store' ) ;
129129 content = content ? JSON . parse ( content ) : { } ;
130130 if ( $ . env . isNode ) content = JSON . parse ( JSON . stringify ( $ . cache ) ) ;
131- if ( encode === 'base64' ) {
132- content = Base64 . encode (
133- JSON . stringify ( content , null , ` ` ) ,
134- ) ;
135- } else {
131+ if ( encode === 'plaintext' ) {
136132 content . settings . gistToken =
137133 '恢复后请重新设置 GitHub Token' ;
138134 content = JSON . stringify ( content , null , ` ` ) ;
135+ } else {
136+ content = Base64 . encode (
137+ JSON . stringify ( content , null , ` ` ) ,
138+ ) ;
139139 }
140140
141141 $ . info ( `下载备份, 与本地内容对比...` ) ;
@@ -156,11 +156,11 @@ async function gistBackupAction(action, keep, encode) {
156156 content = $ . read ( '#sub-store' ) ;
157157 content = content ? JSON . parse ( content ) : { } ;
158158 if ( $ . env . isNode ) content = JSON . parse ( JSON . stringify ( $ . cache ) ) ;
159- if ( encode ) {
160- content = Base64 . encode ( JSON . stringify ( content , null , ` ` ) ) ;
161- } else {
159+ if ( encode === 'plaintext' ) {
162160 content . settings . gistToken = '恢复后请重新设置 GitHub Token' ;
163161 content = JSON . stringify ( content , null , ` ` ) ;
162+ } else {
163+ content = Base64 . encode ( JSON . stringify ( content , null , ` ` ) ) ;
164164 }
165165 $ . info ( `上传备份中...` ) ;
166166 try {
0 commit comments