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
2d60d15d
Commit
2d60d15d
authored
Aug 04, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Plain Diff
fix: 合并冲突
parents
0f691553
770ccfd2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
24 deletions
+67
-24
center-manage/app/base/service/impl/auth/userSve.js
+12
-4
center-manage/app/base/service/impl/common/channelhandlers/tx.js
+4
-4
center-manage/app/base/system.js
+46
-15
center-manage/app/config/settings.js
+5
-1
No files found.
center-manage/app/base/service/impl/auth/userSve.js
View file @
2d60d15d
...
...
@@ -420,8 +420,12 @@ class UserService extends ServiceBase {
let
users
=
companyFind
.
us
let
cansels
=
users
.
filter
(
u
=>
{
if
(
regionName
&&
regionName
!=
""
&&
u
.
regiontags
)
{
if
(
u
.
isAllocated
&&
u
.
isSalesman
&&
u
.
skilltags
.
indexOf
(
productCatName
)
>=
0
&&
u
.
regiontags
.
indexOf
(
regionName
)
>=
0
)
{
return
true
if
(
u
.
isAllocated
&&
u
.
isSalesman
&&
u
.
skilltags
.
indexOf
(
productCatName
)
>=
0
)
{
if
(
u
.
regiontags
.
indexOf
(
regionName
)
>=
0
||
u
.
isAllArea
)
{
return
true
}
else
{
return
false
}
}
else
{
return
false
}
...
...
@@ -519,8 +523,12 @@ class UserService extends ServiceBase {
let
users
=
companyFind
.
us
let
cansels
=
users
.
filter
(
u
=>
{
if
(
regionName
&&
regionName
!=
""
&&
u
.
regiontags
)
{
if
(
u
.
isAllocated
&&
u
.
isDelivery
&&
u
.
skilltags
.
indexOf
(
productCatName
)
>=
0
&&
u
.
regiontags
.
indexOf
(
regionName
)
>=
0
)
{
return
true
if
(
u
.
isAllocated
&&
u
.
isDelivery
&&
u
.
skilltags
.
indexOf
(
productCatName
)
>=
0
)
{
if
(
u
.
regiontags
.
indexOf
(
regionName
)
>=
0
||
u
.
isAllArea
)
{
return
true
}
else
{
return
false
}
}
else
{
return
false
}
...
...
center-manage/app/base/service/impl/common/channelhandlers/tx.js
View file @
2d60d15d
...
...
@@ -67,7 +67,7 @@ class TxHandler {
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
console
.
log
(
JSON
.
stringify
(
j
),
"RRRRRRRRRRRRRRR"
);
if
(
j
.
status
==
1
)
{
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
null
,
120000
0
);
//插入redis缓存
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
18
0
);
//插入redis缓存
//给业务员发信息
var
msg
=
{
"title"
:
"你有新的商机,请尽快处理"
,
...
...
@@ -126,7 +126,7 @@ class TxHandler {
var
rtn
=
await
rc
.
execPost3
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
0
)
{
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
null
,
120000
0
);
//插入缓存
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
18
0
);
//插入缓存
//给业务员发信息
var
selUrl
=
this
.
icUrl
+
"/schemeCtl/findInfoByDemandCode"
;
...
...
@@ -422,7 +422,7 @@ class TxHandler {
var
j1
=
JSON
.
parse
(
rtn
.
stdout
);
console
.
log
(
"j1---------------------------------"
+
rtn
.
stdout
);
if
(
j
.
status
==
0
&&
j1
.
status
==
0
)
{
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
null
,
120000
0
);
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
18
0
);
//给业务员发信息
var
msg
=
{
"title"
:
"你有新的交付单,请尽快处理"
,
...
...
@@ -487,7 +487,7 @@ class TxHandler {
var
rtn
=
await
rc
.
execPost3
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
0
)
{
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
null
,
120000
0
);
//插入缓存
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
18
0
);
//插入缓存
//给业务员发信息
var
selUrl
=
this
.
icUrl
+
"/deliverybillCtl/findInfoByDeliverCode"
;
...
...
center-manage/app/base/system.js
View file @
2d60d15d
...
...
@@ -2,8 +2,9 @@ var fs = require("fs");
var
objsettings
=
require
(
"../config/objsettings"
);
var
settings
=
require
(
"../config/settings"
);
const
request
=
require
(
'request'
);
const
cryptoJS
=
require
(
'crypto-js'
);
class
System
{
static
declare
(
ns
)
{
static
declare
(
ns
)
{
var
ar
=
ns
.
split
(
'.'
);
var
root
=
System
;
for
(
var
i
=
0
,
len
=
ar
.
length
;
i
<
len
;
++
i
)
{
...
...
@@ -16,7 +17,7 @@ class System {
}
}
}
static
async
delReq
(
url
,
qdata
)
{
static
async
delReq
(
url
,
qdata
)
{
let
rtn
=
{}
let
promise
=
new
Promise
(
function
(
resv
,
rej
)
{
request
.
del
({
...
...
@@ -39,7 +40,7 @@ class System {
})
return
promise
;
}
static
async
getReq
(
url
,
qdata
)
{
static
async
getReq
(
url
,
qdata
)
{
let
rtn
=
{}
let
promise
=
new
Promise
(
function
(
resv
,
rej
)
{
request
.
get
({
...
...
@@ -62,7 +63,7 @@ class System {
})
return
promise
;
}
static
async
postJsonTypeReq
(
url
,
data
,
md
=
"POST"
)
{
static
async
postJsonTypeReq
(
url
,
data
,
md
=
"POST"
)
{
let
rtn
=
{}
let
promise
=
new
Promise
(
function
(
resv
,
rej
)
{
request
({
...
...
@@ -91,7 +92,7 @@ class System {
})
return
promise
;
}
static
async
post3wFormTypeReq
(
url
,
data
)
{
static
async
post3wFormTypeReq
(
url
,
data
)
{
let
rtn
=
{}
let
promise
=
new
Promise
(
function
(
resv
,
rej
)
{
request
.
post
({
...
...
@@ -110,7 +111,7 @@ class System {
})
return
promise
;
}
static
async
postMpFormTypeReq
(
url
,
formdata
)
{
static
async
postMpFormTypeReq
(
url
,
formdata
)
{
let
promise
=
new
Promise
(
function
(
resv
,
rej
)
{
request
.
post
({
url
:
url
,
...
...
@@ -132,7 +133,7 @@ class System {
* @param {*} okmsg 操作成功的描述
* @param {*} req 请求头信息
*/
static
getResult
(
data
,
opmsg
=
"操作成功"
,
req
)
{
static
getResult
(
data
,
opmsg
=
"操作成功"
,
req
)
{
return
{
status
:
!
data
?
-
1
:
0
,
msg
:
opmsg
,
...
...
@@ -145,7 +146,7 @@ class System {
* @param {*} data 操作成功返回的数据
* @param {*} okmsg 操作成功的描述
*/
static
getResultSuccess
(
data
,
okmsg
=
"success"
)
{
static
getResultSuccess
(
data
,
okmsg
=
"success"
)
{
return
{
status
:
0
,
msg
:
okmsg
,
...
...
@@ -158,7 +159,7 @@ class System {
* @param {*} errmsg 操作失败的描述,默认为fail
* @param {*} data 操作失败返回的数据
*/
static
getResultFail
(
status
=
-
1
,
errmsg
=
"fail"
,
data
=
null
)
{
static
getResultFail
(
status
=
-
1
,
errmsg
=
"fail"
,
data
=
null
)
{
return
{
status
:
status
,
msg
:
errmsg
,
...
...
@@ -170,14 +171,14 @@ class System {
* @param {*} errmsg 操作失败的描述,默认为fail
* @param {*} data 操作失败返回的数据
*/
static
getResultError
(
errmsg
=
"fail"
,
data
=
null
)
{
static
getResultError
(
errmsg
=
"fail"
,
data
=
null
)
{
return
{
status
:
-
200
,
msg
:
errmsg
,
data
:
data
,
};
}
static
register
(
key
,
ClassObj
,
groupName
,
filename
)
{
static
register
(
key
,
ClassObj
,
groupName
,
filename
)
{
if
(
System
.
objTable
[
key
]
!=
null
)
{
throw
new
Error
(
"相同key的对象已经存在"
);
}
else
{
...
...
@@ -192,7 +193,7 @@ class System {
return
System
.
objTable
[
key
];
}
static
getObject
(
objpath
)
{
static
getObject
(
objpath
)
{
var
pathArray
=
objpath
.
split
(
"."
);
var
packageName
=
pathArray
[
0
];
var
groupName
=
pathArray
[
1
];
...
...
@@ -233,7 +234,7 @@ class System {
}
}
static
getSysConfig
()
{
static
getSysConfig
()
{
var
configPath
=
settings
.
basepath
+
"/app/base/db/metadata/index.js"
;
// if(settings.env=="dev"){
// console.log("delete "+configPath+"cache config");
...
...
@@ -243,7 +244,7 @@ class System {
var
configValue
=
require
(
configPath
);
return
configValue
.
config
;
}
static
get_client_ip
(
req
)
{
static
get_client_ip
(
req
)
{
var
ip
=
req
.
headers
[
'x-forwarded-for'
]
||
req
.
ip
||
req
.
connection
.
remoteAddress
||
...
...
@@ -265,7 +266,7 @@ class System {
* @param {*} resultInfo 返回结果
* @param {*} errorInfo 错误信息
*/
static
execLogs
(
opTitle
,
params
,
identifyCode
,
resultInfo
,
errorInfo
)
{
static
execLogs
(
opTitle
,
params
,
identifyCode
,
resultInfo
,
errorInfo
)
{
var
reqUrl
=
settings
.
logUrl
();
let
isLogData
=
true
if
(
params
.
method
&&
(
params
.
method
.
indexOf
(
"find"
)
>=
0
||
params
.
method
.
indexOf
(
"get"
)
>=
0
))
{
...
...
@@ -297,6 +298,36 @@ class System {
}
/**
* 加密信息
* @param {*} opStr
*/
static
encryptStr
(
opStr
)
{
if
(
!
opStr
)
{
return
"opStr is empty"
;
}
let
keyHex
=
cryptoJS
.
enc
.
Utf8
.
parse
(
settings
.
encrypt_key
);
let
ivHex
=
cryptoJS
.
enc
.
Utf8
.
parse
(
settings
.
encrypt_secret
.
substring
(
0
,
8
));
var
cipherStr
=
cryptoJS
.
TripleDES
.
encrypt
(
opStr
,
keyHex
,
{
iv
:
ivHex
}).
toString
();
return
cipherStr
;
}
/**
* 解密信息
* @param {*} opStr
*/
static
decryptStr
(
opStr
)
{
if
(
!
opStr
)
{
return
"opStr is empty"
;
}
let
keyHex
=
cryptoJS
.
enc
.
Utf8
.
parse
(
settings
.
encrypt_key
);
let
ivHex
=
cryptoJS
.
enc
.
Utf8
.
parse
(
settings
.
encrypt_secret
.
substring
(
0
,
8
));
var
bytes
=
cryptoJS
.
TripleDES
.
decrypt
(
opStr
,
keyHex
,
{
iv
:
ivHex
});
var
plaintext
=
bytes
.
toString
(
cryptoJS
.
enc
.
Utf8
);
return
plaintext
;
}
}
Date
.
prototype
.
Format
=
function
(
fmt
)
{
//author: meizz
var
o
=
{
...
...
center-manage/app/config/settings.js
View file @
2d60d15d
...
...
@@ -10,10 +10,14 @@ var ENVINPUT = {
REDIS_PORT
:
process
.
env
.
REDIS_PORT
,
REDIS_PWD
:
process
.
env
.
REDIS_PWD
,
REDIS_DB
:
process
.
env
.
PAAS_REDIS_DB
,
APP_ENV
:
process
.
env
.
APP_ENV
?
process
.
env
.
APP_ENV
:
"localhost"
APP_ENV
:
process
.
env
.
APP_ENV
?
process
.
env
.
APP_ENV
:
"localhost"
,
ENCRYPT_KEY
:
process
.
env
.
ENCRYPT_KEY
?
process
.
env
.
ENCRYPT_KEY
:
"202007211106"
,
ENCRYPT_SECRET
:
process
.
env
.
ENCRYPT_SECRET
?
process
.
env
.
ENCRYPT_SECRET
:
"scbb846246874887b5c7e01cd0816c66"
};
var
settings
=
{
env
:
ENVINPUT
.
APP_ENV
,
encrypt_key
:
ENVINPUT
.
ENCRYPT_KEY
,
encrypt_secret
:
ENVINPUT
.
ENCRYPT_SECRET
,
salt
:
"%iatpD1gcxz7iF#B"
,
defaultpwd
:
"gsb2020"
,
basepath
:
path
.
normalize
(
path
.
join
(
__dirname
,
'../..'
)),
...
...
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