// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification // for details on configuring this project to bundle and minify static web assets. // Write your JavaScript code. var myJs = {}; myJs.get = function (url, data, success, error) { $.ajax({ url: url, type: "get", data: data, success: function (d) { success(d); }, error: function (d) { error(d.status, d.responseJSON.Id, d.responseJSON.Message) }, }); } myJs.post = function (url, data, success, error) { $.ajax({ url: url, type: "post", data: data, success: function (d) { success(d); }, error: function (d) { error(d.status, d.responseJSON.Id, d.responseJSON.Message) }, }); } myJs.msg = function (msg) { alert(msg); } //保存用户凭据的键,在_layout视图设置 myJs.userKey = ""; //获取登录的用户票据 myJs.getTicket = function () { return $.cookie(myJs.userKey); } //移除用户登录票据 myJs.removeTicket = function () { $.removeCookie(myJs.userKey); }