Blame view

sys/Hh.Mes.Service/SystemAuth/Interface/IAuth.cs 1.07 KB
高翔 authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 *单独提取这个接口,为了以下几点:
 * 1、可以方便的实现webapi 和本地登录相互切换
 * 2、可以方便的使用mock进行单元测试
 */
using System.Collections.Generic;


namespace Hh.Mes.Service.SystemAuth
{
    public interface IAuth
    {
        /// <summary>
        /// 检验token是否有效
        /// </summary>
        /// <param name="token">token</param>
        /// <returns></returns>
        bool CheckLogin(string token="");
        AuthStrategyContext GetCurrentUser();
        List<string> GetUserAccountName();
        List<string> GetUserAccountName(string username);
        /// <summary>
        /// 登录接口
        /// </summary>
        /// <param name="appKey">登录的应用appkey</param>
        /// <param name="username">用户名</param>
        /// <param name="pwd">密码</param>
        /// <returns></returns>
        LoginResult Login(string appKey, string username, string pwd);
        /// <summary>
        /// 退出登录
        /// </summary>
        /// <returns></returns>
        bool Logout();
    }
}