作者 yangfu

修改:登录验证修改

... ... @@ -81,6 +81,18 @@ spec:
configMapKeyRef:
name: suplus-config
key: service.businessadmin
- name: REDIS_HOST
valueFrom:
configMapKeyRef:
name: suplus-config
key: redis.ip
- name: REDIS_PORT
valueFrom:
configMapKeyRef:
name: suplus-config
key: redis.port
- name: REDIS_AUTH
value: ""
volumes:
- name: accesslogs
emptyDir: {}
\ No newline at end of file
... ...
... ... @@ -81,6 +81,18 @@ spec:
configMapKeyRef:
name: suplus-config
key: service.businessadmin
- name: REDIS_HOST
valueFrom:
configMapKeyRef:
name: suplus-config
key: redis.ip
- name: REDIS_PORT
valueFrom:
configMapKeyRef:
name: suplus-config
key: redis.port
- name: REDIS_AUTH
value: ""
volumes:
- name: accesslogs
emptyDir: {}
\ No newline at end of file
... ...
... ... @@ -81,6 +81,18 @@ spec:
configMapKeyRef:
name: suplus-config
key: service.businessadmin
- name: REDIS_HOST
valueFrom:
configMapKeyRef:
name: suplus-config
key: redis.ip
- name: REDIS_PORT
valueFrom:
configMapKeyRef:
name: suplus-config
key: redis.port
- name: REDIS_AUTH
value: ""
volumes:
- name: accesslogs
emptyDir: {}
\ No newline at end of file
... ...
... ... @@ -336,7 +336,7 @@ func CenterCompanys(header *protocol.RequestHeader, request *protocolx.CenterCom
rsp.ImToken = imInfo.ImToken
rsp.Accid, _ = strconv.Atoi(imInfo.ImId)
rsp.Phone = request.Phone
rsp.Credentials, _ = utils.GenerateToken(int64(phoneId), request.Phone, 60*time.Second)
rsp.Credentials, _ = utils.GenerateToken(int64(phoneId), request.Phone, protocol.RefreshTokenExipre*time.Second)
err = transactionContext.CommitTransaction()
v = map[string]interface{}{"center": rsp}
... ... @@ -358,7 +358,7 @@ func Companys(header *protocol.RequestHeader, request *protocolx.CompanysRequest
transactionContext.RollbackTransaction()
}()
if claim, err = utils.ParseJWTToken(request.Credentials); err != nil {
err = protocol.NewErrWithMessage(4139, err)
err = protocol.NewErrWithMessage(4140, err)
return
}
loginSvr.Init(claim.Phone)
... ...
... ... @@ -9,6 +9,7 @@ var REDIS_AUTH = "123456"
func init() {
if os.Getenv("REDIS_HOST") != "" {
REDIS_HOST = os.Getenv("REDIS_HOST")
REDIS_AUTH = os.Getenv("REDIS_AUTH")
}
if os.Getenv("REDIS_PORT") != "" {
REDIS_PORT = os.Getenv("REDIS_PORT")
... ...