Commit a7565f31 authored by 黄奎's avatar 黄奎

新增配置

parent ab475454
using Microsoft.Extensions.Configuration;
using Aspose.Words.Lists;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Json;
using NPOI.OpenXmlFormats;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
......
......@@ -19,5 +19,10 @@
/// 用户验证信息
/// </summary>
public const string JWT_User_Key = "edu_userInfo";
/// <summary>
/// ERP用户TokenKey
/// </summary>
public const string JWT_ERP_User_Key = "userInfo";
}
}
......@@ -85,8 +85,8 @@ namespace Edu.WebApi.Controllers.User
groupId = model.Group_Id
};
string token = WebApiTokenHelper.CreateToken(eduUserInfo);
string erpToken = WebApiTokenHelper.CreateToken(erpUserInfo);
string token = WebApiTokenHelper.CreateToken(Common.GlobalKey.JWT_User_Key, eduUserInfo);
string erpToken = WebApiTokenHelper.CreateToken(Common.GlobalKey.JWT_ERP_User_Key, erpUserInfo);
var treeList = menuModule.GetTreeMenuModule(new Model.ViewModel.System.RB_Menu_ViewModel()
{
MenuType = accountType
......
......@@ -18,7 +18,7 @@ namespace Edu.WebApi.Helper
/// </summary>
/// <param name="requestFromEnum">来源</param>
/// <returns></returns>
public static string CreateToken(IUserInfoToken userInfo)
public static string CreateToken(string userKey, IUserInfoToken userInfo)
{
IDateTimeProvider provider = new UtcDateTimeProvider();
var now = provider.GetNow().AddMinutes(-1);
......@@ -28,7 +28,7 @@ namespace Edu.WebApi.Helper
{
{"iat",secondsSinceEpoch },
{"exp",secondsSinceEpoch+Common.Config.JwtExpirTime},
{Common.GlobalKey.JWT_User_Key,userInfo }
{userKey,userInfo }
};
IJwtAlgorithm algorithm = new HMACSHA256Algorithm();
IJsonSerializer serializer = new JsonNetSerializer();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment