|
|
@@ -105,7 +105,8 @@ proto.downloadSvg = P.coroutine(function* (svgUrl, savePath,playerId, cb) {
|
|
|
if (res.statusCode === 302 && res.headers.location) {
|
|
|
console.log('检测到302重定向,新地址:', res.headers.location);
|
|
|
// 递归请求重定向后的地址
|
|
|
- self.downloadSvg(res.headers.location, destPngPath+playerId+".png",playerId,function(){});
|
|
|
+ self.downloadSvg(res.headers.location, destPngPath+md5(playerId)+".png",playerId,function(){});
|
|
|
+ console.warn("destPngPath+md5(playerId)"+".png:",destPngPath+md5(playerId)+".png")
|
|
|
return;
|
|
|
}
|
|
|
if (res.statusCode !== 200) {
|
|
|
@@ -321,7 +322,7 @@ proto.login = P.coroutine(function* (msg, session, next) {
|
|
|
console.log('SVG 已下载到:', localSvgPath);
|
|
|
|
|
|
// 调用转换函数
|
|
|
- self.convertSvgToPng(localSvgPath, destPngPath+playerId+".png", 1.0, function(err) {
|
|
|
+ self.convertSvgToPng(localSvgPath, destPngPath+md5(playerId)+".png", 1.0, function(err) {
|
|
|
if (err) {
|
|
|
console.error('转换 PNG 失败:', err.message);
|
|
|
} else {
|