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
4e7e7dbe
Commit
4e7e7dbe
authored
Dec 27, 2021
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config
parent
49dcfd06
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
center-manage/app/base/service/impl/auth/userSve.js
+9
-0
center-manage/app/config/environment.js
+17
-0
No files found.
center-manage/app/base/service/impl/auth/userSve.js
View file @
4e7e7dbe
...
...
@@ -145,6 +145,7 @@ class UserService extends ServiceBase {
var
self
=
this
;
//先要按照用户名,在统一账户中查找存在性
//如果不存在
if
(
settings
.
env
!=
"dev"
){
console
.
log
(
UserService
.
consumerUrl
(
p
.
userName
))
let
consumer
=
await
this
.
cget
(
UserService
.
consumerUrl
(
p
.
userName
));
if
(
!
consumer
.
data
)
{
...
...
@@ -158,6 +159,9 @@ class UserService extends ServiceBase {
return
null
;
}
}
}
var
rtn
=
{}
return
this
.
db
.
transaction
(
async
function
(
t
)
{
//从缓存中取得
...
...
@@ -168,8 +172,13 @@ class UserService extends ServiceBase {
// });
let
userfind
=
await
self
.
cacheManager
[
"UserCache"
].
cache
(
p
.
userName
)
if
(
userfind
)
{
if
(
settings
.
env
!=
"dev"
){
let
token
=
await
self
.
cmakejwt
(
userfind
.
jwtkey
,
userfind
.
jwtsecret
,
null
);
rtn
.
token
=
token
;
}
else
{
rtn
.
token
=
p
.
userName
;
}
let
roleids
=
userfind
.
Roles
.
map
(
item
=>
{
return
item
.
id
...
...
center-manage/app/config/environment.js
View file @
4e7e7dbe
...
...
@@ -19,8 +19,25 @@ module.exports = function (app) {
app
.
use
(
bodyParser
.
json
({
limit
:
'50mb'
}));
app
.
use
(
bodyParser
.
urlencoded
({
limit
:
'50mb'
,
extended
:
true
}));
routes
(
app
);
//初始化路由
app
.
use
(
history
());
app
.
use
(
express
.
static
(
path
.
join
(
settings
.
basepath
,
'/app/front/entry/public'
)));
app
.
all
(
'*'
,
function
(
req
,
res
,
next
)
{
// res.header('Access-Control-Allow-Origin', '*');
// res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
// res.header("P3P","CP=CAO PSA OUR");
// res.header('Access-Control-Allow-Credentials', 'true');
if
(
req
.
method
==
'OPTIONS'
)
{
res
.
send
(
200
);
}
else
{
next
();
}
});
// development only
if
(
'development'
==
app
.
get
(
'env'
))
{
app
.
use
(
errorHandler
());
...
...
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