验证码
<input type="text"
<input type='text' placholder="请输入验证码" > <img :src="capurl" @click="getphoto">
js
jquery:
$(function() {
$("#img").attr('src', '/ddd/ddd/ddd/image?t=' +new Date().getTime()).bind('click',function(){
$(this).attr('src', '/ddd/ddd/ddd/image?t=' +new Date().getTime())
}
let login = (params) => {
$post('/ddd/ddd/ddd/', params,(data)=》{
if(!data|| !data.code) {
$.error('登录出错,请重新登录')
return;
}
if(data.code = 'error'){
$.warn(data.msg);
$('#img').click();
return;
}
if(data.code === 'success'){
if(!data.data){
data.data='params/index.html'
}
$redirect(data.data)
}
});
}
let check = () => {
let name = name;
let password = password;
let new = md5(password+MDTSTR);
let kaptch = kaptch;
if($.isnull(name) || $.isnull(password)){
$.error('请填写完整登录信息');
return;
}
}
}
标签:code,登录,let,password,data,ddd
From: https://www.cnblogs.com/baozhengrui/p/16638234.html