session

package
v0.0.0-...-d050cfb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Sessions = &sync.Map{}
View Source
var UsersList = make([]*User, 0)
View Source
var UsersMap = &sync.Map{}

Functions

func GetUserInfo

func GetUserInfo(c echo.Context) error

func Login

func Login(c echo.Context) error

func LoginMock

func LoginMock(c echo.Context) error

func Logout

func Logout(c echo.Context) error

Types

type Session

type Session struct {
	User       *UserInfo
	CreateTime time.Time
}

type TokenInfo

type TokenInfo struct {
	Code int `json:"code"`
	Data struct {
		SubTokenObj struct {
			Message     string `json:"message"`
			SsoToken    string `json:"ssoToken"`
			Status      int    `json:"status"`
			UserSession struct {
				OaSession struct {
					Dept   string `json:"fdDept"`
					Email  string `json:"fdEmail"`
					Mobile string `json:"fdMobileNo"`
				}
				Facility        string `json:"facility"`
				HeadImgUrl      string `json:"headImgUrl"`
				SysDepartmentId string `json:"sysDepartmentId"`
				UserId          string `json:"userId"`
				UserName        string `json:"userName"`
				UserType        string `json:"userType"`
			} `json:"userSession"`
		} `json:"subTokenObj"`
	} `json:"data"`
	Message string `json:"message"`
}

subToken认证,返回的用户信息

type ToneUserRes

type ToneUserRes struct {
	Data map[string]string `json:"data"`
}

type User

type User struct {
	ID            string `json:"id"`
	Name          string `json:"name"`
	Mobile        string `json:"mobile"`
	Email         string `json:"email"`
	Priv          string `json:"priv"`
	LastLoginDate string `json:"last_login_date"`
	LoginCount    int    `json:"login_count"`
}

type UserInfo

type UserInfo struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Avatar   string `json:"avatar"`
	Email    string `json:"email"`
	Mobile   string `json:"mobile"`
	Priv     string `json:"priv"`
	SsoToken string `json:"ssoToken"`
}

func GetLoginInfo

func GetLoginInfo(c echo.Context) *UserInfo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL