Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-group
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujiebin
hilo-group
Commits
b335e750
Commit
b335e750
authored
Mar 24, 2023
by
hujiebin
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修复获取用户信息的问题
parent
b02af66d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
18 deletions
+5
-18
request.go
req/request.go
+5
-18
No files found.
req/request.go
View file @
b335e750
...
@@ -7,6 +7,7 @@ import (
...
@@ -7,6 +7,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"hilo-group/domain/cache/user_c"
"hilo-group/domain/cache/user_c"
"hilo-group/domain/model/res_m"
"hilo-group/domain/model/res_m"
"hilo-group/domain/model/user_m"
"hilo-group/myerr"
"hilo-group/myerr"
"hilo-group/myerr/bizerr"
"hilo-group/myerr/bizerr"
"strconv"
"strconv"
...
@@ -88,25 +89,11 @@ func GetUserIdLang(c *gin.Context, myContext *mycontext.MyContext) (mysql.ID, st
...
@@ -88,25 +89,11 @@ func GetUserIdLang(c *gin.Context, myContext *mycontext.MyContext) (mysql.ID, st
func
GetUserEx
(
c
*
gin
.
Context
,
myContext
*
mycontext
.
MyContext
)
(
mysql
.
ID
,
string
,
string
,
string
,
string
,
error
)
{
func
GetUserEx
(
c
*
gin
.
Context
,
myContext
*
mycontext
.
MyContext
)
(
mysql
.
ID
,
string
,
string
,
string
,
string
,
error
)
{
if
userIdStr
,
ok
:=
c
.
Keys
[
mycontext
.
USERID
];
ok
{
if
userIdStr
,
ok
:=
c
.
Keys
[
mycontext
.
USERID
];
ok
{
userId
:=
userIdStr
.
(
uint64
)
userId
:=
userIdStr
.
(
uint64
)
user
,
err
:=
user_m
.
GetUser
(
domain
.
CreateModelContext
(
myContext
),
userId
)
externalId
,
ok1
:=
c
.
Get
(
mycontext
.
EXTERNAL_ID
)
if
err
!=
nil
{
nick
,
ok2
:=
c
.
Get
(
mycontext
.
NICK
)
return
0
,
""
,
""
,
""
,
""
,
bizerr
.
ExternalIdNoExist
avatar
,
ok3
:=
c
.
Get
(
mycontext
.
AVATAR
)
country
,
ok4
:=
c
.
Get
(
mycontext
.
COUNTRY
)
ok
:=
ok1
&&
ok2
&&
ok3
&&
ok4
if
ok
{
return
userId
,
externalId
.
(
string
),
nick
.
(
string
),
avatar
.
(
string
),
country
.
(
string
),
nil
}
else
{
//var user user_m.User
//if err := mysql.Db.First(&user, userId).Error; err != nil {
// return 0, "", "", "", "", bizerr.ExternalIdNoExist
//}
user
,
err
:=
user_c
.
GetUserTinyById
(
domain
.
CreateModelContext
(
myContext
),
userId
)
if
err
!=
nil
{
return
0
,
""
,
""
,
""
,
""
,
bizerr
.
ExternalIdNoExist
}
return
userId
,
user
.
ExternalId
,
user
.
Nick
,
user
.
Avatar
,
user
.
Country
,
nil
}
}
return
userId
,
user
.
ExternalId
,
user
.
Nick
,
user
.
Avatar
,
user
.
Country
,
nil
}
}
return
0
,
""
,
""
,
""
,
""
,
bizerr
.
ParaMissing
return
0
,
""
,
""
,
""
,
""
,
bizerr
.
ParaMissing
}
}
...
...
hujiebin
@hujiebin
mentioned in commit
cd735ace
·
Mar 24, 2023
mentioned in commit
cd735ace
mentioned in commit cd735acee6bbde2f0656c221b334db4c43103554
Toggle commit list
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