Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bwallet
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Go
bwallet
Commits
eeb92e15
Commit
eeb92e15
authored
Dec 25, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
d909d3c7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
errno.go
pkg/errno/errno.go
+1
-0
manager.go
routers/api/backend/manager.go
+5
-1
router.go
routers/router.go
+1
-2
No files found.
pkg/errno/errno.go
View file @
eeb92e15
...
...
@@ -133,6 +133,7 @@ var (
ErrDeleteUser
=
&
Errno
{
Code
:
20105
,
Message
:
"The user delete error."
}
ErrExistUser
=
&
Errno
{
Code
:
20106
,
Message
:
"The user already exists."
}
ErrDeleteSelf
=
&
Errno
{
Code
:
20105
,
Message
:
"The user can not delete yourself."
}
ErrUpdateSelf
=
&
Errno
{
Code
:
20105
,
Message
:
"The user can not modify yourself."
}
ErrPasswordIncorrect
=
&
Errno
{
Code
:
20107
,
Message
:
"The password was incorrect."
}
ErrUserAuthIncorrect
=
&
Errno
{
Code
:
40001
,
Message
:
"The user auth was incorrect."
}
ErrUserTokenIncorrect
=
&
Errno
{
Code
:
40001
,
Message
:
"The user token was incorrect."
}
...
...
routers/api/backend/manager.go
View file @
eeb92e15
...
...
@@ -151,6 +151,10 @@ func EditManager(c *gin.Context) {
var
platform_id
int32
platform_id
=
int32
(
user
.
UserInfo
.
PlatformId
)
if
user
.
UserInfo
.
Group
==
manager
.
Group
{
handler
.
SendResponse
(
c
,
errno
.
ErrUserAuthIncorrect
,
nil
)
return
}
if
"admin"
==
group
&&
platform_id
!=
manager
.
PlatformId
{
handler
.
SendResponse
(
c
,
errno
.
ErrUserAuthIncorrect
,
nil
)
...
...
@@ -165,7 +169,7 @@ func EditManager(c *gin.Context) {
manager_service
.
Status
=
manager_params
.
Status
err
=
manager_service
.
Edit
()
if
err
!=
nil
{
handler
.
SendResponse
(
c
,
errno
.
Err
DeleteUser
,
nil
)
handler
.
SendResponse
(
c
,
errno
.
Err
UpdateSelf
,
nil
)
return
}
...
...
routers/router.go
View file @
eeb92e15
...
...
@@ -3,7 +3,6 @@ package routers
import
(
"bwallet/middleware/jwt"
"bwallet/middleware/log"
"bwallet/middleware/sign/aes"
"bwallet/pkg/e"
"github.com/gin-gonic/gin"
...
...
@@ -29,7 +28,7 @@ func InitRouter() *gin.Engine {
client
:=
r
.
Group
(
"/interface"
)
client
.
Use
(
aes
.
Aes
())
//
client.Use(aes.Aes())
client
.
GET
(
"/news"
,
app
.
GetNews
)
client
.
GET
(
"/one-news"
,
app
.
GetOneNews
)
client
.
GET
(
"/articles"
,
app
.
GetArticle
)
...
...
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