向后台发Json格式参数
$.ajax({
type: “post”,
url: url,
data:JSON.stringify(data),
contentType: “application/json”,
success: function(res) {
if (res.code == 100200) {
//SetCookie(‘userId’,log.redisUserInfo.userId);
mui.alert(‘注册成功’, function() {
window.location.href = “login.html”
})
} else if(res.code == 700001){
mui.toast(‘验证码已过期’)
}else if(res.code == 700002){
mui.toast(‘验证码错误’)
}
}
});