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
46934cb4
Commit
46934cb4
authored
Aug 04, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pp
parent
770ccfd2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
7 deletions
+25
-7
center-manage/app/base/db/models/auth/user.js
+12
-1
center-manage/app/base/db/models/common/company.js
+10
-3
center-manage/app/base/service/impl/common/channelhandlers/tx.js
+1
-1
center-manage/app/base/system.js
+2
-2
No files found.
center-manage/app/base/db/models/auth/user.js
View file @
46934cb4
...
@@ -20,7 +20,18 @@ module.exports = (db, DataTypes) => {
...
@@ -20,7 +20,18 @@ module.exports = (db, DataTypes) => {
allowNull
:
true
,
allowNull
:
true
,
values
:
Object
.
keys
(
appconfig
.
pdict
.
sex
),
values
:
Object
.
keys
(
appconfig
.
pdict
.
sex
),
},
},
mobile
:
DataTypes
.
STRING
,
// mobile: DataTypes.STRING,
mobile
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
set
(
value
)
{
this
.
setDataValue
(
'mobile'
,
system
.
encryptStr
(
value
));
},
get
()
{
const
resValue
=
system
.
decryptStr
(
this
.
getDataValue
(
'mobile'
));
return
resValue
?
resValue
:
null
;
}
},
mail
:
{
mail
:
{
type
:
DataTypes
.
STRING
,
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
allowNull
:
true
,
...
...
center-manage/app/base/db/models/common/company.js
View file @
46934cb4
const
system
=
require
(
"../../../system"
);
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
appconfig
=
system
.
getSysConfig
();
const
appconfig
=
system
.
getSysConfig
();
module
.
exports
=
(
db
,
DataTypes
)
=>
{
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"company"
,
{
return
db
.
define
(
"company"
,
{
code
:{
//存放简码
code
:
{
//存放简码
type
:
DataTypes
.
STRING
,
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
allowNull
:
true
,
},
},
...
@@ -26,13 +26,20 @@ module.exports = (db, DataTypes) => {
...
@@ -26,13 +26,20 @@ module.exports = (db, DataTypes) => {
phone
:
{
phone
:
{
type
:
DataTypes
.
STRING
,
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
allowNull
:
true
,
set
(
value
)
{
this
.
setDataValue
(
'phone'
,
system
.
encryptStr
(
value
));
},
get
()
{
const
resValue
=
system
.
decryptStr
(
this
.
getDataValue
(
'phone'
));
return
resValue
?
resValue
:
null
;
}
},
},
licenseUrl
:
{
licenseUrl
:
{
type
:
DataTypes
.
STRING
,
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
allowNull
:
true
,
},
},
orgJson
:
DataTypes
.
TEXT
,
//功能清
orgJson
:
DataTypes
.
TEXT
,
//功能清
appids
:
DataTypes
.
STRING
,
appids
:
DataTypes
.
STRING
,
},
{
},
{
paranoid
:
true
,
//假的删除
paranoid
:
true
,
//假的删除
underscored
:
true
,
underscored
:
true
,
...
...
center-manage/app/base/service/impl/common/channelhandlers/tx.js
View file @
46934cb4
...
@@ -60,7 +60,7 @@ class TxHandler {
...
@@ -60,7 +60,7 @@ class TxHandler {
params
.
salesmanOpcode
=
salesmanInfo
.
opath
;
params
.
salesmanOpcode
=
salesmanInfo
.
opath
;
params
.
salesmanId
=
salesmanInfo
.
userId
;
params
.
salesmanId
=
salesmanInfo
.
userId
;
params
.
clerkName
=
salesmanInfo
.
userName
;
params
.
clerkName
=
salesmanInfo
.
userName
;
params
.
clerkPhone
=
s
alesmanInfo
.
mobile
;
params
.
clerkPhone
=
s
ystem
.
encryptStr
(
salesmanInfo
.
mobile
)
;
params
.
servicerCode
=
salesmanInfo
.
compId
params
.
servicerCode
=
salesmanInfo
.
compId
}
}
var
rtn
=
await
rc
.
execPost3
({
"d"
:
params
},
requrl
);
var
rtn
=
await
rc
.
execPost3
({
"d"
:
params
},
requrl
);
...
...
center-manage/app/base/system.js
View file @
46934cb4
...
@@ -304,7 +304,7 @@ class System {
...
@@ -304,7 +304,7 @@ class System {
*/
*/
static
encryptStr
(
opStr
)
{
static
encryptStr
(
opStr
)
{
if
(
!
opStr
)
{
if
(
!
opStr
)
{
return
"
opStr is empty
"
;
return
""
;
}
}
let
keyHex
=
cryptoJS
.
enc
.
Utf8
.
parse
(
settings
.
encrypt_key
);
let
keyHex
=
cryptoJS
.
enc
.
Utf8
.
parse
(
settings
.
encrypt_key
);
let
ivHex
=
cryptoJS
.
enc
.
Utf8
.
parse
(
settings
.
encrypt_secret
.
substring
(
0
,
8
));
let
ivHex
=
cryptoJS
.
enc
.
Utf8
.
parse
(
settings
.
encrypt_secret
.
substring
(
0
,
8
));
...
@@ -317,7 +317,7 @@ class System {
...
@@ -317,7 +317,7 @@ class System {
*/
*/
static
decryptStr
(
opStr
)
{
static
decryptStr
(
opStr
)
{
if
(
!
opStr
)
{
if
(
!
opStr
)
{
return
"
opStr is empty
"
;
return
""
;
}
}
let
keyHex
=
cryptoJS
.
enc
.
Utf8
.
parse
(
settings
.
encrypt_key
);
let
keyHex
=
cryptoJS
.
enc
.
Utf8
.
parse
(
settings
.
encrypt_key
);
let
ivHex
=
cryptoJS
.
enc
.
Utf8
.
parse
(
settings
.
encrypt_secret
.
substring
(
0
,
8
));
let
ivHex
=
cryptoJS
.
enc
.
Utf8
.
parse
(
settings
.
encrypt_secret
.
substring
(
0
,
8
));
...
...
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