Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f45dcfe

Browse files
committed
编辑评论图片上传&&xss注入&&注册错误信息提示
1 parent 83f401d commit f45dcfe

29 files changed

+80
-56
lines changed

gulpfile.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ gulp.task('minifycss', function() {
2424
.pipe(gulp.dest('static/dist/css')) // 输出文件目录
2525
// .pipe(rev.manifest()) // 收集原始文件名和版本号文件名对应关系
2626
// .pipe(gulp.dest('static/dist/rev/js')) // 对应文件输出
27-
.pipe(notify({message:'css task ok'})) // 提示成功
27+
.pipe(notify({message:'css task ok', onLast: true})) // 提示成功
2828

2929
gulp.src('static/css/libs/*.css') // 设置 css
3030
.pipe(concat('sg_libs.css')) // 合并 css 文件到 "sg_libs.css"
3131
.pipe(gulp.dest('static/dist/css')) // 设置输出路径
3232
.pipe(rename({suffix:'.min'})) // 修改文件名
3333
.pipe(minifycss()) // 压缩文件
3434
.pipe(gulp.dest('static/dist/css')) // 输出文件目录
35-
.pipe(notify({message:'css lib task ok'})); // 提示成功
35+
.pipe(notify({message:'css lib task ok', onLast: true})); // 提示成功
3636

3737
//////////// 只是压缩 ////////////////
3838
gulp.src('static/css/inner/*.css') // 设置 css
3939
.pipe(rename({suffix:'.min'})) // 修改文件名
4040
.pipe(minifycss()) // 压缩文件
4141
.pipe(gulp.dest('static/dist/css')) // 输出文件目录
42-
.pipe(notify({message:'css only minify task ok'})); // 提示成功
42+
.pipe(notify({message:'css only minify task ok', onLast: true})); // 提示成功
4343
});
4444

4545
// JS 处理
@@ -50,7 +50,7 @@ gulp.task('minifyjs',function(){
5050
.pipe(rename({suffix:'.min'})) // 重命名
5151
.pipe(uglify()) // 压缩
5252
.pipe(gulp.dest('static/dist/js')) // 输出
53-
.pipe(notify({message:"js lib task ok"})); // 提示成功
53+
.pipe(notify({message:"js lib task ok", onLast: true})); // 提示成功
5454

5555
gulp.src(['static/js/base/common.js', 'static/js/base/md_toolbar.js', 'static/js/base/puploader.js', 'static/js/base/upload.js', 'static/js/base/comment.js']) // 选择合并的 JS
5656
.pipe(concat('sg_base.js')) // 合并 JS
@@ -61,12 +61,12 @@ gulp.task('minifyjs',function(){
6161
.pipe(gulp.dest('static/dist/js')) // 输出
6262
// .pipe(rev.manifest()) // 收集原始文件名和版本号文件名对应关系
6363
// .pipe(gulp.dest('static/dist/rev/css')) // 对应文件输出
64-
.pipe(notify({message:"js base task ok"})); // 提示成功
64+
.pipe(notify({message:"js base task ok", onLast: true})); // 提示成功
6565

6666
///////// 只是压缩 /////////////
6767
gulp.src('static/js/*.js')
6868
.pipe(rename({suffix:'.min'})) // 重命名
6969
.pipe(uglify()) // 压缩
7070
.pipe(gulp.dest('static/dist/js')) // 输出
71-
.pipe(notify({message:"js only uglify task ok"})); // 提示成功
71+
.pipe(notify({message:"js only uglify task ok", onLast: true})); // 提示成功
7272
});

src/logic/uploader.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ func (this *UploaderLogic) uploadLocalFile(localFile, key string) (err error) {
8989

9090
var ret io.PutRet
9191
var extra = &io.PutExtra{
92-
// Params: params,
93-
// MimeType: mieType,
94-
// Crc32: crc32,
95-
// CheckCrc: CheckCrc,
92+
// Params: params,
93+
// MimeType: mieType,
94+
// Crc32: crc32,
95+
// CheckCrc: CheckCrc,
9696
}
9797

9898
// ret 变量用于存取返回的信息,详情见 io.PutRet
@@ -119,10 +119,10 @@ func (this *UploaderLogic) uploadMemoryFile(r gio.Reader, key string, size int)
119119

120120
var ret io.PutRet
121121
var extra = &io.PutExtra{
122-
// Params: params,
123-
// MimeType: mieType,
124-
// Crc32: crc32,
125-
// CheckCrc: CheckCrc,
122+
// Params: params,
123+
// MimeType: mieType,
124+
// Crc32: crc32,
125+
// CheckCrc: CheckCrc,
126126
}
127127

128128
// ret 变量用于存取返回的信息,详情见 io.PutRet

src/logic/user.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ func (self UserLogic) CreateUser(ctx context.Context, form url.Values) (errMsg s
3737
objLog := GetLogger(ctx)
3838

3939
if self.UserExists(ctx, "email", form.Get("email")) {
40-
err = errors.New("该邮箱已注册过")
40+
errMsg = "该邮箱已注册过"
41+
err = errors.New(errMsg)
4142
return
4243
}
4344
if self.UserExists(ctx, "username", form.Get("username")) {
44-
err = errors.New("用户名已存在")
45+
errMsg = "用户名已存在"
46+
err = errors.New(errMsg)
4547
return
4648
}
4749

static/css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ a.tab_current:hover {background-color: #445; color: #fff; text-decoration: none;
3131
.clr:after {clear: both;content: '\0020';display: block;visibility: hidden;height: 0;}
3232

3333
/* nav */
34-
.navbar-default { position: static; z-index: 1000; }
34+
.navbar-default { position: relative; z-index: 1000; }
3535
.navbar-default .navbar-nav>li>a { color: #bbbbbb; }
3636
.navbar-default .navbar-nav>.active>a { color: #ffffff; }
3737

static/dist/css/sg_styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ a.tab_current:hover {background-color: #445; color: #fff; text-decoration: none;
134134
.clr:after {clear: both;content: '\0020';display: block;visibility: hidden;height: 0;}
135135

136136
/* nav */
137-
.navbar-default { position: static; z-index: 1000; }
137+
.navbar-default { position: relative; z-index: 1000; }
138138
.navbar-default .navbar-nav>li>a { color: #bbbbbb; }
139139
.navbar-default .navbar-nav>.active>a { color: #ffffff; }
140140

static/dist/css/sg_styles.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/dist/js/account.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/dist/js/articles.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/dist/js/books.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/dist/js/godl.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)