更新网页接口
更新接口
This commit is contained in:
@@ -17,6 +17,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.Base64;
|
||||
@@ -374,7 +375,18 @@ public class Tools {
|
||||
}
|
||||
public static String base64ToString(String base){
|
||||
base=base.replace(" ","+");
|
||||
return new String(Base64.getDecoder().decode(base.replace("\r\n","").getBytes()));
|
||||
try {
|
||||
base=new String(Base64.getDecoder().decode(base.replace("\r\n","").getBytes()));
|
||||
}catch (Exception e){
|
||||
try {
|
||||
base=URLDecoder.decode(base,"UTF-8");
|
||||
base=base.replace(" ","+");
|
||||
base=new String(Base64.getDecoder().decode(base.replace("\r\n","").getBytes()));
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
return base;
|
||||
}
|
||||
/**
|
||||
* 异常输出
|
||||
|
||||
Reference in New Issue
Block a user