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
70e24bf9
Commit
70e24bf9
authored
Aug 12, 2020
by
v_vjyjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
2ae3ea71
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
center-manage/app/base/controller/ctl.base.js
+11
-9
center-manage/app/base/service/impl/auth/userSve.js
+1
-0
No files found.
center-manage/app/base/controller/ctl.base.js
View file @
70e24bf9
...
...
@@ -8,40 +8,40 @@ class CtlBase {
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
this
.
logClient
=
system
.
getObject
(
"util.logClient"
);
}
getUUID
()
{
getUUID
()
{
var
uuid
=
uuidv4
();
var
u
=
uuid
.
replace
(
/
\-
/g
,
""
);
return
u
;
}
static
getServiceName
(
ClassObj
)
{
static
getServiceName
(
ClassObj
)
{
return
ClassObj
[
"name"
].
substring
(
0
,
ClassObj
[
"name"
].
lastIndexOf
(
"Ctl"
)).
toLowerCase
()
+
"Sve"
;
}
async
update
(
pobj
,
qobj
,
req
)
{
async
update
(
pobj
,
qobj
,
req
)
{
const
up
=
await
this
.
service
.
update
(
pobj
);
return
system
.
getResult
(
up
);
}
async
create
(
pobj
,
qobj
,
req
)
{
async
create
(
pobj
,
qobj
,
req
)
{
const
up
=
await
this
.
service
.
create
(
pobj
);
return
system
.
getResult
(
up
);
}
async
delete
(
pobj
,
qobj
,
req
)
{
async
delete
(
pobj
,
qobj
,
req
)
{
const
up
=
await
this
.
service
.
delete
(
pobj
);
return
system
.
getResult
(
up
);
}
async
findAndCountAll
(
pobj
,
qobj
,
req
)
{
async
findAndCountAll
(
pobj
,
qobj
,
req
)
{
//设置查询条件
console
.
log
(
pobj
)
const
rs
=
await
this
.
service
.
findAndCountAll
(
pobj
);
return
system
.
getResult
(
rs
);
}
async
refQuery
(
pobj
,
qobj
,
req
)
{
async
refQuery
(
pobj
,
qobj
,
req
)
{
//pobj.refwhere.app_id=pobj.app_id;//角色过滤按照公司过滤
pobj
.
refwhere
.
company_id
=
pobj
.
company_id
;
let
rtn
=
await
this
.
service
.
refQuery
(
pobj
);
return
rtn
}
async
setContextParams
(
pobj
,
qobj
,
req
)
{
async
setContextParams
(
pobj
,
qobj
,
req
)
{
let
custtags
=
req
.
headers
[
"x-consumetag"
]
?
req
.
headers
[
"x-consumetag"
].
split
(
"|"
)
:
null
;
let
lastindex
=
custtags
?
custtags
.
length
-
1
:
0
;
//当自由用户注册时,需要根据前端传来的companykey,查询出公司,给companyid赋值
...
...
@@ -65,8 +65,10 @@ class CtlBase {
if
(
req
.
xctx
.
ptags
&&
req
.
xctx
.
ptags
!=
""
)
{
pobj
.
opath
=
req
.
xctx
.
ptags
}
else
{
if
(
!
pobj
.
opath
||
pobj
.
opath
==
""
)
{
pobj
.
opath
=
req
.
xctx
.
opath
}
}
if
(
!
req
.
xctx
.
appkey
)
{
return
[
-
200
,
"请求头缺少应用x-app-key"
]
}
else
{
...
...
@@ -95,7 +97,7 @@ class CtlBase {
pobj
.
bizpath
=
req
.
xctx
.
bizpath
;
}
async
doexec
(
methodname
,
pobj
,
query
,
req
)
{
async
doexec
(
methodname
,
pobj
,
query
,
req
)
{
try
{
let
xarg
=
await
this
.
setContextParams
(
pobj
,
query
,
req
);
if
(
xarg
&&
xarg
[
0
]
<
0
)
{
...
...
center-manage/app/base/service/impl/auth/userSve.js
View file @
70e24bf9
...
...
@@ -371,6 +371,7 @@ class UserService extends ServiceBase {
var
self
=
this
;
return
this
.
db
.
transaction
(
async
function
(
t
)
{
delete
qobj
[
'company_id'
]
//delete qobj['opath']
let
up
=
await
self
.
dao
.
update
(
qobj
,
t
);
//令缓存失效
await
self
.
cacheManager
[
"UserCache"
].
invalidate
(
qobj
.
userName
);
...
...
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