Exemplo n.º 1
0
 public DataResponse <List <ColumnsShowData> > ColumnsShows([FromBody] SignatureRequest request)
 {
     if (request == null)
     {
         return(ResponseBase.InvalidInput <DataResponse <List <ColumnsShowData> > >("参数错误"));
     }
     try {
         if (!request.IsValid(HostRoot.Instance.UserSet.GetUser, ClientIp, out DataResponse <List <ColumnsShowData> > response))
         {
             return(response);
         }
         var data = HostRoot.Instance.ColumnsShowSet.GetAll();
         return(DataResponse <List <ColumnsShowData> > .Ok(data));
     }
     catch (Exception e) {
         Logger.ErrorDebugLine(e);
         return(ResponseBase.ServerError <DataResponse <List <ColumnsShowData> > >(e.Message));
     }
 }
Exemplo n.º 2
0
 public ResponseBase LoginControlCenter([FromBody] SignatureRequest request)
 {
     if (request == null)
     {
         return(ResponseBase.InvalidInput("参数错误"));
     }
     try {
         Logger.InfoDebugLine($"{request.LoginName} {request.Sign} {request.Timestamp}");
         if (!request.IsValid(HostRoot.Instance.UserSet.GetUser, ClientIp, out IUser user, out ResponseBase response))
         {
             return(response);
         }
         Logger.InfoDebugLine($"{request.LoginName}登录成功");
         return(ResponseBase.Ok());
     }
     catch (Exception e) {
         Logger.ErrorDebugLine(e);
         return(ResponseBase.ServerError(e.Message));
     }
 }