Skip to content

Commit 30bb588

Browse files
author
CJ
committed
Remove WECHATLOGIN_WEB login type
1 parent fd517a7 commit 30bb588

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
install:
2+
cd cmd/pluto-server && \
3+
GO111MODULE=on go install -ldflags="-X 'main.VERSION=$(VERSION)'"
4+
15
docker-build:
26
docker build --build-arg VERSION=$(VERSION) -t mushare/pluto:latest .
37
docker tag mushare/pluto:latest mushare/pluto:$(VERSION)
@@ -26,10 +30,6 @@ docker-clean-staging:
2630
run: install
2731
pluto-server --config.file config.yaml
2832

29-
install:
30-
cd cmd/pluto-server && \
31-
GO111MODULE=on go install -ldflags="-X 'main.VERSION=$(VERSION)'"
32-
3333
server-binary-build:
3434
mkdir -p bin
3535
GO111MODULE=on go build -ldflags="-X 'main.VERSION=$(VERSION)'" -o bin/pluto-server cmd/pluto-server/main.go

manage/user.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ import (
3333
)
3434

3535
const (
36-
MAILLOGIN = "mail"
37-
GOOGLELOGIN = "google"
38-
WECHATLOGIN = "wechat"
39-
WECHATLOGIN_WEB = "wechat_web"
40-
APPLELOGIN = "apple"
36+
MAILLOGIN = "mail"
37+
GOOGLELOGIN = "google"
38+
// 包含扫码登陆和 App 登陆
39+
WECHATLOGIN = "wechat"
40+
APPLELOGIN = "apple"
4141
)
4242

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

394394
identifyToken := unionID
395-
wechatBinding, err := models.Bindings(qm.Where("login_type = ? and identify_token = ?", WECHATLOGIN_WEB, identifyToken)).One(tx)
395+
wechatBinding, err := models.Bindings(qm.Where("login_type = ? and identify_token = ?", WECHATLOGIN, identifyToken)).One(tx)
396396
if err != nil && err != sql.ErrNoRows {
397397
return nil, perror.ServerError.Wrapper(err)
398398
}
@@ -424,7 +424,7 @@ func (m *Manager) WechatLoginWeb(appID, code string) (*GrantResult, *perror.Plut
424424
if perr != nil {
425425
return nil, perr
426426
}
427-
wechatBinding, perr = m.newBinding(tx, user.ID, "", WECHATLOGIN_WEB, unionID, true)
427+
wechatBinding, perr = m.newBinding(tx, user.ID, "", WECHATLOGIN, unionID, true)
428428
if perr != nil {
429429
return nil, perr
430430
}

0 commit comments

Comments
 (0)