Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
85dfe503
authored
Sep 25, 2024
by
1808837298@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 第三方登录注销 #500
parent
fd2379e8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
controller/telegram.go
+8
-0
controller/wechat.go
+7
-0
No files found.
controller/telegram.go
View file @
85dfe503
...
...
@@ -5,6 +5,7 @@ import (
"crypto/sha256"
"encoding/hex"
"io"
"net/http"
"one-api/common"
"one-api/model"
"sort"
...
...
@@ -48,6 +49,13 @@ func TelegramBind(c *gin.Context) {
})
return
}
if
user
.
Id
==
0
{
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"success"
:
false
,
"message"
:
"用户已注销"
,
})
return
}
user
.
TelegramId
=
telegramId
if
err
:=
user
.
Update
(
false
);
err
!=
nil
{
c
.
JSON
(
200
,
gin
.
H
{
...
...
controller/wechat.go
View file @
85dfe503
...
...
@@ -78,6 +78,13 @@ func WeChatAuth(c *gin.Context) {
})
return
}
if
user
.
Id
==
0
{
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"success"
:
false
,
"message"
:
"用户已注销"
,
})
return
}
}
else
{
if
common
.
RegisterEnabled
{
user
.
Username
=
"wechat_"
+
strconv
.
Itoa
(
model
.
GetMaxUserId
()
+
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment