mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-30 01:00:27 +08:00
自动检查管理员弱密码并提醒
This commit is contained in:
@@ -30,15 +30,16 @@ type Admin struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Fullname string `protobuf:"bytes,2,opt,name=fullname,proto3" json:"fullname,omitempty"`
|
||||
Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
|
||||
IsOn bool `protobuf:"varint,4,opt,name=isOn,proto3" json:"isOn,omitempty"`
|
||||
IsSuper bool `protobuf:"varint,5,opt,name=isSuper,proto3" json:"isSuper,omitempty"`
|
||||
CreatedAt int64 `protobuf:"varint,6,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
|
||||
Modules []*AdminModule `protobuf:"bytes,7,rep,name=Modules,proto3" json:"Modules,omitempty"`
|
||||
OtpLogin *Login `protobuf:"bytes,8,opt,name=otpLogin,proto3" json:"otpLogin,omitempty"` // OTP认证
|
||||
CanLogin bool `protobuf:"varint,9,opt,name=canLogin,proto3" json:"canLogin,omitempty"` // 是否可以登录
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // ID
|
||||
Fullname string `protobuf:"bytes,2,opt,name=fullname,proto3" json:"fullname,omitempty"` // 全称
|
||||
Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` // 用户名
|
||||
IsOn bool `protobuf:"varint,4,opt,name=isOn,proto3" json:"isOn,omitempty"` // 是否启用
|
||||
IsSuper bool `protobuf:"varint,5,opt,name=isSuper,proto3" json:"isSuper,omitempty"` // 是否为超级用户
|
||||
CreatedAt int64 `protobuf:"varint,6,opt,name=createdAt,proto3" json:"createdAt,omitempty"` // 创建时间
|
||||
Modules []*AdminModule `protobuf:"bytes,7,rep,name=Modules,proto3" json:"Modules,omitempty"` // 有权限的模块
|
||||
OtpLogin *Login `protobuf:"bytes,8,opt,name=otpLogin,proto3" json:"otpLogin,omitempty"` // OTP认证
|
||||
CanLogin bool `protobuf:"varint,9,opt,name=canLogin,proto3" json:"canLogin,omitempty"` // 是否可以登录
|
||||
HasWeakPassword bool `protobuf:"varint,10,opt,name=hasWeakPassword,proto3" json:"hasWeakPassword,omitempty"` // 是否设置了弱密码,只有超级管理员能看到此项
|
||||
}
|
||||
|
||||
func (x *Admin) Reset() {
|
||||
@@ -136,6 +137,13 @@ func (x *Admin) GetCanLogin() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *Admin) GetHasWeakPassword() bool {
|
||||
if x != nil {
|
||||
return x.HasWeakPassword
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var File_models_model_admin_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_models_model_admin_proto_rawDesc = []byte{
|
||||
@@ -144,7 +152,7 @@ var file_models_model_admin_proto_rawDesc = []byte{
|
||||
0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x61, 0x64, 0x6d,
|
||||
0x69, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
|
||||
0x18, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6c, 0x6f,
|
||||
0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x89, 0x02, 0x0a, 0x05, 0x41, 0x64,
|
||||
0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb3, 0x02, 0x0a, 0x05, 0x41, 0x64,
|
||||
0x6d, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||
0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x12,
|
||||
@@ -161,8 +169,10 @@ var file_models_model_admin_proto_rawDesc = []byte{
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52,
|
||||
0x08, 0x6f, 0x74, 0x70, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x6e,
|
||||
0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x61, 0x6e,
|
||||
0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x28, 0x0a, 0x0f, 0x68, 0x61, 0x73, 0x57, 0x65, 0x61, 0x6b,
|
||||
0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f,
|
||||
0x68, 0x61, 0x73, 0x57, 0x65, 0x61, 0x6b, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42,
|
||||
0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user