zoukankan      html  css  js  c++  java
  • 相信一定会帮上你

    public ActionResult Index()
    {
    return View();
    }

    public ActionResult About()
    {
    ViewBag.Message = "Your application description page.";

    return View();
    }

    public ActionResult Contact()
    {
    ViewBag.Message = "Your contact page.";

    return View();
    }。。。。。。。。

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8" />
    <title></title>
    <script src="Scripts/jquery-3.3.1.js"></script>
    </head>
    <body>
    <input type="button" onclick="get()" />
    <script>
    function get() {
    $.ajax({
    url: 'http://localhost:53035/api/Default/get',
    type: 'get',
    headers: {"BWAUTH":"dsafasdfasd"},
    dataType: 'json',
    success: function (data) {
    if (data.Code != 0) {
    alert(data.Msg);
    } else {
    alert(data.Data);
    }
    }
    });
    }
    </script>
    </body>
    </html>

    -------------------------------

    public string Login(UserInfo user)
    {
    string token = "";
    if (user.Name == "Admin" && user.Pass == "1234")
    {
    JWTHelper helper = new JWTHelper();
    Dictionary<string, object> playload = new Dictionary<string, object>();
    playload.Add("Name", user.Name);
    playload.Add("Id", user.Id);
    token =helper.GetToken(playload, 1200);
    }
    return token;
    }

    -----

  • 相关阅读:
    归并排序
    mysql 基本查询
    APP版本升级
    top命令详解
    iptables原理详解
    Linux--iptables常用命令
    iptables语法常用命令总结(表格)
    iptables原理--图示理解
    GIT的Windows客户端使用
    Linux下GIT服务器端和客户端搭建
  • 原文地址:https://www.cnblogs.com/gc1229/p/13341200.html
Copyright © 2011-2022 走看看