直接撸代码:
1.html
2.js 点击更换一张 生成一个独一无二的codeId
$scope.changeImg=function(){
$scope.user.codeId = ( new Date() ).valueOf();
};
3.controller
@Controller
@RequestMapping(value = "/api/cloud/vercode")
public class VerCodeController {
@Autowired
private SequenceService sequenceService;
@Autowired
private UserCodeService userCodeService;
private int width = 100;//定义图片的width
private int height = 32;//定义图片的height
private int codeCount = 4;//定义图片上显示验证码的个数
private int xx = 22;
private int fontHeight = 25;
private int codeY = 26;
char[] codeSequence = { 'A', 'B', 'C', 'D', 'E', 'F', '