40 lines
874 B
C#
40 lines
874 B
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Net;
|
|||
|
|
using System.Net.Http;
|
|||
|
|
using System.Web.Helpers;
|
|||
|
|
using System.Web.Http;
|
|||
|
|
using System.Xml.Linq;
|
|||
|
|
|
|||
|
|
namespace MQTTServerSideAPI.Controllers
|
|||
|
|
{
|
|||
|
|
public class LoginController : ApiController
|
|||
|
|
{
|
|||
|
|
[HttpPost]
|
|||
|
|
public bool Login([FromBody] loginuser name)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
//user list = SqlSugarDBHelp.authoriydb.Queryable<user>().First(x => x.password == name.password && x.user_name == name.user_name);
|
|||
|
|
|
|||
|
|
int count= SQLiteDBHelper.Loning(name);
|
|||
|
|
if (count>0)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
public class loginuser
|
|||
|
|
{
|
|||
|
|
public string password { get; set; }
|
|||
|
|
public string user_name { get; set; }
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|