Skip to content

Commit 538482a

Browse files
hello-haohello-hao
authored andcommitted
🚀删除部分无用代码
1 parent f8a712e commit 538482a

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/main/java/cn/hellohao/service/impl/InitializationStorage.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class InitializationStorage implements CommandLineRunner {
3030
private KeysMapper keysMapper;
3131

3232
@Override
33-
public void run(String... args) throws Exception {
33+
public void run(String... args) {
3434
SubjectFilter.WEBHOST = allowedOrigins;
3535
String name = ManagementFactory.getRuntimeMXBean().getName();
3636
String pid = name.split("@")[0];
@@ -41,21 +41,20 @@ public void intiStorage(){
4141
List<Keys> keylist = keysMapper.getKeys();
4242
for (Keys key : keylist) {
4343
if(key.getStorageType()!=0 && key.getStorageType()!=null){
44-
int ret =0;
4544
if(key.getStorageType()==1){
46-
ret =NOSImageupload.Initialize(key);
45+
NOSImageupload.Initialize(key);
4746
}else if (key.getStorageType()==2){
48-
ret =OSSImageupload.Initialize(key);
47+
OSSImageupload.Initialize(key);
4948
}else if(key.getStorageType()==3){
50-
ret = USSImageupload.Initialize(key);
49+
USSImageupload.Initialize(key);
5150
}else if(key.getStorageType()==4){
52-
ret = KODOImageupload.Initialize(key);
51+
KODOImageupload.Initialize(key);
5352
}else if(key.getStorageType()==6){
54-
ret = COSImageupload.Initialize(key);
53+
COSImageupload.Initialize(key);
5554
}else if(key.getStorageType()==7){
56-
ret = FtpServiceImpl.Initialize(key);
55+
FtpServiceImpl.Initialize(key);
5756
}else if(key.getStorageType()==8){
58-
ret = UFileImageupload.Initialize(key);
57+
UFileImageupload.Initialize(key);
5958
}
6059
}
6160
}

src/main/java/cn/hellohao/utils/ImgUrlUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public static Map<String,String> checkURLStatusCode(String urlStr){
104104
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
105105
//设置超时间为3秒
106106
conn.setConnectTimeout(5*1000);
107-
//防止屏蔽程序抓取而返回403错误
107+
//防止屏蔽程序抓取而返回403错误 Referer
108108
conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
109109

110110
//得到输入流

0 commit comments

Comments
 (0)