Skip to content

Commit

Permalink
🚀删除部分无用代码
Browse files Browse the repository at this point in the history
  • Loading branch information
hello-hao authored and hello-hao committed Mar 10, 2023
1 parent f8a712e commit 538482a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class InitializationStorage implements CommandLineRunner {
private KeysMapper keysMapper;

@Override
public void run(String... args) throws Exception {
public void run(String... args) {
SubjectFilter.WEBHOST = allowedOrigins;
String name = ManagementFactory.getRuntimeMXBean().getName();
String pid = name.split("@")[0];
Expand All @@ -41,21 +41,20 @@ public void intiStorage(){
List<Keys> keylist = keysMapper.getKeys();
for (Keys key : keylist) {
if(key.getStorageType()!=0 && key.getStorageType()!=null){
int ret =0;
if(key.getStorageType()==1){
ret =NOSImageupload.Initialize(key);
NOSImageupload.Initialize(key);
}else if (key.getStorageType()==2){
ret =OSSImageupload.Initialize(key);
OSSImageupload.Initialize(key);
}else if(key.getStorageType()==3){
ret = USSImageupload.Initialize(key);
USSImageupload.Initialize(key);
}else if(key.getStorageType()==4){
ret = KODOImageupload.Initialize(key);
KODOImageupload.Initialize(key);
}else if(key.getStorageType()==6){
ret = COSImageupload.Initialize(key);
COSImageupload.Initialize(key);
}else if(key.getStorageType()==7){
ret = FtpServiceImpl.Initialize(key);
FtpServiceImpl.Initialize(key);
}else if(key.getStorageType()==8){
ret = UFileImageupload.Initialize(key);
UFileImageupload.Initialize(key);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/hellohao/utils/ImgUrlUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static Map<String,String> checkURLStatusCode(String urlStr){
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
//设置超时间为3秒
conn.setConnectTimeout(5*1000);
//防止屏蔽程序抓取而返回403错误
//防止屏蔽程序抓取而返回403错误 Referer
conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");

//得到输入流
Expand Down

0 comments on commit 538482a

Please sign in to comment.