Skip to content

Commit

Permalink
update ueditor
Browse files Browse the repository at this point in the history
  • Loading branch information
3xxx committed Jan 21, 2018
1 parent e5728f2 commit 37a404b
Show file tree
Hide file tree
Showing 149 changed files with 489 additions and 59,023 deletions.
2 changes: 1 addition & 1 deletion conf/app.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ sessionon = true
sessiongcmaxlifetime=36000

copyrequestbody = true
#自动化文档
#�Զ����ĵ�
EnableDocs = true
10 changes: 5 additions & 5 deletions conf/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
/* 上传图片配置项 */
"imageActionName": "uploadimage", /* 执行上传图片的action名称 */
"imageFieldName": "upfile", /* upfile提交的图片表单名称 */
"imageMaxSize": 20480000, /* 上传大小限制,单位B */
"imageMaxSize": 5120000, /* 上传大小限制,单位B 默认5M*/
"imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 上传图片格式显示 */
"imageCompressEnable": true, /* 是否压缩图片,默认是true */
"imageCompressBorder": 800, /* 图片压缩最长边限制 */
"imageCompressBorder": 1024, /* 图片压缩最长边限制 */
"imageInsertAlign": "none", /* 插入的图片浮动方式 */
"imageUrlPrefix": "", /* 图片访问路径前缀 */
"imagePathFormat": "/static/upload/{yyyy}{mm}{dd}/{time}{rand:6}", /* /ueditor/jsp/upload/image上传保存路径,可以自定义保存路径和文件名格式 */
Expand All @@ -28,7 +28,7 @@
"scrawlActionName": "uploadscrawl", /* 执行上传涂鸦的action名称 */
"scrawlFieldName": "upfile", /* 提交的图片表单名称 */
"scrawlPathFormat": "/static/upload/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
"scrawlMaxSize": 2048000, /* 上传大小限制,单位B */
"scrawlMaxSize": 2048000, /* 上传大小限制,单位B 默认2M*/
"scrawlUrlPrefix": "", /* 图片访问路径前缀 */
"scrawlInsertAlign": "none",

Expand All @@ -44,15 +44,15 @@
"catcherFieldName": "source", /* 提交的图片列表表单名称 */
"catcherPathFormat": "/static/upload/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
"catcherUrlPrefix": "", /* 图片访问路径前缀 */
"catcherMaxSize": 2048000, /* 上传大小限制,单位B */
"catcherMaxSize": 2048000, /* 上传大小限制,单位B 默认2M*/
"catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 抓取图片格式显示 */

/* 上传视频配置 */
"videoActionName": "uploadvideo", /* 执行上传视频的action名称 */
"videoFieldName": "upfile", /* 提交的视频表单名称 */
"videoPathFormat": "/static/upload/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
"videoUrlPrefix": "", /* 视频访问路径前缀 */
"videoMaxSize": 102400000, /* 上传大小限制,单位B,默认100MB */
"videoMaxSize": 1024000000, /* 上传大小限制,单位B,默认100MB */
"videoAllowFiles": [
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid"], /* 上传视频格式显示 */
Expand Down
40 changes: 36 additions & 4 deletions controllers/article.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,14 +452,45 @@ func (c *ArticleController) AddProdArticle() {
// }
}

//修改文章页面
func (c *ArticleController) ModifyArticle() {
//这里再添加一次验证才行!!!
id := c.Ctx.Input.Param(":id")

var err error
//id转成64为
idNum, err := strconv.ParseInt(id, 10, 64)
if err != nil {
beego.Error(err)
}

Article, err := models.GetArticle(idNum)
if err != nil {
beego.Error(err)
}
//查出成果编号,名称和作者
prod, err := models.GetProd(Article.ProductId)
if err != nil {
beego.Error(err)
}
c.Data["product"] = prod
c.Data["article"] = Article
c.Data["IsLogin"] = checkAccount(c.Ctx)
c.TplName = "article_modify.tpl"
}

//编辑 成果id
func (c *ArticleController) UpdateArticle() {
// _, role := checkprodRole(c.Ctx)
// if role == 1 {
// id := c.Ctx.Input.Param(":id")
pid := c.Input().Get("pid")
pid := c.Input().Get("aid")
// beego.Info(aid)
subtext := c.Input().Get("subtext")
content := c.Input().Get("content")
// beego.Info(subtext)
// content := c.Input().Get("content")
content := c.Input().Get("editorValue")
// beego.Info(content)
//id转成64为
pidNum, err := strconv.ParseInt(pid, 10, 64)
if err != nil {
Expand All @@ -470,8 +501,9 @@ func (c *ArticleController) UpdateArticle() {
if err != nil {
beego.Error(err)
} else {
c.Data["json"] = "ok"
c.ServeJSON()
// c.Data["json"] = "ok"
// c.ServeJSON()
c.Redirect("/project/product/article/"+pid, 302) //回到修改后的文章
}
// } else {
// route := c.Ctx.Request.URL.String()
Expand Down
Binary file added document/project wise权限设置参考.docx
Binary file not shown.
1 change: 1 addition & 0 deletions models/ProjModel.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ func GetProj(id int64) (proj Project, err error) {
//通过Id为projid,查出本级
//parentid是projid,查出二级
//parentidpath包含projid-,查出三级,以及往下
//还是不严谨,projid-前面还有数据呢?必须前后都有限定符号才行
//差点按照无闻的视频,将parentidpath存成$id1#$id2#$id3#
//存:parentidpath="$"+id1+"#"
//查:__contains,"$"+id1+"#"
Expand Down
2 changes: 2 additions & 0 deletions routers/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ func init() {
beego.Router("/project/product/syncharticles", &controllers.ArticleController{}, "*:GetsynchArticles")
//根据成果id取得成果的所有文章列表_注意articles是复数
beego.Router("/project/product/providesyncharticles", &controllers.ArticleController{}, "*:ProvideArticles")
//文章进行编辑页面
beego.Router("/project/product/modifyarticle/:id:string", &controllers.ArticleController{}, "*:ModifyArticle")
//文章进行编辑
beego.Router("/project/product/updatearticle", &controllers.ArticleController{}, "*:UpdateArticle")
//删除文章
Expand Down
2 changes: 1 addition & 1 deletion static/css/csdn_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ body > a > img {
line-height: 35px;
}
#main .article_content p > img {
max-width: 602px;
max-width: 800px;/*602px;*/
height: auto;
}
#main .article_content a {
Expand Down
Loading

0 comments on commit 37a404b

Please sign in to comment.