Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
51e9dcf7
Commit
51e9dcf7
authored
Mar 21, 2024
by
ruyun.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录错误描述修改
parent
1dcd666a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
performance/Performance.Api/Controllers/AccountController.cs
+1
-1
performance/Performance.Services/RoleService.cs
+1
-1
performance/Performance.Services/UserService.cs
+3
-3
No files found.
performance/Performance.Api/Controllers/AccountController.cs
View file @
51e9dcf7
...
@@ -67,7 +67,7 @@ public ApiResponse<JwtToken> Login([FromBody] LoginRequest request)
...
@@ -67,7 +67,7 @@ public ApiResponse<JwtToken> Login([FromBody] LoginRequest request)
{
{
var
user
=
_userService
.
Login
(
request
);
var
user
=
_userService
.
Login
(
request
);
if
(
user
==
null
)
if
(
user
==
null
)
return
new
ApiResponse
<
JwtToken
>(
ResponseType
.
Fail
,
"用户
不存在
"
);
return
new
ApiResponse
<
JwtToken
>(
ResponseType
.
Fail
,
"用户
或密码错误
"
);
var
claims
=
new
List
<
Claim
>
var
claims
=
new
List
<
Claim
>
{
{
...
...
performance/Performance.Services/RoleService.cs
View file @
51e9dcf7
...
@@ -47,7 +47,7 @@ public List<RoleResponse> GetUserRole(int userid)
...
@@ -47,7 +47,7 @@ public List<RoleResponse> GetUserRole(int userid)
public
List
<
sys_role
>
GetRole
(
int
userid
)
public
List
<
sys_role
>
GetRole
(
int
userid
)
{
{
if
(
userid
<=
0
)
if
(
userid
<=
0
)
throw
new
PerformanceException
(
$"
userid:
{
userid
}
错误"
);
throw
new
PerformanceException
(
$"
用户或密码
错误"
);
var
joinList
=
_userroleRepository
.
GetEntities
(
t
=>
t
.
UserID
==
userid
);
var
joinList
=
_userroleRepository
.
GetEntities
(
t
=>
t
.
UserID
==
userid
);
if
(
joinList
==
null
&&
joinList
.
Count
==
0
)
if
(
joinList
==
null
&&
joinList
.
Count
==
0
)
...
...
performance/Performance.Services/UserService.cs
View file @
51e9dcf7
...
@@ -69,18 +69,18 @@ public UserIdentity Login(LoginRequest request)
...
@@ -69,18 +69,18 @@ public UserIdentity Login(LoginRequest request)
{
{
var
user
=
_userRepository
.
GetEntity
(
t
=>
t
.
Login
==
request
.
Account
&&
t
.
IsDelete
==
1
);
var
user
=
_userRepository
.
GetEntity
(
t
=>
t
.
Login
==
request
.
Account
&&
t
.
IsDelete
==
1
);
if
(
user
==
null
)
if
(
user
==
null
)
throw
new
PerformanceException
(
$"
“
{
request
.
Account
}
”用户不存在
"
);
throw
new
PerformanceException
(
$"
用户或密码错误
"
);
//MD5小写加密
//MD5小写加密
request
.
Password
=
PwdHelper
.
MD5AndSalt
(
request
.
Password
);
request
.
Password
=
PwdHelper
.
MD5AndSalt
(
request
.
Password
);
if
(!
user
.
Password
.
Equals
(
request
.
Password
,
StringComparison
.
OrdinalIgnoreCase
))
if
(!
user
.
Password
.
Equals
(
request
.
Password
,
StringComparison
.
OrdinalIgnoreCase
))
throw
new
PerformanceException
(
$"密码错误"
);
throw
new
PerformanceException
(
$"
用户或
密码错误"
);
var
data
=
_mapper
.
Map
<
UserIdentity
>(
user
);
var
data
=
_mapper
.
Map
<
UserIdentity
>(
user
);
data
.
Token
=
Guid
.
NewGuid
().
ToString
(
"N"
);
data
.
Token
=
Guid
.
NewGuid
().
ToString
(
"N"
);
return
data
;
return
data
;
}
}
throw
new
PerformanceException
(
$"
登录类型LoginType:
{
request
.
LoginType
}
暂不支持
"
);
throw
new
PerformanceException
(
$"
用户或密码错误
"
);
}
}
public
UserIdentity
GetUser
(
int
userId
)
public
UserIdentity
GetUser
(
int
userId
)
...
...
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