@@ -75,6 +75,10 @@ static void SetConfig()
7575 Convert . ToBase64String ( TeaHelper . Encrypt ( Encoding . UTF8 . GetBytes ( pwd ) , _teaKey ) ) ) ;
7676
7777 File . WriteAllText ( ConfigFilePath , JsonConvert . SerializeObject ( _connInfo ) ) ;
78+
79+ _connInfo . Password = pwd ;
80+
81+ ImageUploader . Init ( _connInfo ) ;
7882 }
7983
8084 static void ProcessFile ( string [ ] args )
@@ -109,7 +113,10 @@ static void ProcessFile(string[] args)
109113 if ( File . Exists ( imgPhyPath ) )
110114 {
111115 var imgUrl = ImageUploader . Upload ( imgPhyPath ) ;
112- ReplaceDic . Add ( img , imgUrl ) ;
116+ if ( ! ReplaceDic . ContainsKey ( img ) )
117+ {
118+ ReplaceDic . Add ( img , imgUrl ) ;
119+ }
113120 Console . WriteLine ( $ "{ img } 上传成功. { imgUrl } ") ;
114121 }
115122 else
@@ -130,7 +137,7 @@ static void ProcessFile(string[] args)
130137 _fileContent = _fileContent . Replace ( key , ReplaceDic [ key ] ) ;
131138 }
132139
133- string newFileName = _filePath . Substring ( 0 , _filePath . LastIndexOf ( '.' ) ) + "-cnblog- " +
140+ string newFileName = _filePath . Substring ( 0 , _filePath . LastIndexOf ( '.' ) ) + "-cnblog" +
134141 new FileInfo ( _filePath ) . Extension ;
135142 File . WriteAllText ( newFileName , _fileContent , TxtFileEncoder . GetEncoding ( _filePath ) ) ;
136143
0 commit comments