@ -59,6 +59,7 @@ func (t *UserCtl) EntryLogin() {
entry.IsSpecial = customer.IsSpecial
_, err = entry.Update(entry, entry.Id)
t.CheckErr(err)
entry.Token = fmt.Sprintf("%s:%s", define.TYPE_ENTRYPEOPLE, entry.Token)
t.SetSession(define.TOKEN, entry.Token)
t.JSON(map[string]interface{}{
@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"hudongzhuanjia/utils/define"
"net/url"
"reflect"
"strings"
"time"
@ -22,6 +23,7 @@ type Model struct {
}
func ParseToken(token string) (_type string, id int, err error) {
token, _ = url.PathUnescape(token)
tokens := strings.SplitN(token, ":", 2)
if len(tokens) < 2 {
err = errors.New("token失效")
@ -42,7 +42,7 @@ func (t *OrderEntryPerson) GetByToken(token string) error {
if err != nil {
return err
if exist {
if !exist {
return errors.New("录入人员信息异常")
return nil