• Ajax登录


    @{
        Layout = null;
    }
    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <title>平天下科技有限公司 -协同办公管理系统</title>
        <link href="~/Script/css/login.css" rel="stylesheet" />
    </head>
    <body>
        <div id="login">
            <div class="logo"></div>
            <div class="login_box">
                <input class="admin" type="text" />
                <input class="passWord" type="password" />
                <input class="submit" type="button" />
                <div class="clear"></div>
            </div>
        </div>
        <div id="copyright">技术支持:八维物联网1605D</div>
        <script src="~/Script/layui/layui.js"></script>
        <script>
            layui.use(['layer', 'jquery'], function () {
                var layer = layui.layer,
                    $ = layui.jquery;
                $(".submit").click(function () {
                    var _name = $(".admin").val();
                    var _pwd = $(".passWord").val();
                    if (_name == "" || _name == undefined)
                    {
                        layer.tips('请输入账号', '.admin', {
                            tips: [3, 'red'],
                            time: 2000
                        });
                        return false;
                    }
                    $.ajax({
                        url: "/Login/Logins",
                        type: "get",
                        data: { name: _name, pwd: _pwd },
                        success: function (data) {
                            if (data == "True") {
                                layer.msg('登录成功!', { icon: 1 })
                                location.href = "/Home/Index"
                            }
                            else {
                                layer.msg('登录失败!用户名或密码输入错误,请重新输入', { icon: 2 })
                            }
                        }
                    });
                });
            })
        </script>
    </body>
    </html>
    public ActionResult Index()
            {
                return View();
            }
            /// <summary>
            /// 用户登录
            /// </summary>
            /// <param name="name"></param>
            /// <param name="pwd"></param>
            /// <returns></returns>
            public bool Logins(string name,string pwd)
            {
                var t = bll.Exist(m => m.AccountName == name && m.AccountPassword == pwd);
                return t;
            }
  • 相关阅读:
    循环神经网络(RNN)的改进——长短期记忆LSTM
    AlphaGO的背后/《mastering the game of GO wtth deep neural networks and tree search》研究解读
    <科普>CPU进行四则运算(加减乘除)的主流方法
    在CV尤其是CNN领域的一些想法
    只要听说过电脑的人都能看懂的网上pdf全书获取项目
    python简单爬虫(爬取pornhub特定关键词的items图片集)
    并查集模板
    Linux命令学习-cp命令
    Linux命令学习-mv命令
    Linux命令学习-ls命令
  • 原文地址:https://www.cnblogs.com/huosanpie/p/10153621.html
Copyright © 2020-2023  润新知