Commit 66c7ec2a by Sxy

fix: ydz_prefix

parent 910b5e65
......@@ -3,13 +3,13 @@ const settings = require("../../config/settings");
const system = require("../system");
const ydzUrl = settings.ydzUrl();
const redisClient = system.getObject("util.redisClient");
const ydz_prefix = "ydz:";
/**
* 请求易代账
* 封装 获取 userpin token
*/
const pushYiDaZhang = async(data = {}) => {
const pushYiDaZhang = async (data = {}) => {
const { appKey, appSecret } = settings.ydzKey();
const openToken = JSON.parse(await redisClient.get(`${ydz_prefix}ydzToken`)).access_token;
console.log('----------------------------open-----------------------');
......@@ -25,13 +25,13 @@ const pushYiDaZhang = async(data = {}) => {
return pushYDZResult;
}
const getManageIdByOpenToken = async(headers) => {
const getManageIdByOpenToken = async (headers) => {
const url = `${ydzUrl}/ydz/setup/openAccess/MainTenant/findMainTenant`
const rs = await getRequest(url, {}, headers);
return rs.id;
}
const postRequest = async(url, data, headers = {}) => {
const postRequest = async (url, data, headers = {}) => {
try {
console.log(` ${url} : 请求信息 ------- `);
console.log(JSON.stringify(data))
......@@ -46,10 +46,10 @@ const postRequest = async(url, data, headers = {}) => {
console.log(result);
system.execLogs(
`请求易代账`, {
url,
data,
headers
},
url,
data,
headers
},
'交付请求',
result,
null
......@@ -68,7 +68,7 @@ const postRequest = async(url, data, headers = {}) => {
}
}
const getRequest = async(url, data, headers = {}) => {
const getRequest = async (url, data, headers = {}) => {
try {
console.log(` ${url} : 请求信息 ------- `);
console.log(JSON.stringify(headers));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment