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

Skip to content

增加 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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

增加 csrf 的判断 #55

wants to merge 2 commits into from

Conversation

momaek
Copy link

@momaek momaek commented Feb 26, 2018

No description provided.

DIR=`pwd`
export GOPATH=
export GOPATH=$DIR
export PATH=$PATH:$DIR/bin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件是干嘛用的?将 studygolang 执行文件加入 PATH ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当前的工作环境的gopath设置。

Copy link
Member

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 -
Copy link
Member

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 ? 感觉是不是没啥必要?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

方便运行

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上面 make start 就可以运行了呀

Copy link
Author

@momaek momaek Feb 27, 2018

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("用户名或密码错误")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

告知用户名或密码错误,是怕猜测吗?

Copy link
Author

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())
Copy link
Member

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 上面吧。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个处理下? @momaek

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants