zoukankan      html  css  js  c++  java
  • 登录成功会返回登录前页面

     

    $.ajax({

              url: "login",

              type: "post",

              dataType: "json",

              async: false,

              data: {

                'phone': $('#phone').val(),

                'password': $('#password').val(),

              },

              successfunction (data) {

                if (data.code) {

                  $('#password').next().html(data.info);

                  return false;

                } else {

                  var forward = document.referrer;

                  if (forward == "" || forward == undefined || forward == null) {

                      location.href = "{:url('index/user/index')}";

                  } else {

                      location.href = "" + forward + "";

                  }

                  return false;

                }

    主要代码:

    var forward = document.referrer;

                  if (forward == "" || forward == undefined || forward == null) {

                      location.href = "{:url('index/user/index')}";

                  } else {

                      location.href = "" + forward + "";

                  }

     

    文章来源:刘俊涛的博客 欢迎关注公众号、留言、评论,一起学习。

     

    若有帮助到您,欢迎点击推荐,您的支持是对我坚持最好的肯定(*^_^*)

  • 相关阅读:
    磁盘
    磁盘接口
    Linux help websites
    [SOJ] 1282. Computer games (KMP)
    [SOJ]1753 解码
    hdu 3473 裸的划分树
    hdu 4417 划分树
    hdu 4665 搜索
    hdu 4340 树状DP
    hdu 4005 边连通度与缩点
  • 原文地址:https://www.cnblogs.com/lovebing/p/12543999.html
Copyright © 2011-2022 走看看