wbc
2025-05-30 1167bba23716eeda7ad6342b8d6ca736adca16c6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using System.Collections.Generic;
using System.Dynamic;
using Microsoft.AspNetCore.Mvc;
using MES.Service.service;
using MES.Service.Dto.webApi;
using MES.Service.util;
 
namespace MESApplication.Controllers
{
    [ApiController]
    [Route("api/[controller]")]
    public class UserController : ControllerBase
    {
        private readonly SysUserService _sysUserService = new SysUserService();
 
        /// <summary>
        /// 查询权限
        /// </summary>
        /// <param name="userno">用户Id</param>
        /// <returns>权限信息</returns>
        [HttpPost("queryPurview")]
        public ResponseResult QueryPurview([FromQuery] string userno)
        {
            try
            {
                List<Dictionary<string, object>> userForBase = _sysUserService.QueryPurview(userno);
 
                if (userForBase.Count == 0)
                {
                    return new ResponseResult
                    {
                        status = 1,
                        message = "权限不存在!"
                    };
                }
                else
                {
                    dynamic resultInfos = new ExpandoObject();
                    resultInfos.tbBillList = userForBase;
 
                    return new ResponseResult
                    {
                        status = 0,
                        message = "查询权限成功!",
                        data = resultInfos
                    };
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                return new ResponseResult
                {
                    status = 1,
                    message = "查询权限失败!"
                };
            }
        }
    }
}