src/SSCMS.Web/Controllers/Admin/Wx/UsersController.DeleteTag.cs

(完整代码) 1011B

using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using SSCMS.Core.Utils;
using SSCMS.Dto;

namespace SSCMS.Web.Controllers.Admin.Wx
{
    public partial class UsersController
    {
        [HttpPost, Route(RouteActionsDeleteTag)]
        public async Task<ActionResult<DeleteTagResult>> DeleteTag([FromBody] DeleteTagRequest request)
        {
            if (!await _authManager.HasSitePermissionsAsync(request.SiteId, MenuUtils.SitePermissions.WxUsers))
            {
                return Unauthorized();
            }

            List<WxUserTag> tags = null;

            var (success, token, _) = await _wxManager.GetAccessTokenAsync(request.SiteId);
            if (success)
            {
                await _wxManager.DeleteUserTag(token, request.TagId);
                tags = await _wxManager.GetUserTagsAsync(token);
            }

            return new DeleteTagResult
            {
                Tags = tags
            };
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。