用户登录才能访问

dev
truthhun 1 year ago
parent ce8aca37f6
commit 4cbb8464ba

@ -552,6 +552,7 @@ type ConfigSecurity struct {
EnableCaptchaUpload bool `protobuf:"varint,8,opt,name=enable_captcha_upload,json=enableCaptchaUpload,proto3" json:"enable_captcha_upload,omitempty"`
MaxDocumentSize int32 `protobuf:"varint,9,opt,name=max_document_size,json=maxDocumentSize,proto3" json:"max_document_size,omitempty"`
DocumentAllowedExt []string `protobuf:"bytes,10,rep,name=document_allowed_ext,json=documentAllowedExt,proto3" json:"document_allowed_ext,omitempty"`
LoginRequired bool `protobuf:"varint,11,opt,name=login_required,json=loginRequired,proto3" json:"login_required,omitempty"`
}
func (m *ConfigSecurity) Reset() { *m = ConfigSecurity{} }
@ -657,6 +658,13 @@ func (m *ConfigSecurity) GetDocumentAllowedExt() []string {
return nil
}
func (m *ConfigSecurity) GetLoginRequired() bool {
if m != nil {
return m.LoginRequired
}
return false
}
type Settings struct {
System *ConfigSystem `protobuf:"bytes,1,opt,name=system,proto3" json:"system,omitempty"`
Footer *ConfigFooter `protobuf:"bytes,2,opt,name=footer,proto3" json:"footer,omitempty"`
@ -1002,100 +1010,100 @@ func init() {
func init() { proto.RegisterFile("api/v1/config.proto", fileDescriptor_321614cd6c9c1b8a) }
var fileDescriptor_321614cd6c9c1b8a = []byte{
// 1473 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0xcb, 0x6f, 0x1b, 0xb7,
0x13, 0xce, 0x4a, 0xd6, 0x8b, 0x92, 0x65, 0x9b, 0x7e, 0x44, 0x56, 0xf2, 0x73, 0x9c, 0xfd, 0xa1,
0xad, 0x13, 0x14, 0x56, 0xec, 0x3e, 0x0e, 0xed, 0x21, 0x70, 0x1c, 0x27, 0x0d, 0x90, 0x43, 0xba,
0x4e, 0xd0, 0xc7, 0x65, 0x41, 0xed, 0xd2, 0x12, 0xe1, 0x15, 0xb9, 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 0x7c, 0x4b, 0x78, 0xb1, 0x58, 0x37,
0x44, 0x1f, 0xa1, 0xda, 0x43, 0xaa, 0x61, 0x57, 0x5c, 0x96, 0xa8, 0x35, 0xb5, 0x3f, 0x94, 0xbf,
0x06, 0x79, 0xda, 0xb8, 0x95, 0xe7, 0x31, 0xfb, 0x04, 0x7f, 0x8d, 0x16, 0x6d, 0xed, 0x8e, 0x99,
0xa6, 0x23, 0x92, 0x5e, 0x9a, 0xec, 0xb2, 0x1a, 0x5e, 0x85, 0xb4, 0x2b, 0xdd, 0xa5, 0x62, 0x7a,
0x36, 0xd1, 0xbd, 0x4f, 0x7e, 0x79, 0xb3, 0xe5, 0xbd, 0x7e, 0xb3, 0xe5, 0xfd, 0xf1, 0x66, 0xcb,
0x7b, 0xf5, 0x76, 0xeb, 0xca, 0xeb, 0xb7, 0x5b, 0x57, 0x7e, 0x7b, 0xbb, 0x75, 0x05, 0xb9, 0x7f,
0x8c, 0x27, 0xde, 0xb7, 0x2b, 0x23, 0x21, 0x69, 0x2c, 0x22, 0x17, 0xfb, 0xf9, 0x78, 0xaf, 0x5f,
0x85, 0xfc, 0x1f, 0xfd, 0x17, 0x00, 0x00, 0xff, 0xff, 0x79, 0xec, 0x16, 0x60, 0x9e, 0x0c, 0x00,
0x00,
// 1487 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0xcb, 0x6e, 0x1b, 0x37,
0x17, 0xce, 0x48, 0xd6, 0x8d, 0xba, 0xd8, 0xa6, 0x2f, 0x91, 0x95, 0xfc, 0x8e, 0x33, 0x3f, 0xda,
0x3a, 0x41, 0x61, 0xc5, 0xee, 0x65, 0xd1, 0x2e, 0x02, 0xc7, 0x71, 0xd2, 0x00, 0x59, 0xa4, 0xe3,
0x04, 0xbd, 0x6c, 0x06, 0xd4, 0x0c, 0x25, 0x11, 0x1e, 0x91, 0x13, 0x92, 0x52, 0xac, 0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,
0x5b, 0x6f, 0xe6, 0x5b, 0x37, 0x34, 0x7f, 0x03, 0xe2, 0x2d, 0xe3, 0x66, 0xbe, 0x6f, 0x18, 0x7d,
0x8c, 0x2a, 0x0f, 0xa9, 0x86, 0xae, 0xb8, 0x2c, 0x50, 0x63, 0xa6, 0x3f, 0x94, 0xbf, 0x0e, 0x71,
0x5a, 0xb8, 0x91, 0xc5, 0x31, 0x7d, 0x82, 0xbf, 0x46, 0x4d, 0x9b, 0xbb, 0x13, 0xa6, 0xe9, 0x88,
0xa4, 0x97, 0x06, 0xbb, 0x2c, 0x87, 0x57, 0x21, 0xec, 0x6a, 0x67, 0x39, 0x5f, 0x9e, 0x0d, 0x74,
0xef, 0x93, 0x5f, 0xdf, 0x6c, 0x7b, 0xaf, 0xdf, 0x6c, 0x7b, 0x7f, 0xbe, 0xd9, 0xf6, 0x5e, 0xbd,
0xdd, 0xbe, 0xf2, 0xfa, 0xed, 0xf6, 0x95, 0xdf, 0xdf, 0x6e, 0x5f, 0x41, 0xee, 0x57, 0xe4, 0x89,
0xf7, 0xed, 0xea, 0x48, 0x48, 0x1a, 0x8b, 0xc8, 0x8d, 0xfd, 0x7c, 0xb2, 0xdf, 0x2b, 0x43, 0xfc,
0x8f, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xaf, 0x7c, 0x60, 0x72, 0xc5, 0x0c, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -1787,6 +1795,16 @@ func (m *ConfigSecurity) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if m.LoginRequired {
i--
if m.LoginRequired {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x58
}
if len(m.DocumentAllowedExt) > 0 {
for iNdEx := len(m.DocumentAllowedExt) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.DocumentAllowedExt[iNdEx])
@ -2399,6 +2417,9 @@ func (m *ConfigSecurity) Size() (n int) {
n += 1 + l + sovConfig(uint64(l))
}
}
if m.LoginRequired {
n += 2
}
return n
}
@ -4177,6 +4198,26 @@ func (m *ConfigSecurity) Unmarshal(dAtA []byte) error {
}
m.DocumentAllowedExt = append(m.DocumentAllowedExt, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
case 11:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field LoginRequired", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.LoginRequired = bool(v != 0)
default:
iNdEx = preIndex
skippy, err := skipConfig(dAtA[iNdEx:])

@ -77,6 +77,7 @@ message ConfigSecurity {
bool enable_captcha_upload = 8;
int32 max_document_size = 9;
repeated string document_allowed_ext = 10;
bool login_required = 11; // 访
}
message Settings {

@ -226,6 +226,7 @@ const (
ConfigSecurityEnableCaptchaFindPassword = "enable_captcha_find_password" // 是否开启注册验证码
ConfigSecurityDocumentRelatedDuration = "document_related_duration" // 相关文档有效期默认为7天最小值为1
ConfigSecurityDocumentAllowedExt = "document_allowed_ext" // 允许上传的文档类型
ConfigSecurityLoginRequired = "login_required" // 是否需要登录才能查看文档
)
type ConfigSecurity struct {
@ -240,6 +241,7 @@ type ConfigSecurity struct {
EnableCaptchaComment bool `json:"enable_captcha_comment"` // 是否启用评论验证码
EnableCaptchaFindPassword bool `json:"enable_captcha_find_password"` // 找回密码是否需要验证码
DocumentAllowedExt []string `json:"document_allowed_ext"` // 允许上传的文档类型
LoginRequired bool `json:"login_required"` // 是否需要登录才能查看文档
}
const (
@ -501,6 +503,7 @@ func (m *DBModel) GetConfigOfSecurity(name ...string) (config ConfigSecurity) {
ConfigSecurityEnableCaptchaLogin,
ConfigSecurityEnableCaptchaRegister,
ConfigSecurityEnableCaptchaComment,
ConfigSecurityLoginRequired,
ConfigSecurityEnableCaptchaFindPassword:
value, _ := strconv.ParseBool(cfg.Value)
data[cfg.Name] = value
@ -666,6 +669,7 @@ func (m *DBModel) initConfig() (err error) {
{Category: ConfigCategorySecurity, Name: ConfigSecurityIsClose, Label: "是否关闭网站", Value: "false", Placeholder: "请选择是否关闭网站", InputType: "switch", Sort: 160, Options: ""},
{Category: ConfigCategorySecurity, Name: ConfigSecurityCloseStatement, Label: "闭站说明", Value: closeStatement, Placeholder: "关闭网站后页面提示内容支持HTML", InputType: "textarea", Sort: 170, Options: ""},
{Category: ConfigCategorySecurity, Name: ConfigSecurityEnableRegister, Label: "是否允许注册", Value: "true", Placeholder: "请选择是否允许用户注册", InputType: "switch", Sort: 18, Options: ""},
{Category: ConfigCategorySecurity, Name: ConfigSecurityLoginRequired, Label: "是否登录才能访问", Value: "false", Placeholder: "用户是否登录了才能访问", InputType: "switch", Sort: 18, Options: ""},
{Category: ConfigCategorySecurity, Name: ConfigSecurityEnableCaptchaLogin, Label: "是否开启登录验证码", Value: "true", Placeholder: "请选择是否开启登录验证码", InputType: "switch", Sort: 19, Options: ""},
{Category: ConfigCategorySecurity, Name: ConfigSecurityEnableCaptchaRegister, Label: "是否开启注册验证码", Value: "true", Placeholder: "请选择是否开启注册验证码", InputType: "switch", Sort: 20, Options: ""},
{Category: ConfigCategorySecurity, Name: ConfigSecurityEnableCaptchaComment, Label: "是否开启评论验证码", Value: "true", Placeholder: "请选择是否开启评论验证码", InputType: "switch", Sort: 21, Options: ""},

@ -357,7 +357,7 @@ import { categoryToTrees } from '~/utils/utils'
import { getSignedToday, signToday } from '~/api/user'
export default {
components: { UserAvatar, FormUserinfo },
middleware: ['analytic', 'checkCloseSite'],
middleware: ['checkFront', 'analytic'],
data() {
return {
search: {

@ -2,7 +2,16 @@ export default function ({ store, route, redirect }) {
const settings = store.getters['setting/settings']
const user = store.getters['user/user']
const permissions = store.getters['user/permissions'] || []
if (settings.security.is_close) {
if (settings.security && settings.security.login_required && !user.id) {
// 未登录,且开启了登录访问限制
if (route.name !== 'login') {
redirect('/login')
return
}
}
if (settings.security && settings.security.is_close) {
// 1. 用户未登录,跳转到登录页面
if (user.id === 0 && route.name !== 'login') {
redirect('/login')

@ -1,9 +1,13 @@
export default function ({ store, route, redirect }) {
const user = store.getters['user/user'] || { id: 0 }
const settings = store.getters['setting/settings'] || {}
if (user.id) {
const settings = store.getters['setting/settings'] || {}
const permissions = store.getters['user/permissions'] || []
if (settings.security.is_close && permissions.length === 0) {
if (
settings.security &&
settings.security.is_close &&
permissions.length === 0
) {
// 关站了,且不是管理员
if (route.name !== 'login') {
redirect('/login')

@ -21,7 +21,9 @@
<div v-if="settings.security.is_close" class="close-tips">
<div v-html="settings.security.close_statement"></div>
</div>
<form-login v-if="!user.id"></form-login>
<form-login
v-if="!(user.id > 0 && settings.security.is_close)"
></form-login>
</el-card>
</div>
</div>

Loading…
Cancel
Save