12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using Cksoft.Data;
- using Cksoft.Data.Repository;
- using Cksoft.Unity;
- using Cksoft.Unity.Log4NetConfig;
- using DllUfpDal;
- using DllUfpEntity;
- using Microsoft.AspNetCore.Authorization;
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.Extensions.Configuration;
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace WebApplet.Controllers
- {
- [Route("eap/api/[controller]/[action]")]
- public class StaffController : ControllerBase
- {
- [HttpPost]
- public string Login([FromBody] Staff staff)
- {
- using (IDatabase db = DbFactory.Base("ufp"))
- {
- var dal = new StaffDal(db);
- string errorinfo = string.Empty;
- staff = dal.Login(staff, ref errorinfo);
- if (staff == null)
- return JsonConvert.SerializeObject(new
- {
- code = -1,
- msg = errorinfo,
- data = new Staff()
- });
- return JsonConvert.SerializeObject(new
- {
- code = 1,
- msg = "",
- data = new Staff()
- {
- FCode = staff.FCode,
- FName = staff.FName,
- FStatus = staff.FStatus,
- Remark = staff.Remark,
- ModTime = staff.ModTime,
- RecTime = staff.RecTime,
- IsSA = staff.IsSA
- }
- });
- }
- }
- }
- }
|