|
|
- package user
-
- import (
- "testing"
- )
-
- func Test_GetUserByToken(t *testing.T) {
- dbname := "dev_tetele_net"
- token := "5536827c-36a5-4ec7-946d-49e4380c5103"
- res, err := GetUserByToken(dbname, token, "111.229.34.252:7976")
- t.Log(res)
- t.Log(res["UserId"])
- t.Log(err)
-
- res, err = GetUserByUsername(dbname, "tetele")
- t.Log(res)
- t.Log(res["UserId"])
- t.Log(err)
-
- res, err = GetUserByUsercode(dbname, "2233")
- t.Log(res)
- t.Log(res["UserId"])
- t.Log(err)
- }
-
- func Test_Login(t *testing.T) {
- dbname := "dev_tetele_net"
- account := "admin"
- password := "e10adc3949ba59abbe56e057f20f883e"
- res, err := Login(dbname, account, password)
- t.Log(res)
- t.Log(res["UserId"])
- t.Log(err)
-
- }
|