【.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_aspnet2 天前
使用 Entity Framework Code First 方法创建 ASP.NET Core 5.0 Web API
.netcore·webapi
小先生8122 天前
.NET Core项目中 Serilog日志文件配置
c#·.netcore
爱吃香蕉的阿豪2 天前
.NET Core 中 System.Text.Json 与 Newtonsoft.Json 深度对比:用法、性能与场景选型
数据库·json·.netcore
csdn_aspnet2 天前
ASP.NET Core 10.0 的主要变化
.netcore
csdn_aspnet6 天前
在 C# .NETCore 中使用 MongoDB(第 1 部分):驱动程序基础知识和插入文档
mongodb·.netcore
csdn_aspnet6 天前
在 C# .NETCore 中使用 MongoDB(第 3 部分):跳过、排序、限制和投影
mongodb·c#·.netcore
csdn_aspnet7 天前
在 C# .NETCore 中使用 MongoDB(第 2 部分):使用过滤子句检索文档
mongodb·c#·.netcore
csdn_aspnet10 天前
.NET Core 中 RabbitMQ 和 MassTransit 的使用
rabbitmq·.netcore·masstransit
csdn_aspnet20 天前
MongoDB C# .NetCore 驱动程序 序列化忽略属性
mongodb·c#·.netcore
Tiger_shl21 天前
【.Net技术栈梳理】08-控制反转(IoC)与依赖注入(DI)
开发语言·.net·.netcore