diff --git a/grpc/protocol_plugin/README.md b/grpc/protocol_plugin/README.md index 50849724a..9f4779789 100644 --- a/grpc/protocol_plugin/README.md +++ b/grpc/protocol_plugin/README.md @@ -1,3 +1,6 @@ -### 重新生成gRPC代码,编译proto +# ThingsPanel提供给协议插件的grpc服务 + + +## 重新生成gRPC代码,编译proto protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative protocol_plugin.proto diff --git a/services/device_service.go b/services/device_service.go index 0370db5d0..aa9253898 100644 --- a/services/device_service.go +++ b/services/device_service.go @@ -1065,7 +1065,7 @@ func (*DeviceService) GetConfigByToken(token string, deviceId string) (map[strin config := DeviceConfig{ ProtocolType: device.Protocol, - AccessToken: token, + AccessToken: device.Token, DeviceType: device.DeviceType, ID: device.ID, DeviceConfig: protocolConfig, diff --git a/validate/login_validate.go b/validate/login_validate.go index c76b16ed8..697fb3d2b 100644 --- a/validate/login_validate.go +++ b/validate/login_validate.go @@ -4,7 +4,7 @@ package valid type LoginValidate struct { PhoneNumber string `json:"phone_number" alias:"手机号" valid:"MaxSize(11)"` Email string `json:"email" alias:"用户名" valid:"MaxSize(100)"` - Password string `json:"password" alias:"密码" valid:"MinSize(6)"` + Password string `json:"password" alias:"密码" valid:"MaxSize(100)"` VerificationCode string `json:"verification_code" alias:"验证码" valid:"MaxSize(36)"` } @@ -24,7 +24,6 @@ type TenantRegisterValidate struct { VerificationCode string `json:"verification_code" alias:"验证码" valid:"Required;MaxSize(36)"` } - // ChangePassword 校验 type ChangePasswordValidate struct { PhoneNumber string `json:"phone_number" alias:"手机号" valid:"Required;MaxSize(11)"`