mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-06-28 15:45:35 +08:00
fix:修复管理员或作者读取文章时弹出密码页的问题
This commit is contained in:
parent
fa1cb9ae33
commit
8243a89e23
@ -377,7 +377,7 @@ func RegisterCache() {
|
|||||||
|
|
||||||
bc, err := json.Marshal(&memcacheConfig)
|
bc, err := json.Marshal(&memcacheConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
beego.Error("初始化 Redis 缓存失败 ->", err)
|
beego.Error("初始化 Memcache 缓存失败 ->", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
memcache, err := beegoCache.NewCache("memcache", string(bc))
|
memcache, err := beegoCache.NewCache("memcache", string(bc))
|
||||||
@ -439,7 +439,7 @@ func init() {
|
|||||||
if configPath, err := filepath.Abs(conf.ConfigurationFile); err == nil {
|
if configPath, err := filepath.Abs(conf.ConfigurationFile); err == nil {
|
||||||
conf.ConfigurationFile = configPath
|
conf.ConfigurationFile = configPath
|
||||||
}
|
}
|
||||||
gocaptcha.ReadFonts("./static/fonts", ".ttf")
|
gocaptcha.ReadFonts(conf.WorkingDir("static","fonts"), ".ttf")
|
||||||
gob.Register(models.Member{})
|
gob.Register(models.Member{})
|
||||||
|
|
||||||
if p, err := filepath.Abs(os.Args[0]); err == nil {
|
if p, err := filepath.Abs(os.Args[0]); err == nil {
|
||||||
|
@ -144,10 +144,10 @@ cdnimg="${MINDOC_CDN_IMG_URL}"
|
|||||||
######################缓存配置###############################
|
######################缓存配置###############################
|
||||||
|
|
||||||
#是否开启缓存,true 开启/false 不开启
|
#是否开启缓存,true 开启/false 不开启
|
||||||
cache="${MINDOC_CACHE||true}"
|
cache="${MINDOC_CACHE||false}"
|
||||||
|
|
||||||
#缓存方式:memory/memcache/redis/file
|
#缓存方式:memory/memcache/redis/file
|
||||||
cache_provider="${MINDOC_CACHE_PROVIDER||redis}"
|
cache_provider="${MINDOC_CACHE_PROVIDER||file}"
|
||||||
|
|
||||||
#当配置缓存方式为memory时,内存回收时间,单位是秒
|
#当配置缓存方式为memory时,内存回收时间,单位是秒
|
||||||
cache_memory_interval="${MINDOC_CACHE_MEMORY_INTERVAL||120}"
|
cache_memory_interval="${MINDOC_CACHE_MEMORY_INTERVAL||120}"
|
||||||
|
@ -50,7 +50,7 @@ func (c *BlogController) Index() {
|
|||||||
c.JsonResult(0,"OK")
|
c.JsonResult(0,"OK")
|
||||||
}
|
}
|
||||||
c.JsonResult(0,"OK")
|
c.JsonResult(0,"OK")
|
||||||
}else if blog.BlogStatus == "password" && c.CruSession.Get(blogReadSession) == nil {
|
}else if blog.BlogStatus == "password" && (c.CruSession.Get(blogReadSession) == nil || (c.Member != nil && blog.MemberId != c.Member.MemberId && !c.Member.IsAdministrator() ) ){
|
||||||
//如果不存在已输入密码的标记
|
//如果不存在已输入密码的标记
|
||||||
c.TplName = "blog/index_password.tpl"
|
c.TplName = "blog/index_password.tpl"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user