Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pisns-forum-api
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
scrmGroup
pisns-forum-api
Commits
7cfc3603
Commit
7cfc3603
authored
Aug 16, 2016
by
陈家荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新经验缓存
parent
13117654
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
util.js
app/utils/util.js
+5
-3
No files found.
app/utils/util.js
View file @
7cfc3603
...
@@ -135,9 +135,11 @@ function loadLevelFromAPI(ent_code,open_id,callback){
...
@@ -135,9 +135,11 @@ function loadLevelFromAPI(ent_code,open_id,callback){
return
callback
&&
callback
(
null
,
null
);
return
callback
&&
callback
(
null
,
null
);
}
}
var
key
=
'pisns-forum-thread:'
+
ent_code
+
':'
+
open_id
+
':exp'
;
var
key
=
'pisns-forum-thread:'
+
ent_code
+
':'
+
open_id
+
':exp'
;
redis
.
get
(
key
,
function
(
err
,
value
){
redis
.
get
(
key
,
function
(
err
,
value
){
if
(
value
)
{
if
(
value
)
{
return
callback
&&
callback
(
null
,
value
||
null
);
var
result
=
JSON
.
parse
(
value
);
return
callback
&&
callback
(
null
,
result
||
null
);
}
else
{
}
else
{
var
url
=
API_ADDRESS
+
'/v1.0/internal/member/exp/byopenid?openId='
+
open_id
+
'&entCode='
+
ent_code
;
var
url
=
API_ADDRESS
+
'/v1.0/internal/member/exp/byopenid?openId='
+
open_id
+
'&entCode='
+
ent_code
;
request
.
get
({
request
.
get
({
...
@@ -147,8 +149,8 @@ function loadLevelFromAPI(ent_code,open_id,callback){
...
@@ -147,8 +149,8 @@ function loadLevelFromAPI(ent_code,open_id,callback){
if
(
e
)
{
if
(
e
)
{
console
.
log
(
e
)
console
.
log
(
e
)
}
}
if
(
body
&&
body
.
data
){
if
(
body
&&
body
.
data
){
redis
.
set
(
key
,
body
.
data
);
redis
.
set
(
key
,
JSON
.
stringify
(
body
.
data
)
);
redis
.
expire
(
key
,
2
*
60
);
redis
.
expire
(
key
,
2
*
60
);
}
}
return
callback
&&
callback
(
null
,(
body
&&
body
.
data
)
||
null
);
return
callback
&&
callback
(
null
,(
body
&&
body
.
data
)
||
null
);
...
...
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