【.net core】【watercloud】登陆后跳转至指定页面,显示在系统框架页内

WaterCloud.Web\Views\Login\Index.cshtml文件内,214行左右

javascript 复制代码
$.ajax({
    url: "/Login/CheckLogin?v=" + new Date().Format("yyyy-MM-dd hh:mm:ss"),
    data: { username: $.trim($('#username').val()), localurl: $('#wchost').val(), password: $.md5($.trim($('#password').val())) },
    type: "post",
    dataType: "json",
    success: function (data) {
        console.log('success',data)
        if (data.state == "success") {
            $("#login_button").empty();
            $("#login_button").html("登录成功,正在跳转...");
            var realurl = $.cookie('wc_realreturnurl');
            if (realurl != null) {
                console.log('realurl != null', realurl)
                //原文件内容
                //window.location.href =  realurl;
                //修改内容
                window.location.href = '@Url.Content("~/Home/Index")' + "#/" +  realurl;
                $.cookie('wc_realreturnurl', '', { path: "/", expires: -1 });
                $.cookie('wc_returnurl', '', { path: "/", expires: -1 });
            }
            else {
                console.log('realurl == null', realurl)
                var url = $.cookie('wc_returnurl');
                if (url != null) {
                    console.log('url != null', url)
                    window.location.href = '@Url.Content("~/Home/Index")' + "#/" + url;
                    $.cookie('wc_returnurl', '', { path: "/", expires: -1 });
                }
                else {
                    console.log('url == null', url)
                    window.location.href = '@Url.Content("~/Home/Index")';
                }
            }
        } else {
            $("#login_button").empty();
            $("#login_button").removeAttr('disabled').html("登 入");
            draw(show_num);
            layer.msg(data.message);
            $.login.formMessage(data.message);
        }
    },
    error: function (res) {
        $("#login_button").empty();
        $("#login_button").removeAttr('disabled').html("登 入");
        draw(show_num);
        layer.msg("系统未知错误,请重新登录");
        $.login.formMessage("系统未知错误,请重新登录");
    }

});
相关推荐
csdn_aspnet19 小时前
.NetCore Webapi 接口验证请求来源
.netcore·ip·token·签名·webapi·cors·sign
宝桥南山4 天前
Microsoft Fabric - 简单尝试一下Microsoft Fabric .NET SDK
microsoft·微软·.net·.netcore·powerbi·fabric
geovindu5 天前
CSharp:Condition Variable Pattern
后端·设计模式·c#·.net·.netcore·条件变量模式·同步型模式
geovindu9 天前
CSharp: Observer Pattern
开发语言·后端·观察者模式·设计模式·c#·.netcore·行为模式
geovindu10 天前
CSharp: Strategy Pattern
开发语言·后端·c#·.net·.netcore·策略模式·行为模式
geovindu10 天前
CSharp: Task Scheduler
开发语言·后端·c#·.net·.netcore
geovindu16 天前
CSharp: Wordcloud
开发语言·后端·c#·.net·.netcore·词云
geovindu16 天前
CSharp: Command Pattern
开发语言·后端·c#·.net·.netcore·命令模式·行为模式
全栈小524 天前
【C#】.net core,静态方法线程安全解析,面试时经常被问的线程安全就藏在里面
安全·c#·.netcore
清风与日月1 个月前
Yitter.IdGenerator:高性能分布式唯一ID生成器详解
分布式·c#·.net·.netcore