优化代码

This commit is contained in:
橙子
2021-10-26 00:59:06 +08:00
parent adeb2ead7e
commit b29b6be734
10 changed files with 80 additions and 20 deletions

View File

@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
@@ -109,6 +110,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
/// <param name="pwdDto"></param>
/// <returns></returns>
[HttpPut]
[Authorize]
public async Task<Result> ChangePassword(ChangePwdDto pwdDto)
{
var uid= pwdDto.user.id;

View File

@@ -14,6 +14,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
{
[Route("api/[controller]/[action]")]
[ApiController]
[Authorize]
public class MenuController : ControllerBase
{
private IMenuService _menuService;

View File

@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
@@ -12,6 +13,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
{
[Route("api/[controller]/[action]")]
[ApiController]
[Authorize]
public class MouldController : ControllerBase
{
private IMouldService _mouldService;

View File

@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
@@ -13,6 +14,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
{
[Route("api/[controller]/[action]")]
[ApiController]
[Authorize]
public class RoleController : ControllerBase
{
private IRoleService _roleService;

View File

@@ -15,6 +15,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
{
[ApiController]
[Route("api/[controller]/[action]")]
[Authorize]
public class UserController : ControllerBase
{
private readonly ILogger<UserController> _logger;
@@ -122,7 +123,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
/// 根据http上下文的用户得到该用户信息关联角色
/// </summary>
/// <returns></returns>
[Authorize]
[HttpGet]
public async Task<Result> GetUserInfoById()
{