初始化
This commit is contained in:
39
MQTTServerSideAPI/Controllers/LoginController.cs
Normal file
39
MQTTServerSideAPI/Controllers/LoginController.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user