Dragon_dance_
Dragon_dance_
采纳率100%
2020-05-18 22:50 阅读 113
已采纳

关于账号注册的异常?

$("#doReg").click(function(){

      var floginacct = $("#floginacct");
      var fuserpswd = $("#fuserpswd");
      var fusername = $("#fusername");
      var femail = $("#femail");
      var fusertype = $("#fusertype");       

      var loadingIndex = -1;            
      $.ajax({
          type : "POST",
          data : {
              "loginacct" : floginacct.val(),
              "userpswd" : fuserpswd.val(),
              "username" : fusername.val(),
              "email" : femail.val(),
              "usertype" : fusertype.val()
          },
          url : "${APP_PATH }/doReg.do",
          beforeSend : function(){
              loadingIndex = layer.msg('处理中', {icon: 16});
              return true;
          },
          success : function(result){
              layer.close(loadingIndex);
              if(result.success){
                  window.location.href="${APP_PATH}/member/member"                                                                                
              }else{
                  layer.msg("注册失败!", {time:1000, icon:5, shift:6});
              }
          },
          error : function(){
              layer.msg("系统错误!", {time:1000, icon:5, shift:6});
          }         
      });
    })  这是jsp写的ajax请求

@ResponseBody
@RequestMapping("/doReg")
public Object doReg(String loginacct,String userpswd,String username,
String email,String usertype,HttpSession session) {

    AjaxResult result = new AjaxResult();

    try {

        Map<String,Object> paramMap = new HashMap<String,Object>();
        paramMap.put("loginacct", loginacct);
        paramMap.put("userpswd", MD5Util.digest(userpswd));
        paramMap.put("username", username);
        paramMap.put("email", email);
        paramMap.put("usertype", usertype);

        memberService.saveMember(paramMap); 
        result.setSuccess(true);

    } catch (Exception e) {     
        e.printStackTrace();
        result.setSuccess(false);           
    }       
    return result;
}  这是controller里面的

insert into t_member (id, loginacct, userpswd, 
  username, email,usertype,authstatus)
values (#{id},#{loginacct},#{userpswd},#{username},#{email},#{usertype},0)  这是XML的语句,问题出现在在界面输入后点注册返回false···想着是流程出错···但实在找不到,求助ing

Request URL: http://localhost:8080/Atcrowdfunding-main/doReg.do
Request Method: POST
Status Code: 302
Remote Address: [::1]:8080
Referrer Policy: no-referrer-when-downgrade 这是网页f12后的header信息

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    weixin_45341366 _知道者丶 2020-05-19 09:40

    打个debug走看那一行报错,再根据那报错的一行分析错误所在。

    点赞 评论 复制链接分享

相关推荐