DocHub
DocHub copied to clipboard
参考百度文库,使用Beego(Golang)开发的开源文库系统
在调用BaseController中的ResponseJson()函数,为什么不会抛map空指针的panic? 一般,在继承了BaseController之后,然后在调用他的ResponseJson的时候,不是会抛:Handler crashed with error assignment to entry in nil map 希望能帮忙解答下 package controllers import ( "github.com/astaxie/beego" ) type T1Controller struct { // BaseController beego.Controller T2Controller } type T2Controller struct...
网站首页的文章列表查询中存在sql_mode=only_full_group_by的问题,建议将DocumentModel.go的第186行修改为fields := "d.Title,any_value(d.Id) Id,any_value(ds.Ext) Ext,any_value(ds.ExtCate) ExtCate",第190行修改为where %v group by d.Title order by any_value(di.%v) desc limit %v,即可无视sql_mode=only_full_group_by的问题
查看控制台输出,可能是413 Request Entity Too Large > 所以如果使用Nginx反代,最好提前设置好文件上传大小限制 即在xx.conf文件添加 ``` # 允许上传大小50M client_max_body_size 52428800; ```
如付费下载文档 会员 购买积分等功能
文档编辑函数中 ``` //文档编辑 func (this *UserController) DocEdit() { ``` 原分类-1操作应该放置在info的相关量重新赋值之前!相关代码如下: ``` // 原分类-1 models.Regulate(models.GetTableCategory(), "Cnt", -1, fmt.Sprintf("Id in(%v,%v,%v)", info.ChanelId, info.Cid, info.Pid)) doc.Title = params["Title"].(string) doc.Keywords = ### params["Tags"].(string) doc.Description =...
问题: > Error 1055: Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'wenku.i.Id' which is not functionally dependent on columns in GROUP BY...
>models/UserModel.go 125行 用户信息导入的时候,注册时间未添加 添加TimeCreate字段的插入 ``` var userinfo = UserInfo{Id: user.Id, Status: true, Coin: coin, TimeCreate: int(time.Now().Unix())} ``` 同时这样更改之后,Docker默认时区不是中国,进行Docker默认时区的更改 建议:在Dockerfile添加时区定义 ``` # 时区设置 ENV TZ=Asia/Shanghai RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime &&...
具体的报错信息如下: ``` 2018-07-19 17:28:32:[ORM]2018/07/19 09:28:32 register db Ping `default`, open /usr/local/go/lib/time/zoneinfo.zip: no such file or directory 2018-07-19 17:28:32:panic: register db Ping `default`, open /usr/local/go/lib/time/zoneinfo.zip: no such file or directory 2018-07-19...
我太懒了,不想注册,主要是加上真的方便。
数据库在哪里
数据库在哪里