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
145c8e0e
Commit
145c8e0e
authored
May 22, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
58c677d2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
9 deletions
+35
-9
center-manage/app/base/controller/impl/auth/userCtl.js
+1
-1
center-manage/app/base/db/cache/codeCache.js
+27
-0
center-manage/app/base/service/impl/auth/userSve.js
+6
-7
center-manage/app/base/service/impl/common/appSve.js
+1
-1
No files found.
center-manage/app/base/controller/impl/auth/userCtl.js
View file @
145c8e0e
...
...
@@ -13,7 +13,7 @@ class UserCtl extends CtlBase {
return
system
.
getResult
(
rtn
)
}
async
loginApp
(
pobj
,
qobj
,
req
){
let
appkey
=
pobj
.
appk
ey
let
appkey
=
pobj
.
fromAppK
ey
let
uname
=
pobj
.
username
let
rtn
=
await
this
.
service
.
loginApp
(
appkey
,
uname
)
return
system
.
getResult
(
rtn
);
...
...
center-manage/app/base/db/cache/codeCache.js
0 → 100644
View file @
145c8e0e
const
CacheBase
=
require
(
"../cache.base"
);
const
system
=
require
(
"../../system"
);
const
settings
=
require
(
"../../../config/settings"
);
class
CodeCache
extends
CacheBase
{
constructor
(){
super
();
this
.
userDao
=
system
.
getObject
(
"db.auth.userDao"
);
}
isdebug
(){
return
false
// return settings.env=="dev";
}
desc
(){
return
"缓存code子系统用户登录信息对象"
;
}
prefix
(){
return
"g_code_userlocal_"
}
async
buildCacheVal
(
cachekey
,
inputkey
,
val
,
ex
,
...
items
)
{
if
(
val
)
{
return
JSON
.
stringify
(
val
);
}
return
null
;
}
}
module
.
exports
=
CodeCache
;
\ No newline at end of file
center-manage/app/base/service/impl/auth/userSve.js
View file @
145c8e0e
...
...
@@ -10,18 +10,17 @@ class UserService extends ServiceBase {
this
.
authS
=
system
.
getObject
(
"service.auth.authSve"
);
}
async
pmgetUserByCode
(
code
){
let
ux
=
await
this
.
cacheManager
[
"
User
Cache"
].
getCache
(
code
);
let
ux
=
await
this
.
cacheManager
[
"
Code
Cache"
].
getCache
(
code
);
return
ux
;
}
async
loginApp
(
appkey
,
uname
){
let
rtn
=
{}
let
app
=
await
this
.
cacheManager
[
"AppCache"
].
cache
(
appkey
);
let
url
=
app
.
homePage
let
userLogined
=
this
.
cacheManager
[
"UserCache"
].
cache
(
uname
);
let
userLogined
=
await
this
.
cacheManager
[
"UserCache"
].
cache
(
uname
);
rtn
.
user
=
userLogined
if
(
userLogined
)
{
let
token
=
await
self
.
cmakejwt
(
userLogined
.
jwtkey
,
userLogined
.
jwtsecret
,
null
);
let
token
=
await
this
.
cmakejwt
(
userLogined
.
jwtkey
,
userLogined
.
jwtsecret
,
null
);
rtn
.
token
=
token
;
}
let
roleids
=
userLogined
.
Roles
.
map
(
item
=>
{
...
...
@@ -30,9 +29,9 @@ class UserService extends ServiceBase {
let
auths
=
await
this
.
authS
.
findAuthsByRole
(
roleids
)
rtn
.
user
.
access
=
auths
let
code
=
this
.
getUUID
()
this
.
cacheManager
[
"
User
Cache"
].
cache
(
code
,
rtn
,
60000
);
let
url
=
app
.
homePage
+
"?code="
+
code
return
{
url
:
url
};
this
.
cacheManager
[
"
Code
Cache"
].
cache
(
code
,
rtn
,
60000
);
//
let url=app.homePage+"?code="+code
return
{
code
,
homePage
:
app
.
homePage
};
}
//登录后的租户创建属于租户的用户
//需要在控制器里取出公司ID
...
...
center-manage/app/base/service/impl/common/appSve.js
View file @
145c8e0e
...
...
@@ -125,7 +125,7 @@ class AppService extends ServiceBase {
//如果存在functionJSON,那么就需要转换,构建编码路径
if
(
pobj
.
functionJSON
!=
""
)
{
let
funcobjs
=
JSON
.
parse
(
pobj
.
functionJSON
)
await
self
.
translateWithBizCode
(
funcobjs
,
null
)
//
await self.translateWithBizCode(funcobjs,null)
pobj
.
functionJSON
=
JSON
.
stringify
(
funcobjs
)
}
await
self
.
dao
.
update
(
pobj
,
t
)
...
...
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