mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-11-09 02:44:44 +08:00
调整了一下项目框架与前端JS代码
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
using System;
|
||||
using OpenAuth.Domain.Interface;
|
||||
using OpenAuth.Domain.Model;
|
||||
namespace OpenAuth.Domain.Service
|
||||
{
|
||||
public class LoginService
|
||||
{
|
||||
private IUserRepository _userRepository;
|
||||
public LoginService(IUserRepository repository)
|
||||
{
|
||||
_userRepository = repository;
|
||||
}
|
||||
public User Login(string username, string password)
|
||||
{
|
||||
var user = _userRepository.FindByAccount(username);
|
||||
if (user == null)
|
||||
{
|
||||
throw new Exception("用户名不存在");
|
||||
}
|
||||
if (!user.Password.Equals(password))
|
||||
{
|
||||
throw new Exception("密码错误");
|
||||
}
|
||||
if (!user.Enabled)
|
||||
{
|
||||
throw new Exception("该用户被禁用");
|
||||
}
|
||||
return user;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenAuth.Domain.Interface;
|
||||
using OpenAuth.Domain.Model;
|
||||
|
||||
namespace OpenAuth.Domain.Service
|
||||
{
|
||||
public class MenuService
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user