Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tax_api
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
data_server
tax_api
Commits
34893d3e
Commit
34893d3e
authored
Mar 15, 2019
by
何娜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete ValidationAPI.js
parent
0f6850e0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
116 deletions
+0
-116
ValidationAPI.js
services/ValidationAPI.js
+0
-116
No files found.
services/ValidationAPI.js
deleted
100644 → 0
View file @
0f6850e0
const
request
=
require
(
'request'
);
const
config
=
require
(
'../config'
);
const
SignHost
=
config
.
SignHost
;
const
signUrl
=
SignHost
+
'/Access/SignValidityCheck'
,
tokenUrl
=
SignHost
+
'/Access/GetToken'
,
orderSnUrl
=
SignHost
+
'/Order/GetOrderSn'
,
getPartner
=
SignHost
+
'/customer/query'
;
/*获取Token*/
exports
.
getToken
=
(
params
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
errMsg
=
{
code
:
3000
,
msg
:
'签名校验服务出错'
};
let
options
=
{
url
:
tokenUrl
,
method
:
'POST'
,
json
:
true
,
body
:
params
,
headers
:
{
'content-type'
:
'application/json'
}
};
request
(
options
,
(
e
,
r
,
b
)
=>
{
if
(
e
)
{
console
.
error
(
'[func getToken]'
,
params
,
e
);
resolve
(
errMsg
);
}
else
{
if
(
b
.
code
==
0
)
{
resolve
(
b
);
}
else
{
console
.
error
(
'[func getToken]'
,
params
,
b
);
errMsg
=
{
code
:
3000
,
msg
:
b
.
msg
};
resolve
(
errMsg
);
}
}
});
});
};
/*获取订单号*/
exports
.
getOrderSn
=
(
params
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
errMsg
=
{
code
:
3000
,
msg
:
'签名校验服务出错'
};
let
options
=
{
url
:
orderSnUrl
,
method
:
'POST'
,
json
:
true
,
body
:
params
,
headers
:
{
'content-type'
:
'application/json'
}
};
request
(
options
,
(
e
,
r
,
b
)
=>
{
if
(
e
)
{
console
.
error
(
'[func getOrderSn]'
,
params
,
e
);
resolve
(
errMsg
);
}
else
{
if
(
b
.
code
==
0
)
{
resolve
(
b
);
}
else
{
console
.
error
(
'[func getOrderSn]'
,
params
,
b
);
errMsg
=
{
code
:
3000
,
msg
:
b
.
msg
};
resolve
(
errMsg
);
}
}
});
});
};
/*验证签名*/
exports
.
signValidation
=
(
params
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
params
.
type
=
config
.
signType
;
let
options
=
{
url
:
signUrl
,
method
:
'POST'
,
json
:
true
,
body
:
params
,
headers
:
{
'content-type'
:
'application/json'
}
};
request
(
options
,
(
e
,
r
,
vb
)
=>
{
if
(
e
)
{
console
.
error
(
'[reGJJ][signValidityCheck] signValidityCheck error: '
,
e
);
reject
({
code
:
-
1
,
msg
:
'验签服务器出错'
});
}
else
{
if
(
vb
.
code
===
0
)
{
resolve
(
vb
);
}
else
{
reject
(
vb
);
}
}
});
});
};
/*获取合作方信息*/
exports
.
getCallbackMap
=
()
=>
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
request
({
url
:
getPartner
,
gzip
:
true
},(
e
,
r
,
b
)
=>
{
if
(
e
){
console
.
error
(
'getCityList'
);
console
.
error
(
e
);
return
reject
(
e
);
}
else
{
return
resolve
(
b
);
}
});
});
};
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