1,在properties配置项目路径和端口
ip=127.0.0.1
port=8081
2,在resource下创建temp文件夹
3,base64和图片互转工具类****
package com.njinst.fineweatherservice.util;
import org.apache.commons.lang.StringUtils;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
//java项目www.1b23.com
public class Base64Utils {
public static void main(String[] args) throws Exception {
//本地图片地址
String url = "C:/Users/Administrator/Desktop/628947887489084892.jpg";
//在线图片地址
String string = "http://bpic.588ku.com//element_origin_min_pic/17/03/03/7bf4480888f35addcf2ce942701c728a.jpg";
String str = Base64Utils.ImageToBase64ByLocal(url);
String ste = Base64Utils.ImageToBase64ByOnline(string);
System.out.println(str);
Base64Utils.Base64ToImage(str, "C:/Users/Admini