Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
方斌
51business
Commits
d2508e1e
Commit
d2508e1e
authored
Jul 07, 2023
by
董加伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
还原
parent
c879f4e3
Pipeline
#48933
passed with stage
in 3 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
57 deletions
+7
-57
response.js
app/controller/response.js
+2
-9
helper.js
app/extend/helper.js
+0
-31
config.local.js
config/config.local.js
+5
-17
No files found.
app/controller/response.js
View file @
d2508e1e
'use strict'
;
'use strict'
;
const
Controller
=
require
(
'egg'
).
Controller
;
const
Controller
=
require
(
'egg'
).
Controller
;
const
moment
=
require
(
'moment'
);
class
ResponseController
extends
Controller
{
class
ResponseController
extends
Controller
{
...
@@ -22,7 +21,7 @@ class ResponseController extends Controller {
...
@@ -22,7 +21,7 @@ class ResponseController extends Controller {
ctx
.
validate
(
rule
,
input_params
);
ctx
.
validate
(
rule
,
input_params
);
if
(
input_params
.
user_token
)
{
if
(
input_params
.
user_token
)
{
const
rule
=
{
const
rule
=
{
auth_token
:
{
type
:
'string'
,
required
:
false
},
auth_token
:
{
type
:
'string'
},
user_sid
:
{
type
:
'string'
},
user_sid
:
{
type
:
'string'
},
};
};
ctx
.
validate
(
rule
,
input_params
);
ctx
.
validate
(
rule
,
input_params
);
...
@@ -63,12 +62,10 @@ class ResponseController extends Controller {
...
@@ -63,12 +62,10 @@ class ResponseController extends Controller {
}
}
}
}
// 判断user_sid 和 app_user_id
// 判断user_sid 和 app_user_id
let
oid
=
''
;
if
(
app_user_id
)
{
if
(
app_user_id
)
{
const
result
=
await
ctx
.
helper
.
send_request
(
this
.
config
.
USER_CENTER_API_URI
+
'/v1/appusers/'
+
app_user_id
,
{},
{
method
:
'GET'
,
dataType
:
'json'
});
const
result
=
await
ctx
.
helper
.
send_request
(
this
.
config
.
USER_CENTER_API_URI
+
'/v1/appusers/'
+
app_user_id
,
{},
{
method
:
'GET'
,
dataType
:
'json'
});
const
ret_appuid
=
result
.
status
===
200
?
result
.
data
:
{};
const
ret_appuid
=
result
.
status
===
200
?
result
.
data
:
{};
this
.
logger
.
info
(
`user:
${
user_sid
}
, appuid:
${
app_user_id
}
, ret:
${
JSON
.
stringify
(
ret_appuid
)}
`
);
this
.
logger
.
info
(
`user:
${
user_sid
}
, appuid:
${
app_user_id
}
, ret:
${
JSON
.
stringify
(
ret_appuid
)}
`
);
oid
=
ret_appuid
.
oid
;
if
(
this
.
ctx
.
helper
.
encodeUserSid
(
ret_appuid
.
oid
)
==
user_sid
)
{
if
(
this
.
ctx
.
helper
.
encodeUserSid
(
ret_appuid
.
oid
)
==
user_sid
)
{
if
(
token
&&
user_id
&&
app_user_id
&&
device_id
&&
device_login_id
)
{
if
(
token
&&
user_id
&&
app_user_id
&&
device_id
&&
device_login_id
)
{
ctx
.
redirect
(
target_url2
);
ctx
.
redirect
(
target_url2
);
...
@@ -139,17 +136,13 @@ class ResponseController extends Controller {
...
@@ -139,17 +136,13 @@ class ResponseController extends Controller {
node_user_center_login_ret
.
device_id
=
device_login_data
.
device_id
;
node_user_center_login_ret
.
device_id
=
device_login_data
.
device_id
;
node_user_center_login_ret
.
device_login_id
=
device_login_data
.
device_login_logs_id
;
node_user_center_login_ret
.
device_login_id
=
device_login_data
.
device_login_logs_id
;
}
}
if
(
user_sid
&&
this
.
ctx
.
helper
.
encodeUserIdNew
(
oid
)
!==
user_sid
)
{
node_user_center_login_ret
.
jianbing_customer_id
=
this
.
ctx
.
helper
.
encodeUserIdNew
(
user_sid
);
node_user_center_login_ret
.
auth_token
=
ctx
.
helper
.
md5
(
String
(
node_user_center_login_ret
.
jianbing_customer_id
)
+
moment
(
new
Date
()).
format
(
'MDYYYY'
)
+
'f74jkdsy83sjf'
,
'utf8'
);
}
const
expire
=
7200
*
1000
;
const
expire
=
7200
*
1000
;
const
date
=
new
Date
();
const
date
=
new
Date
();
for
(
const
key
in
node_user_center_login_ret
)
{
for
(
const
key
in
node_user_center_login_ret
)
{
const
value
=
node_user_center_login_ret
[
key
];
const
value
=
node_user_center_login_ret
[
key
];
// const exist_value = ctx.cookies.get(key, { signed: false });
// const exist_value = ctx.cookies.get(key, { signed: false });
// if (!exist_value) {
// if (!exist_value) {
ctx
.
logger
.
info
(
JSON
.
stringify
({
key
,
value
,
phone
}));
ctx
.
cookies
.
set
(
key
,
value
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
ctx
.
cookies
.
set
(
key
,
value
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
// }
// }
}
}
...
...
app/extend/helper.js
View file @
d2508e1e
...
@@ -524,37 +524,6 @@ module.exports = {
...
@@ -524,37 +524,6 @@ module.exports = {
return
rtn
;
return
rtn
;
},
},
encodeUserIdNew
(
userId
)
{
const
rand
=
'OU1WjLvZCrRJ7Yo0gE2XDjuuaSAUuaH1bhHPuMymcdfEeKz0igRhXQkMuLTm1'
;
const
randKey
=
2019
;
let
rtn
=
''
;
const
code
=
userId
<<
2
;
const
randLength
=
11
;
const
len
=
String
(
code
).
length
;
const
codeLen
=
rand
.
slice
(
0
,
randLength
);
const
codeNums
=
rand
.
slice
(
randLength
,
randLength
+
12
);
const
codeExt
=
rand
.
slice
(
randLength
+
12
,
rand
.
length
);
const
begin
=
codeLen
.
slice
(
len
-
1
,
len
);
const
ext
=
randLength
-
len
-
1
;
let
temp
=
String
(
Math
.
floor
(
code
/
randKey
)).
replace
(
'.'
,
''
);
temp
=
temp
.
slice
(
-
ext
);
const
arrExtTemp
=
codeExt
.
split
(
''
);
const
arrExt
=
temp
.
split
(
''
);
for
(
const
v
of
arrExt
)
{
rtn
+=
arrExtTemp
[
v
];
}
const
arrNumsTemp
=
codeNums
.
split
(
''
);
const
arrNums
=
String
(
code
).
split
(
''
);
for
(
const
v
of
arrNums
)
{
rtn
+=
arrNumsTemp
[
v
];
}
rtn
=
String
(
userId
).
slice
(
0
,
5
)
+
begin
+
rtn
;
return
rtn
;
},
// aes加密
// aes加密
async
cipherByAES
(
data
)
{
async
cipherByAES
(
data
)
{
...
...
config/config.local.js
View file @
d2508e1e
...
@@ -64,18 +64,6 @@ module.exports = appInfo => {
...
@@ -64,18 +64,6 @@ module.exports = appInfo => {
port
:
3306
,
port
:
3306
,
},
},
{
{
// 公积金数据库
timezone
:
'+08:00'
,
delegate
:
'gjjModel'
,
baseDir
:
'model/gjj'
,
dialect
:
'mysql'
,
host
:
'rm-bp1mnwmta5778y0d3jo.mysql.rds.aliyuncs.com'
,
database
:
'uatgjj'
,
username
:
'uatgjj'
,
password
:
'jianbingUATsljwd'
,
port
:
3306
,
},
{
// 东八时区
// 东八时区
timezone
:
'+08:00'
,
timezone
:
'+08:00'
,
delegate
:
'realestateModel'
,
delegate
:
'realestateModel'
,
...
@@ -83,7 +71,7 @@ module.exports = appInfo => {
...
@@ -83,7 +71,7 @@ module.exports = appInfo => {
// other sequelize configurations
// other sequelize configurations
dialect
:
'mysql'
,
dialect
:
'mysql'
,
host
:
'rm-bp1mnwmta5778y0d3jo.mysql.rds.aliyuncs.com'
,
host
:
'rm-bp1mnwmta5778y0d3jo.mysql.rds.aliyuncs.com'
,
database
:
'realestate_
uat
'
,
database
:
'realestate_
dev
'
,
username
:
'realestate'
,
username
:
'realestate'
,
password
:
'ppD1sDSutHG83T2s1Ue3k'
,
password
:
'ppD1sDSutHG83T2s1Ue3k'
,
port
:
3306
,
port
:
3306
,
...
@@ -96,9 +84,9 @@ module.exports = appInfo => {
...
@@ -96,9 +84,9 @@ module.exports = appInfo => {
// other sequelize configurations
// other sequelize configurations
dialect
:
'mysql'
,
dialect
:
'mysql'
,
host
:
'rm-bp1mnwmta5778y0d3jo.mysql.rds.aliyuncs.com'
,
host
:
'rm-bp1mnwmta5778y0d3jo.mysql.rds.aliyuncs.com'
,
database
:
'
uat
huodong'
,
database
:
'
dev
huodong'
,
username
:
'
uat
huodong'
,
username
:
'
dev
huodong'
,
password
:
'jianbing
UATsljwd2016
'
,
password
:
'jianbing
2014GG
'
,
port
:
3306
,
port
:
3306
,
},
},
{
{
...
@@ -109,7 +97,7 @@ module.exports = appInfo => {
...
@@ -109,7 +97,7 @@ module.exports = appInfo => {
// other sequelize configurations
// other sequelize configurations
dialect
:
'mysql'
,
dialect
:
'mysql'
,
host
:
'rm-bp1mnwmta5778y0d3jo.mysql.rds.aliyuncs.com'
,
host
:
'rm-bp1mnwmta5778y0d3jo.mysql.rds.aliyuncs.com'
,
database
:
'prometheus_
uat
'
,
database
:
'prometheus_
dev
'
,
username
:
'prometheus'
,
username
:
'prometheus'
,
password
:
'q9t8Ay4qIUW4sw3s25K28'
,
password
:
'q9t8Ay4qIUW4sw3s25K28'
,
port
:
3306
,
port
:
3306
,
...
...
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