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
ea48a279
Commit
ea48a279
authored
Jul 31, 2020
by
v_vjyjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
st
parent
37da0aee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
40 deletions
+76
-40
bigdata/app/config/routes/web.js
+43
-40
bigdata/app/front/entry/autologin.ejs
+33
-0
No files found.
bigdata/app/config/routes/web.js
View file @
ea48a279
var
url
=
require
(
"url"
);
var
system
=
require
(
"../../base/system"
);
var
metaCtl
=
system
.
getObject
(
"web.common.metaCtl"
);
var
userCtl
=
system
.
getObject
(
"web.auth.userCtl"
);
var
metaCtl
=
system
.
getObject
(
"web.common.metaCtl"
);
var
userCtl
=
system
.
getObject
(
"web.auth.userCtl"
);
module
.
exports
=
function
(
app
)
{
app
.
get
(
"/gtb"
,
async
function
(
req
,
res
){
app
.
get
(
"/autologin"
,
async
function
(
req
,
res
)
{
res
.
render
(
"autologin"
,
{});
});
app
.
get
(
"/gtb"
,
async
function
(
req
,
res
)
{
console
.
log
(
req
.
hostname
);
var
appinfo
=
await
metaCtl
.
getAppInfo
(
req
);
res
.
render
(
"gtb"
,
appinfo
);
var
appinfo
=
await
metaCtl
.
getAppInfo
(
req
);
res
.
render
(
"gtb"
,
appinfo
);
});
app
.
get
(
"/auth"
,
async
function
(
req
,
res
)
{
var
code
=
req
.
query
.
code
;
var
srcKey
=
req
.
query
.
srcKey
;
var
companyKey
=
req
.
query
.
companyKey
;
var
gtb
=
req
.
query
.
gtb
;
if
(
!
code
)
{
if
(
gtb
)
{
app
.
get
(
"/auth"
,
async
function
(
req
,
res
)
{
var
code
=
req
.
query
.
code
;
var
srcKey
=
req
.
query
.
srcKey
;
var
companyKey
=
req
.
query
.
companyKey
;
var
gtb
=
req
.
query
.
gtb
;
if
(
!
code
)
{
if
(
gtb
)
{
return
res
.
redirect
(
"/gtb/#/gtbhome"
);
}
return
res
.
redirect
(
"/"
);
}
else
{
}
else
{
await
userCtl
.
authByCode
(
req
);
if
(
!
companyKey
)
{
res
.
redirect
(
"/admin?appKey="
+
srcKey
);
}
else
{
res
.
redirect
(
"/admin?appKey="
+
srcKey
+
"&companyKey="
+
companyKey
);
if
(
!
companyKey
)
{
res
.
redirect
(
"/admin?appKey="
+
srcKey
);
}
else
{
res
.
redirect
(
"/admin?appKey="
+
srcKey
+
"&companyKey="
+
companyKey
);
}
}
});
app
.
all
(
"/web/*"
,
function
(
req
,
res
,
next
)
{
if
(
req
.
url
.
indexOf
(
"register"
)
>
0
||
req
.
url
.
indexOf
(
"findAllApps"
)
>
0
||
req
.
url
.
indexOf
(
"checkLogin"
)
>
0
||
req
.
url
.
indexOf
(
"findAllApps"
)
>
0
||
req
.
url
.
indexOf
(
"checkLogin"
)
>
0
||
req
.
url
.
indexOf
(
"login"
)
>
0
||
req
.
url
.
indexOf
(
"getApiDoc"
)
>
0
||
req
.
url
.
indexOf
(
"metaCtl"
)
>
0
||
...
...
@@ -52,26 +55,26 @@ module.exports = function (app) {
next
();
}
});
app
.
get
(
"/"
,
async
function
(
req
,
res
)
{
app
.
get
(
"/"
,
async
function
(
req
,
res
)
{
console
.
log
(
req
.
hostname
);
var
appinfo
=
await
metaCtl
.
getAppInfo
(
req
);
res
.
render
(
"index"
,
appinfo
);
var
appinfo
=
await
metaCtl
.
getAppInfo
(
req
);
res
.
render
(
"index"
,
appinfo
);
});
app
.
get
(
"/admin"
,
async
function
(
req
,
res
)
{
var
appinfo
=
await
metaCtl
.
getAppInfo
(
req
);
res
.
render
(
"admin"
,
appinfo
);
app
.
get
(
"/admin"
,
async
function
(
req
,
res
)
{
var
appinfo
=
await
metaCtl
.
getAppInfo
(
req
);
res
.
render
(
"admin"
,
appinfo
);
});
app
.
get
(
'/web/:gname/:qname/:method'
,
function
(
req
,
res
)
{
req
.
codepath
=
req
.
headers
[
"codepath"
];
var
classPath
=
req
.
params
[
"qname"
];
var
methodName
=
req
.
params
[
"method"
];
var
gname
=
req
.
params
[
"gname"
];
classPath
=
gname
+
"."
+
classPath
;
var
methodName
=
req
.
params
[
"method"
];
var
gname
=
req
.
params
[
"gname"
];
classPath
=
gname
+
"."
+
classPath
;
var
params
=
[];
params
.
push
(
methodName
);
params
.
push
(
methodName
);
params
.
push
(
req
.
body
);
params
.
push
(
req
.
query
);
params
.
push
(
req
);
params
.
push
(
req
.
query
);
params
.
push
(
req
);
var
p
=
null
;
var
invokeObj
=
system
.
getObject
(
"web."
+
classPath
);
if
(
invokeObj
[
"doexec"
])
{
...
...
@@ -84,18 +87,18 @@ module.exports = function (app) {
app
.
post
(
'/web/:gname/:qname/:method'
,
function
(
req
,
res
)
{
req
.
codepath
=
req
.
headers
[
"codepath"
];
var
classPath
=
req
.
params
[
"qname"
];
var
methodName
=
req
.
params
[
"method"
];
var
gname
=
req
.
params
[
"gname"
];
var
params
=
[];
classPath
=
gname
+
"."
+
classPath
;
var
methodName
=
req
.
params
[
"method"
];
var
gname
=
req
.
params
[
"gname"
];
var
params
=
[];
classPath
=
gname
+
"."
+
classPath
;
var
tClientIp
=
system
.
get_client_ip
(
req
);
req
.
body
.
clientIp
=
tClientIp
;
req
.
body
.
agent
=
req
.
headers
[
"user-agent"
];
req
.
body
.
classname
=
classPath
;
req
.
body
.
agent
=
req
.
headers
[
"user-agent"
];
req
.
body
.
classname
=
classPath
;
params
.
push
(
methodName
);
params
.
push
(
req
.
body
);
params
.
push
(
req
.
query
);
params
.
push
(
req
);
params
.
push
(
req
.
query
);
params
.
push
(
req
);
var
p
=
null
;
var
invokeObj
=
system
.
getObject
(
"web."
+
classPath
);
if
(
invokeObj
[
"doexec"
])
{
...
...
bigdata/app/front/entry/autologin.ejs
0 → 100644
View file @
ea48a279
<!DOCTYPE html>
<html
lang=
"zh-CN"
>
<head>
<meta
charset=
"utf-8"
>
<script
src=
"/js/vue/axios.min.js"
></script>
<script>
var
data
=
JSON
.
stringify
({
"appkey"
:
"5ae2da88-0ced-4b7a-98ea-60d5e1ff7e2e"
,
"companykey"
:
"5f09cca9607e4beca8e2adef752a1641"
});
var
config
=
{
method
:
'post'
,
url
:
'https://deliver-center.gongsibao.com/autologin'
,
headers
:
{
'Content-Type'
:
'application/json'
},
data
:
data
};
axios
(
config
)
.
then
(
function
(
response
)
{
console
.
log
(
JSON
.
stringify
(
response
.
data
));
window
.
open
(
response
.
data
.
openurl
)
})
.
catch
(
function
(
error
)
{
console
.
log
(
error
);
});
</script>
</head>
<body>
hello
</body>
</html>
\ No newline at end of file
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