Skip to content

Commit

Permalink
Remove WECHATLOGIN_WEB login type
Browse files Browse the repository at this point in the history
  • Loading branch information
cj1128 committed Apr 21, 2021
1 parent fd517a7 commit 30bb588
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
install:
cd cmd/pluto-server && \
GO111MODULE=on go install -ldflags="-X 'main.VERSION=$(VERSION)'"

docker-build:
docker build --build-arg VERSION=$(VERSION) -t mushare/pluto:latest .
docker tag mushare/pluto:latest mushare/pluto:$(VERSION)
Expand Down Expand Up @@ -26,10 +30,6 @@ docker-clean-staging:
run: install
pluto-server --config.file config.yaml

install:
cd cmd/pluto-server && \
GO111MODULE=on go install -ldflags="-X 'main.VERSION=$(VERSION)'"

server-binary-build:
mkdir -p bin
GO111MODULE=on go build -ldflags="-X 'main.VERSION=$(VERSION)'" -o bin/pluto-server cmd/pluto-server/main.go
Expand Down
14 changes: 7 additions & 7 deletions manage/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ import (
)

const (
MAILLOGIN = "mail"
GOOGLELOGIN = "google"
WECHATLOGIN = "wechat"
WECHATLOGIN_WEB = "wechat_web"
APPLELOGIN = "apple"
MAILLOGIN = "mail"
GOOGLELOGIN = "google"
// 包含扫码登陆和 App 登陆
WECHATLOGIN = "wechat"
APPLELOGIN = "apple"
)

func (m *Manager) randomUserName(exec boil.Executor, prefix string) (string, *perror.PlutoError) {
Expand Down Expand Up @@ -392,7 +392,7 @@ func (m *Manager) WechatLoginWeb(appID, code string) (*GrantResult, *perror.Plut
}()

identifyToken := unionID
wechatBinding, err := models.Bindings(qm.Where("login_type = ? and identify_token = ?", WECHATLOGIN_WEB, identifyToken)).One(tx)
wechatBinding, err := models.Bindings(qm.Where("login_type = ? and identify_token = ?", WECHATLOGIN, identifyToken)).One(tx)
if err != nil && err != sql.ErrNoRows {
return nil, perror.ServerError.Wrapper(err)
}
Expand Down Expand Up @@ -424,7 +424,7 @@ func (m *Manager) WechatLoginWeb(appID, code string) (*GrantResult, *perror.Plut
if perr != nil {
return nil, perr
}
wechatBinding, perr = m.newBinding(tx, user.ID, "", WECHATLOGIN_WEB, unionID, true)
wechatBinding, perr = m.newBinding(tx, user.ID, "", WECHATLOGIN, unionID, true)
if perr != nil {
return nil, perr
}
Expand Down

0 comments on commit 30bb588

Please sign in to comment.