李昊 4 anos atrás
pai
commit
e504840521

+ 5 - 3
gx_api/GxPress/Api/GxPress.Api/WebControllers/PayController.cs

@@ -57,10 +57,11 @@ namespace GxPress.Api.WebControllers
                 _context.Response.StatusCode = LoginCodeConst.UnLogin.GetHashCode();
             else
             {
-                var attach = string.Empty;
+
                 decimal price = 0;
                 var title = string.Empty;
                 var antoNumber = DateTime.Now.Ticks.ToString();
+                var attach = antoNumber;
                 if (request.MediaId > 0 || request.VipType > 0)
                 {
                     //商品
@@ -90,7 +91,7 @@ namespace GxPress.Api.WebControllers
                         var orderId = await orderRepository.InsertAsync(order);
                         if (orderId <= 0)
                             throw new BusinessException("服务器异常");
-
+                        title = media.Title;
                     }
                     //权益
                     if (request.VipType > 0)
@@ -112,7 +113,7 @@ namespace GxPress.Api.WebControllers
                             MediaId = vipEquity.Id,
                             OrderNumber = antoNumber,
                             UserId = userId,
-                            Name = _loginContext.Name,
+                            Name = "",
                             Explain = vipTypeConst.GetDescriptionOriginal(),
                             Price = price,
                             IsSuccess = false
@@ -120,6 +121,7 @@ namespace GxPress.Api.WebControllers
                         var orderId = await orderRepository.InsertAsync(order);
                         if (orderId <= 0)
                             throw new BusinessException("服务器异常");
+                        title = vipTypeConst.GetDescriptionOriginal();
                     }
                     //支付宝
                     if (request.PayWayType == PayWayTypeConst.AliyPay.GetHashCode())

+ 2 - 1
gx_api/GxPress/Api/GxPress.Api/WebControllers/UserController.cs

@@ -73,7 +73,8 @@ namespace GxPress.Api.WebControllers
             var claims = new[]
             {
                 new Claim(ClaimTypes.NameIdentifier, result.UserId.ToString()),
-                new Claim(ClaimTypes.Role, AccountTypeConst.User.ToString())
+                new Claim(ClaimTypes.Role, AccountTypeConst.User.ToString()),
+                new Claim(ClaimTypes.Actor, result.User.Name.ToString())
             };
             result.Token = TokenHelper.BuildToken(_jwtOptions, claims);
             return result;