Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
蒋勇
zhichan
Commits
5c06e9c5
Commit
5c06e9c5
authored
Jan 12, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
bb87b063
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
+31
-4
center-app/app/base/db/cache/appTokenByHostsCache.js
+10
-4
center-app/app/base/db/impl/dbapp/appDao.js
+21
-0
No files found.
center-app/app/base/db/cache/appTokenByHostsCache.js
View file @
5c06e9c5
...
@@ -15,11 +15,17 @@ class AppTokenByHostsCache extends CacheBase {
...
@@ -15,11 +15,17 @@ class AppTokenByHostsCache extends CacheBase {
return
settings
.
cacheprefix
+
"_accesskey:"
;
return
settings
.
cacheprefix
+
"_accesskey:"
;
}
}
async
buildCacheVal
(
cachekey
,
inputkey
,
val
,
ex
,
...
items
)
{
async
buildCacheVal
(
cachekey
,
inputkey
,
val
,
ex
,
...
items
)
{
var
app_hosts
=
inputkey
;
var
actionBody
=
val
;
if
(
!
app_hosts
)
{
if
(
!
actionBody
)
{
return
system
.
getResult
(
null
,
"app_hosts can not be empty !"
);
return
system
.
getResult
(
null
,
"actionBody can not be empty !"
);
}
var
item
=
null
;
if
(
actionBody
.
reqType
==
"hosts"
)
{
item
=
await
this
.
appDao
.
getItemByHosts
(
actionBody
.
appHosts
);
}
if
(
actionBody
.
reqType
==
"appkey"
)
{
item
=
await
this
.
appDao
.
getItemByAppKey
(
actionBody
.
appkey
,
actionBody
.
secret
);
}
}
var
item
=
await
this
.
appDao
.
getItemByHosts
(
app_hosts
);
if
(
!
item
)
{
if
(
!
item
)
{
return
system
.
getResult
(
null
,
"app_hosts to data is empty !"
);
return
system
.
getResult
(
null
,
"app_hosts to data is empty !"
);
}
}
...
...
center-app/app/base/db/impl/dbapp/appDao.js
View file @
5c06e9c5
...
@@ -24,5 +24,26 @@ class AppDao extends Dao {
...
@@ -24,5 +24,26 @@ class AppDao extends Dao {
raw
:
true
raw
:
true
});
});
}
}
async
getItemByAppKey
(
uapp_key
,
uapp_secret
)
{
return
this
.
model
.
findOne
({
where
:
{
uapp_key
:
uapp_key
,
uapp_secret
:
uapp_secret
},
attributes
:
[
"id"
,
"app_hosts"
,
"app_code"
,
"app_name"
,
"uapp_id"
,
"uapp_key"
,
"uapp_secret"
,
"contact_name"
,
"contact_mobile"
,
"contact_email"
,
"is_enabled"
,
"is_sign"
],
raw
:
true
});
}
}
}
module
.
exports
=
AppDao
;
module
.
exports
=
AppDao
;
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