root vor 5 Jahren
Ursprung
Commit
25bc8b283d
1 geänderte Dateien mit 6 neuen und 4 gelöschten Zeilen
  1. 6 4
      src/main/java/io/renren/modules/app/controller/QRCodeTest.java

+ 6 - 4
src/main/java/io/renren/modules/app/controller/QRCodeTest.java

1
package io.renren.modules.app.controller;
1
package io.renren.modules.app.controller;
2
2
3
import java.util.Date;
3
import io.renren.common.utils.R;
4
import io.renren.common.utils.R;
4
import io.swagger.annotations.Api;
5
import io.swagger.annotations.Api;
5
import io.swagger.annotations.ApiOperation;
6
import io.swagger.annotations.ApiOperation;
53
54
54
	@GetMapping("qcodetesturl")
55
	@GetMapping("qcodetesturl")
55
    @ApiOperation("获取二维码图片地址")
56
    @ApiOperation("获取二维码图片地址")
56
    public void  getCodeImgUrl(String text)throws IOException {
57
		String img = (new Date().getTime()).toString();
57
    public R  getCodeImgUrl(String text)throws IOException {
58
		String imgpath = "/home/qcodetest/";
59
		String imgurl = "";
58
		try{
60
		try{
59
			qRCodeUtils.encode(text, img);
60
			return R.ok().put("img", img);
61
			imgurl = qRCodeUtils.encode(text, imgpath);
61
		}catch(Exception e){
62
		}catch(Exception e){
62
			e.printStackTrace();
63
			e.printStackTrace();
63
		}
64
		}
65
		return R.ok().put("imgurl", imgurl);
64
    }
66
    }
65
}
67
}