【.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("系统未知错误,请重新登录");
    }

});
相关推荐
刚子编程21 小时前
ASP.NET Core Blazor 路由配置和导航
服务器·javascript·.netcore·blazor
忧郁的蛋~3 天前
.NET实现多任务异步与并行处理的详细步骤
后端·c#·asp.net·.net·.netcore
时光追逐者4 天前
C#/.NET/.NET Core技术前沿周刊 | 第 58 期(2025年10.13-10.19)
微软·开源·c#·.net·.netcore
weixin_3798809214 天前
.Net Core WebApi集成Swagger
java·服务器·.netcore
The Future is mine16 天前
.Net Core 在Linux系统下创建服务
linux·运维·.netcore
*长铗归来*17 天前
ASP.NET Core Web API 中控制器操作的返回类型及Swagger
后端·c#·asp.net·.netcore
IDOlaoluo17 天前
VS2017 安装 .NET Core 2.2 SDK 教程(包括 dotnet-sdk-2.2.108-win-x64.exe 安装步骤)
.netcore
csdn_aspnet25 天前
使用 Entity Framework Code First 方法创建 ASP.NET Core 5.0 Web API
.netcore·webapi
小先生81225 天前
.NET Core项目中 Serilog日志文件配置
c#·.netcore
爱吃香蕉的阿豪25 天前
.NET Core 中 System.Text.Json 与 Newtonsoft.Json 深度对比:用法、性能与场景选型
数据库·json·.netcore