target/classes/public/js/index.js

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

layui.use(['form','jquery','jquery_cookie'], function () {
    var form = layui.form,
        layer = layui.layer,
        $ = layui.jquery,
        $ = layui.jquery_cookie($);


    // layui 用户登录 表单提交
    form.on('submit(login)',function (data) {
        // 获取表单元素 用户名+密码
        data = data.field;
        console.log(data);

        /**
         *  用户名 密码 非空校验
         */
        if(data.username=="undefined" || data.username=="" || data.username.trim()==""){
            layer.msg("用户名不能为空!");
            return false;
        }

        if(data.password=="undefined" || data.password=="" || data.password.trim()==""){
            layer.msg("用户密码不能为空!");
            return false;
        }

        /*
            发送请求,传递用户姓名与密码,执行用户登录操作
         */
        $.ajax({
            type:"post",
            url:ctx+"/user/login",
            data:{
                userName:data.username,
                userPwd:data.password
            },
            dataType:"json",
            success:function (data) {
                console.log(data);

                if(data.code==200){
                    layer.msg("用户登录成功",function () {
                        var result =data.result;
                        //判断用户是否选择记住密码
                        if($("input[type='checkbox']").is(":checked")){
                            $.cookie("userIdStr",result.userIdStr,{expires:7});
                            $.cookie("userName",result.userName,{expires:7});
                            $.cookie("trueName",result.trueName,{expires:7});
                        }else {
                            //将用户信息设置到Cookie中
                            $.cookie("userIdStr",result.userIdStr);
                            $.cookie("userName",result.userName);
                            $.cookie("trueName",result.trueName);
                        }
                        //跳转到首页
                        window.location.href=ctx+"/main";
                    })
                }else{
                    layer.msg(data.msg,{icon:5 });
                }
后面还有 8 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。