|
@ -1,5 +1,6 @@
|
1
|
1
|
package io.renren.modules.app.controller;
|
2
|
2
|
|
|
3
|
import java.util.Date;
|
3
|
4
|
import io.renren.common.utils.R;
|
4
|
5
|
import io.swagger.annotations.Api;
|
5
|
6
|
import io.swagger.annotations.ApiOperation;
|
|
@ -53,13 +54,14 @@ public class QRCodeTest {
|
53
|
54
|
|
54
|
55
|
@GetMapping("qcodetesturl")
|
55
|
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
|
60
|
try{
|
59
|
|
qRCodeUtils.encode(text, img);
|
60
|
|
return R.ok().put("img", img);
|
|
61
|
imgurl = qRCodeUtils.encode(text, imgpath);
|
61
|
62
|
}catch(Exception e){
|
62
|
63
|
e.printStackTrace();
|
63
|
64
|
}
|
|
65
|
return R.ok().put("imgurl", imgurl);
|
64
|
66
|
}
|
65
|
67
|
}
|