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
9e936a75
Commit
9e936a75
authored
Jun 29, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
c4874ae9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
37 additions
and
51 deletions
+37
-51
esign-admin/app/base/api/api.base.js
+0
-10
esign-admin/app/base/api/impl/h5/merchantApi.js
+0
-0
esign-admin/app/base/api/impl/inner/aduserApi.js
+2
-2
esign-admin/app/base/controller/impl/uc/userCtl.js
+16
-32
esign-admin/app/base/db/models/common/oplog.js
+1
-1
esign-admin/app/base/service/impl/uc/userSve.js
+16
-0
esign-admin/app/base/system.js
+1
-1
esign-admin/app/config/routes/web.js
+1
-5
No files found.
esign-admin/app/base/api/api.base.js
View file @
9e936a75
...
...
@@ -9,18 +9,8 @@ class APIBase extends DocBase {
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
this
.
logCtl
=
system
.
getObject
(
"web.common.oplogCtl"
);
this
.
oplogSve
=
system
.
getObject
(
"service.common.oplogSve"
);
this
.
merchantappletuserSve
=
system
.
getObject
(
"service.uc.merchantappletuserSve"
);
}
async
getLoginUser
(
merchant_id
,
openid
,
forceUpdate
)
{
return
await
this
.
merchantappletuserSve
.
getLoginUser
({
merchant_id
:
merchant_id
,
openid
:
openid
,
forceUpdate
:
forceUpdate
});
}
async
getMerchant
(
merchant_id
)
{
return
await
this
.
merchantSve
.
getMerchantWithCache
({
id
:
merchant_id
,
forceUpdate
:
true
});
}
getUUID
()
{
var
uuid
=
uuidv4
();
var
u
=
uuid
.
replace
(
/
\-
/g
,
""
);
...
...
esign-admin/app/base/api/impl/h5/merchantApi.js
deleted
100644 → 0
View file @
c4874ae9
This diff is collapsed.
Click to expand it.
esign-admin/app/base/api/impl/inner/aduserApi.js
View file @
9e936a75
...
...
@@ -5,8 +5,8 @@ class ADUserAPI extends APIBase {
super
();
this
.
userSve
=
system
.
getObject
(
"service.uc.userSve"
);
}
async
registerInn
er
(
pobj
,
query
,
req
)
{
var
result
=
await
this
.
userSve
.
registerInn
er
(
pobj
);
async
addAdminUs
er
(
pobj
,
query
,
req
)
{
let
result
=
await
this
.
userSve
.
saveAdminUs
er
(
pobj
);
return
result
;
}
async
resetPasswordInner
(
pobj
,
query
,
req
)
{
...
...
esign-admin/app/base/controller/impl/uc/userCtl.js
View file @
9e936a75
...
...
@@ -16,33 +16,18 @@ class UserCtl extends CtlBase {
var
loginName
=
this
.
trim
(
pobj
.
loginName
);
var
password
=
this
.
trim
(
pobj
.
password
);
try
{
var
loginUser
=
await
this
.
userSve
.
login
({
let
loginUser
=
await
this
.
userSve
.
login
({
ucname
:
loginName
,
password
:
password
,
uctype
:
1
,
});
if
(
loginUser
.
status
!=
0
)
{
return
loginUser
;
}
loginUser
=
loginUser
.
data
;
let
channel
=
await
this
.
merchantSve
.
info
({
id
:
loginUser
.
saas_merchant_id
});
if
(
channel
.
status
!=
0
)
{
return
system
.
getResult
(
null
,
`渠道【
${
loginName
}
】不存在`
);
}
channel
=
channel
.
data
;
loginUser
.
contact_man
=
channel
.
contact_man
;
loginUser
.
contact_mobile
=
channel
.
contact_mobile
;
loginUser
.
contact_email
=
channel
.
contact_email
;
loginUser
.
contact_addr
=
channel
.
contact_addr
;
var
loginsid
=
await
this
.
setLogin
(
loginUser
);
let
rs
=
{
key
:
loginsid
,
loginname
:
loginUser
.
ucname
,
menus
:
await
this
.
getMenu
(
loginUser
)
};
let
rs
=
this
.
loginDTO
(
loginUser
)
rs
.
key
=
await
this
.
setLogin
(
loginUser
);
return
system
.
getResultSuccess
(
rs
);
}
catch
(
error
)
{
console
.
log
(
error
);
...
...
@@ -51,10 +36,10 @@ class UserCtl extends CtlBase {
}
async
setLogin
(
user
)
{
let
loginsid
=
"
saasmcth
_"
+
uuidv4
();
//
if (settings.env = "dev") {
// loginsid = "saasmcth
_" + "2cb49932-fa02-44f0-90db-9f06fe02e5c7";
//
}
let
loginsid
=
"
esa
_"
+
uuidv4
();
if
(
settings
.
env
=
"dev"
)
{
loginsid
=
"esa
_"
+
"2cb49932-fa02-44f0-90db-9f06fe02e5c7"
;
}
await
this
.
redisClient
.
setWithEx
(
loginsid
,
JSON
.
stringify
(
user
),
60
*
60
*
5
);
return
loginsid
;
}
...
...
@@ -91,16 +76,15 @@ class UserCtl extends CtlBase {
}
async
currentUser
(
qobj
,
pobj
,
req
)
{
let
saas_merchant_id
=
req
.
loginUser
.
saas_merchant_id
;
if
(
!
saas_merchant_id
){
return
system
.
getResult
(
null
,
`登录失效,请重新登录`
);
}
let
_merchant
=
await
this
.
merchantSve
.
info
({
id
:
saas_merchant_id
});
if
(
_merchant
.
status
!=
0
){
return
system
.
getResult
(
null
,
`商户不存在`
);
return
system
.
getResultSuccess
(
this
.
loginDTO
(
req
.
loginUser
));
}
loginDTO
(
user
)
{
return
{
loginName
:
user
.
ucname
,
mobile
:
user
.
mobile
,
real_name
:
user
.
real_name
,
}
req
.
loginUser
.
saas_merchant_name
=
_merchant
.
data
.
name
;
return
system
.
getResultSuccess
(
req
.
loginUser
);
}
/**
...
...
esign-admin/app/base/db/models/common/oplog.js
View file @
9e936a75
...
...
@@ -30,7 +30,7 @@ module.exports = (db, DataTypes) => {
updatedAt
:
false
,
//freezeTableName: true,
// define the table's name
tableName
:
'
xgg_
op_log'
,
tableName
:
'op_log'
,
validate
:
{
},
...
...
esign-admin/app/base/service/impl/uc/userSve.js
View file @
9e936a75
...
...
@@ -6,6 +6,22 @@ class UserService extends ServiceBase {
super
();
}
async
saveAdminUser
(
params
)
{
try
{
return
await
this
.
callms
(
"sve_uc"
,
"saveAdminUser"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
saveMerchantUser
(
params
)
{
try
{
return
await
this
.
callms
(
"sve_uc"
,
"saveMerchantUser"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
login
(
params
)
{
try
{
return
await
this
.
callms
(
"sve_uc"
,
"login"
,
params
);
...
...
esign-admin/app/base/system.js
View file @
9e936a75
...
...
@@ -194,7 +194,7 @@ class System {
engine_sign
:
local
+
":3103"
+
path
,
// 用户服务
sve_uc
:
dev
+
":3651"
+
path
,
sve_uc
:
local
+
":3651"
+
path
,
// 商户服务
sve_merchant
:
dev
+
":3103"
+
path
,
// 订单服务
...
...
esign-admin/app/config/routes/web.js
View file @
9e936a75
...
...
@@ -7,7 +7,7 @@ const redisClient = system.getObject("util.redisClient");
module
.
exports
=
function
(
app
)
{
app
.
all
(
"/web/*"
,
async
function
(
req
,
res
,
next
)
{
var
loginsid
;
//
var jsonUser = null;
var
jsonUser
=
null
;
if
(
!
jsonUser
)
{
loginsid
=
req
.
headers
[
"esignadminsid"
]
||
""
;
jsonUser
=
await
redisClient
.
get
(
loginsid
);
...
...
@@ -61,8 +61,6 @@ module.exports = function (app) {
if
(
req
.
loginUser
)
{
req
.
query
=
req
.
query
||
{};
req
.
query
.
saas_id
=
req
.
loginUser
.
saas_id
;
req
.
query
.
saas_merchant_id
=
req
.
loginUser
.
saas_merchant_id
;
}
params
.
push
(
methodName
);
params
.
push
(
req
.
body
);
...
...
@@ -93,8 +91,6 @@ module.exports = function (app) {
req
.
body
.
classname
=
classPath
;
if
(
req
.
loginUser
)
{
req
.
body
.
saas_id
=
req
.
loginUser
.
saas_id
;
req
.
body
.
saas_merchant_id
=
req
.
loginUser
.
saas_merchant_id
;
}
params
.
push
(
methodName
);
...
...
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