Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
kefu_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3cf11d81
authored
Mar 11, 2020
by
keith
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
app_secret
parent
211eb670
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
10 deletions
controllers/auth_controller.go
controllers/auth_controller.go
View file @
3cf11d81
...
...
@@ -151,8 +151,6 @@ func (c *AuthController) Logout() {
// RobotFetchTokenRequest struct
type
RobotFetchTokenRequest
struct
{
AppID
string
`json:"app_id"`
AppKey
string
`json:"app_key"`
AppSecret
string
`json:"app_secret"`
}
...
...
@@ -166,8 +164,6 @@ func (c *AuthController) RobotFetchToken() {
// valid
valid
:=
validation
.
Validation
{}
valid
.
Required
(
request
.
AppID
,
"app_id"
)
.
Message
(
"app_id不能为空!"
)
valid
.
Required
(
request
.
AppKey
,
"app_key"
)
.
Message
(
"app_key不能为空!"
)
valid
.
Required
(
request
.
AppSecret
,
"app_secret"
)
.
Message
(
"app_secret不能为空!"
)
if
valid
.
HasErrors
()
{
for
_
,
err
:=
range
valid
.
Errors
{
...
...
@@ -175,11 +171,6 @@ func (c *AuthController) RobotFetchToken() {
}
}
// MD5
m5
:=
md5
.
New
()
m5
.
Write
([]
byte
(
request
.
AppID
+
request
.
AppKey
+
request
.
AppSecret
))
reqyestSecret
:=
hex
.
EncodeToString
(
m5
.
Sum
(
nil
))
// current app Secret
_AppID
,
_
:=
beego
.
AppConfig
.
Int64
(
"mimc_appId"
)
_AppKey
:=
beego
.
AppConfig
.
String
(
"mimc_appKey"
)
...
...
@@ -189,7 +180,7 @@ func (c *AuthController) RobotFetchToken() {
currentAppSecret
:=
hex
.
EncodeToString
(
m51
.
Sum
(
nil
))
// check
if
req
yest
Secret
!=
currentAppSecret
{
if
req
uest
.
App
Secret
!=
currentAppSecret
{
c
.
JSON
(
configs
.
ResponseFail
,
"server error~"
,
nil
)
}
...
...
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