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
3e30c458
Commit
3e30c458
authored
Nov 14, 2019
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
7edc4c55
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
36 deletions
+59
-36
.vscode/launch.json
+2
-1
xgg-admin/app/base/controller/impl/auth/userCtl.js
+42
-28
xgg-admin/app/base/db/metadata/apps/platform.js
+1
-1
xgg-admin/app/base/system.js
+2
-2
xgg-admin/app/base/utils/businessManager/opPlatformUtils.js
+1
-1
xgg-admin/app/config/routes/web.js
+1
-0
xgg-admin/app/config/settings.js
+10
-3
No files found.
.vscode/launch.json
View file @
3e30c458
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
"type"
:
"node"
,
"type"
:
"node"
,
"request"
:
"launch"
,
"request"
:
"launch"
,
"name"
:
"Launch Program"
,
"name"
:
"Launch Program"
,
"program"
:
"${workspaceFolder}/
bigdata
/main.js"
"program"
:
"${workspaceFolder}/
xgg-admin
/main.js"
}
}
]
]
}
}
\ No newline at end of file
xgg-admin/app/base/controller/impl/auth/userCtl.js
View file @
3e30c458
...
@@ -13,6 +13,8 @@ class UserCtl extends CtlBase {
...
@@ -13,6 +13,8 @@ class UserCtl extends CtlBase {
super
(
"auth"
,
CtlBase
.
getServiceName
(
UserCtl
));
super
(
"auth"
,
CtlBase
.
getServiceName
(
UserCtl
));
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
this
.
captchaSve
=
system
.
getObject
(
"service.common.captchaSve"
);
this
.
platformUtils
=
system
.
getObject
(
"util.businessManager.opPlatformUtils"
);
}
}
async
smsCode
(
qobj
,
pobj
,
req
)
{
async
smsCode
(
qobj
,
pobj
,
req
)
{
...
@@ -37,40 +39,52 @@ class UserCtl extends CtlBase {
...
@@ -37,40 +39,52 @@ class UserCtl extends CtlBase {
var
captchaCode
=
this
.
trim
(
pobj
.
captchaCode
);
var
captchaCode
=
this
.
trim
(
pobj
.
captchaCode
);
try
{
try
{
var
vrs
=
await
this
.
captchaSve
.
valid
({
key
:
captchaKey
,
code
:
captchaCode
,
});
if
(
vrs
.
status
!==
0
)
{
// return vrs;
}
// TODO 验证图片验证码
// 查用户
// var code = await await this.redisClient.get(this.captchaPrev + captchaKey) || "";
var
loginrs
=
await
this
.
platformUtils
.
login
(
loginName
,
password
);
if
(
loginrs
.
status
!==
0
)
{
return
loginrs
;
}
var
puser
=
loginrs
.
Data
;
// if (!code) {
return
system
.
getResultSuccess
(
puser
);
// return system.getResult(null, "图片验证码过期,请点击重试");
// }
// if (code.toLowerCase() != captchaCode.toLowerCase()) {
// await this.redisClient.delete(this.captchaPrev + pobj.emailKey);
// return system.getResult(null, "图片验证码不一致,请点击重试");
// }
var
adminUser
=
await
this
.
service
.
findOne
({
ucname
:
loginName
});
// this.service.getUserByUserNamePwd({
// var adminUser = await this.service.findById(1);
// userName: loginName,
if
(
!
adminUser
)
{
// password: password,
return
system
.
getResult
(
null
,
"用户名或密码错误"
);
// app_id: settings.app_id
}
// });
var
passwdMD5
=
md5
(
password
);
if
(
passwdMD5
!=
adminUser
.
passwd
)
{
return
system
.
getResult
(
null
,
"用户名或密码错误"
);
}
adminUser
.
lastLoginTime
=
new
Date
();
// var adminUser = await this.service.findOne({
await
adminUser
.
save
();
// ucname: loginName
// });
// // var adminUser = await this.service.findById(1);
// if (!adminUser) {
// return system.getResult(null, "用户名或密码错误");
// }
// var passwdMD5 = md5(password);
// if (passwdMD5 != adminUser.passwd) {
// return system.getResult(null, "用户名或密码错误");
// }
var
xggadminsid
=
uuidv4
();
// adminUser.lastLoginTime = new Date();
xggadminsid
=
"3cb49932-fa02-44f0-90db-9f06fe02e5c7"
;
// await adminUser.save();
await
this
.
redisClient
.
setWithEx
(
xggadminsid
,
JSON
.
stringify
(
adminUser
),
60
*
60
*
2
);
// 处理登录逻辑
var
result
=
{
xggadminsid
:
xggadminsid
,
}
return
system
.
getResultSuccess
(
result
);
// var xggadminsid = uuidv4();
// xggadminsid = "3cb49932-fa02-44f0-90db-9f06fe02e5c7";
// await this.redisClient.setWithEx(xggadminsid, JSON.stringify(adminUser), 60 * 60 * 2);
// // 处理登录逻辑
// var result = {
// xggadminsid: xggadminsid,
// }
// return system.getResultSuccess(result);
}
catch
(
error
)
{
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
"接口异常:"
+
error
.
message
);
return
system
.
getResultFail
(
500
,
"接口异常:"
+
error
.
message
);
}
}
...
...
xgg-admin/app/base/db/metadata/apps/platform.js
View file @
3e30c458
module
.
exports
=
{
module
.
exports
=
{
"appid"
:
"
40d64e586551405c9bcafab87266bb04
"
,
"appid"
:
"
728b979f7afd4413ac683344cd4a97fa
"
,
"label"
:
"研发开放平台"
,
"label"
:
"研发开放平台"
,
"config"
:
{
"config"
:
{
"rstree"
:
{
"rstree"
:
{
...
...
xgg-admin/app/base/system.js
View file @
3e30c458
...
@@ -173,8 +173,8 @@ class System {
...
@@ -173,8 +173,8 @@ class System {
// var domain = "http://127.0.0.1";
// var domain = "http://127.0.0.1";
return
{
return
{
// 公共服务
// 公共服务
common
:
domain
+
":3102"
+
path
,
//
common: domain + ":3102" + path,
//
common: "http://127.0.0.1:3102" + path,
common
:
"http://127.0.0.1:3102"
+
path
,
// 商户服务
// 商户服务
merchant
:
domain
+
":3101"
+
path
,
merchant
:
domain
+
":3101"
+
path
,
...
...
xgg-admin/app/base/utils/businessManager/opPlatformUtils.js
View file @
3e30c458
...
@@ -110,7 +110,7 @@ class OpPlatformUtils {
...
@@ -110,7 +110,7 @@ class OpPlatformUtils {
this
.
loginUrl
,
reqApiAccessKey
.
accessKey
);
this
.
loginUrl
,
reqApiAccessKey
.
accessKey
);
if
(
restResult
.
status
!=
0
||
!
restResult
.
data
)
{
if
(
restResult
.
status
!=
0
||
!
restResult
.
data
)
{
return
system
.
getResult
(
restResult
.
status
,
restResult
.
msg
);
return
system
.
getResult
Fail
(
-
1
,
restResult
.
msg
,
restResult
.
status
);
}
}
return
system
.
getResultSuccess
(
restResult
.
data
);
return
system
.
getResultSuccess
(
restResult
.
data
);
}
}
...
...
xgg-admin/app/config/routes/web.js
View file @
3e30c458
...
@@ -67,6 +67,7 @@ module.exports = function (app) {
...
@@ -67,6 +67,7 @@ module.exports = function (app) {
res
.
end
(
JSON
.
stringify
(
r
));
res
.
end
(
JSON
.
stringify
(
r
));
});
});
});
});
app
.
post
(
'/web/:gname/:qname/:method'
,
function
(
req
,
res
)
{
app
.
post
(
'/web/:gname/:qname/:method'
,
function
(
req
,
res
)
{
var
classPath
=
req
.
params
[
"qname"
];
var
classPath
=
req
.
params
[
"qname"
];
var
methodName
=
req
.
params
[
"method"
];
var
methodName
=
req
.
params
[
"method"
];
...
...
xgg-admin/app/config/settings.js
View file @
3e30c458
...
@@ -19,12 +19,12 @@ var settings = {
...
@@ -19,12 +19,12 @@ var settings = {
passroleid
:
2
,
passroleid
:
2
,
tanentroleid
:
1
,
tanentroleid
:
1
,
protocalPrefix
:
"http://"
,
protocalPrefix
:
"http://"
,
appKey
:
"
40d64e586551405c9bcafab87266bb04
"
,
appKey
:
"
728b979f7afd4413ac683344cd4a97fa
"
,
secret
:
"f
99d413b767f09b5dff0b3610366cc46
"
,
secret
:
"f
8891fcf37574f5a9f21b3030c302f4a
"
,
salt
:
"%iatpD1gcxz7iF#B"
,
salt
:
"%iatpD1gcxz7iF#B"
,
defaultpwd
:
"987456"
,
defaultpwd
:
"987456"
,
basepath
:
path
.
normalize
(
path
.
join
(
__dirname
,
'../..'
)),
basepath
:
path
.
normalize
(
path
.
join
(
__dirname
,
'../..'
)),
port
:
process
.
env
.
NODE_PORT
||
4001
,
port
:
process
.
env
.
NODE_PORT
||
3002
,
reqEsAddr
:
function
()
{
reqEsAddr
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
if
(
this
.
env
==
"dev"
)
{
var
localsettings
=
require
(
"./localsettings"
);
var
localsettings
=
require
(
"./localsettings"
);
...
@@ -33,6 +33,13 @@ var settings = {
...
@@ -33,6 +33,13 @@ var settings = {
return
"http://43.247.184.94:7200/"
;
return
"http://43.247.184.94:7200/"
;
}
}
},
},
paasUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://open.gongsibao.com/"
;
}
else
{
return
"http://open.gongsibao.com/"
;
}
},
apiconfig
:
{
apiconfig
:
{
opLogUrl
:
function
()
{
opLogUrl
:
function
()
{
return
settings
.
reqEsAddr
()
+
"bigdata_zc_op_log/_doc?pretty"
;
return
settings
.
reqEsAddr
()
+
"bigdata_zc_op_log/_doc?pretty"
;
...
...
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