-
Notifications
You must be signed in to change notification settings - Fork 733
增加 csrf 的判断 #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
增加 csrf 的判断 #55
Conversation
DIR=`pwd` | ||
export GOPATH= | ||
export GOPATH=$DIR | ||
export PATH=$PATH:$DIR/bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个文件是干嘛用的?将 studygolang 执行文件加入 PATH ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
当前的工作环境的gopath设置。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
start.sh 脚本就会设置这些
@@ -19,3 +19,6 @@ stop: | |||
|
|||
migrate: | |||
./bin/migrator --changeVersion=${v} | |||
|
|||
run-studygolang: | |||
cd src/server/studygolang; go run `ls | grep -v windows`; cd - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的用途是?
结合 env.sh 然后 执行 make run-studygolang ? 感觉是不是没啥必要?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
方便运行
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
上面 make start 就可以运行了呀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
start做的事情是需要先 build ,然后在start。如果每次都写一点东西然后build,然后再start感觉有点效率低下。
@@ -370,6 +370,8 @@ func (UserLogic) Total() int64 { | |||
var ( | |||
ErrUsername = errors.New("用户名不存在") | |||
ErrPasswd = errors.New("密码错误") | |||
|
|||
ErrUnameOrPwd = errors.New("用户名或密码错误") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
告知用户名或密码错误,是怕猜测吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对
@@ -62,6 +62,7 @@ func main() { | |||
serveStatic(e) | |||
|
|||
e.Use(thirdmw.EchoLogger()) | |||
e.Use(pwm.CsrfRefererFilter()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
项目中还有一个 AppGroup,也就是用于 APP 接口的,而接口没有 csrf 一说。所以,这个中间件,加到 frontG 和 adminG 上面吧。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个处理下? @momaek
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
No description provided.