Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
geeetacsufbo1
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
geeetacsufbo1
Commits
e64fa705
Commit
e64fa705
authored
Sep 07, 2019
by
ratel group
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
node server
parent
36539bf3
Pipeline
#841
canceled with stages
Changes
2
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6698 additions
and
0 deletions
+6698
-0
geetest-http-server.js
node_server/geetest-http-server.js
+63
-0
geetest.6.0.9.js
node_server/geetest.6.0.9.js
+6635
-0
No files found.
node_server/geetest-http-server.js
0 → 100644
View file @
e64fa705
var
http
=
require
(
"http"
);
var
geetest
=
require
(
"./geetest.6.0.9.js"
);
var
url
=
require
(
'url'
);
http
.
createServer
(
function
(
request
,
response
)
{
// 发送 HTTP 头部
// HTTP 状态值: 200 : OK
// 内容类型: text/plain
response
.
writeHead
(
200
,
{
'Content-Type'
:
'application/json;charset=utf8'
});
var
params
=
url
.
parse
(
request
.
url
,
true
).
query
;
var
num
=
params
.
num
;
var
body
=
{};
if
(
params
.
fun
===
'Literal'
)
{
if
(
params
.
type
==
'R8z'
)
{
var
value
=
geetest
.
R8z
(
num
);
console
.
log
(
"转化:R8z 参数 "
+
num
+
" 结果: "
+
value
);
body
.
value
=
value
;
body
.
type
=
typeof
value
;
}
else
if
(
params
.
type
==
'C8z'
)
{
var
value
=
geetest
.
C8z
(
num
);
console
.
log
(
"转化:C8z 参数 "
+
num
+
" 结果: "
+
value
);
body
.
value
=
value
;
body
.
type
=
typeof
value
;
}
response
.
end
(
JSON
.
stringify
(
body
));
}
else
if
(
params
.
fun
==
'compare'
)
{
console
.
log
(
"request compare:"
+
request
.
url
);
//f2Z.V2Z()[36][30][6]
var
num1
=
params
.
id1
.
split
(
"_"
);
var
num2
=
params
.
id2
.
split
(
"_"
);
var
ret
;
if
(
getState
(
num1
)
==
getState
(
num2
))
{
ret
=
"true"
;
}
else
{
ret
=
"false"
;
}
console
.
log
(
"compare result: "
+
ret
);
response
.
end
(
ret
);
}
}).
listen
(
8889
);
function
getState
(
state
)
{
var
root
=
geetest
.
k9r
();
for
(
var
i
in
state
)
{
root
=
root
[
parseInt
(
state
[
i
])];
}
return
root
;
}
console
.
log
(
'Server running at http://127.0.0.1:8889/'
);
node_server/geetest.6.0.9.js
0 → 100755
View file @
e64fa705
This diff is collapsed.
Click to expand it.
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