註解 mybase 測試帳號

This commit is contained in:
GiteaAdmin 2023-02-06 10:22:48 +08:00
parent 125b24f6d5
commit addc1ac851

View File

@ -58,39 +58,39 @@ namespace FrontendWebApi.ApiControllers
userinfo_guid = User.Claims.Where(a => a.Type == "userinfo_guid").Select(e => e.Value).FirstOrDefault(), userinfo_guid = User.Claims.Where(a => a.Type == "userinfo_guid").Select(e => e.Value).FirstOrDefault(),
}; };
//if (myUser.exp == 0) if (myUser.exp == 0)
//{ {
// jwt_str = "Jwt Token不合法"; jwt_str = "Jwt Token不合法";
// jwtlife = false; jwtlife = false;
// filterContext.Result = new JsonResult(new { HttpStatusCode.Unauthorized }); filterContext.Result = new JsonResult(new { HttpStatusCode.Unauthorized });
//} }
//else else
//{ {
// if (myUser.exp <= DateTime.Now.AddHours(-8).AddMinutes(10).Subtract(new DateTime(1970, 1, 1)).TotalSeconds)
// {
// jwtlife = true;
// JwtLogin jwtLoing = new JwtLogin()
// {
// account = myUser.account,
// email = myUser.email,
// full_name = myUser.full_name,
// userinfo_guid = myUser.userinfo_guid
// };
// jwt_str = jwt.GenerateToken(jwtLoing).token;
// }
//}
if (myUser.exp <= DateTime.Now.AddHours(-8).AddMinutes(10).Subtract(new DateTime(1970, 1, 1)).TotalSeconds) if (myUser.exp <= DateTime.Now.AddHours(-8).AddMinutes(10).Subtract(new DateTime(1970, 1, 1)).TotalSeconds)
{ {
jwtlife = true; jwtlife = true;
JwtLogin jwtLoing = new JwtLogin() JwtLogin jwtLoing = new JwtLogin()
{ {
account ="webUser", account = myUser.account,
email = "webUser@gmail.com", email = myUser.email,
full_name = "webUser", full_name = myUser.full_name,
userinfo_guid = "6ac24708-3a40-4199-88c5-22df310cd1a8" userinfo_guid = myUser.userinfo_guid
}; };
jwt_str = jwt.GenerateToken(jwtLoing).token; jwt_str = jwt.GenerateToken(jwtLoing).token;
} }
}
//if (myUser.exp <= DateTime.Now.AddHours(-8).AddMinutes(10).Subtract(new DateTime(1970, 1, 1)).TotalSeconds)
//{
// jwtlife = true;
// JwtLogin jwtLoing = new JwtLogin()
// {
// account ="webUser",
// email = "webUser@gmail.com",
// full_name = "webUser",
// userinfo_guid = "6ac24708-3a40-4199-88c5-22df310cd1a8"
// };
// jwt_str = jwt.GenerateToken(jwtLoing).token;
//}
base.OnActionExecuting(filterContext); base.OnActionExecuting(filterContext);
} }
} }