作者 tangxvhui

日常保存

package domain
import "testing"
import (
"testing"
"github.com/dgrijalva/jwt-go"
)
func TestGenerateToken(t *testing.T) {
ut := UserAuth{
... ... @@ -24,5 +28,9 @@ func TestParsetToken2(t *testing.T) {
ut := UserAuth{}
str := `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjM0MjYxMDAxMTcwOTM4ODgsImNvbXBhbnlJZCI6MSwiY29tcGFueU5hbWUiOiLnpo_lt57ntKDlpKnkuIvpo5_lk4HmnInpmZDlhazlj7giLCJwaG9uZSI6IjE1NjU5Mzc1OTQwIiwicGxhdGZvcm1JZCI6MjksIm5hbWUiOiLlurfkvJ_ljY4iLCJhZG1pblR5cGUiOjF9.BwJ2mLdTlFKF322y4GeqPOW6wKroIrPSI8eNyuQEMkQ`
tk, _ := ut.ParseAccessToken(str)
t.Logf("%+v", tk)
t.Logf("===》%+v", tk)
tk.StandardClaims = jwt.StandardClaims{}
tk.PlatformId = 29
tkStr, _ := tk.CreateAccessToken()
t.Logf(" ===》%v", tkStr)
}
... ...
... ... @@ -36,6 +36,7 @@ func (repo *LogSmsRepository) Save(param *domain.LogSms) error {
if err != nil {
return err
}
return nil
}
_, err := tx.Model(&m).WherePK().Update()
if err != nil {
... ...
... ... @@ -27,7 +27,7 @@ func (controller *AuthController) User() {
}, nil)
}
// Login PC端登录
// Login 手机端登录
func (controller *AuthController) MobileLogin() {
authService := &service.AuthService{}
loginCommand := &command.MobileLoginCommand{}
... ...