Commit 66c7ec2a by Sxy

fix: ydz_prefix

parent 910b5e65
...@@ -3,13 +3,13 @@ const settings = require("../../config/settings"); ...@@ -3,13 +3,13 @@ const settings = require("../../config/settings");
const system = require("../system"); const system = require("../system");
const ydzUrl = settings.ydzUrl(); const ydzUrl = settings.ydzUrl();
const redisClient = system.getObject("util.redisClient"); const redisClient = system.getObject("util.redisClient");
const ydz_prefix = "ydz:";
/** /**
* 请求易代账 * 请求易代账
* 封装 获取 userpin token * 封装 获取 userpin token
*/ */
const pushYiDaZhang = async(data = {}) => { const pushYiDaZhang = async (data = {}) => {
const { appKey, appSecret } = settings.ydzKey(); const { appKey, appSecret } = settings.ydzKey();
const openToken = JSON.parse(await redisClient.get(`${ydz_prefix}ydzToken`)).access_token; const openToken = JSON.parse(await redisClient.get(`${ydz_prefix}ydzToken`)).access_token;
console.log('----------------------------open-----------------------'); console.log('----------------------------open-----------------------');
...@@ -25,13 +25,13 @@ const pushYiDaZhang = async(data = {}) => { ...@@ -25,13 +25,13 @@ const pushYiDaZhang = async(data = {}) => {
return pushYDZResult; return pushYDZResult;
} }
const getManageIdByOpenToken = async(headers) => { const getManageIdByOpenToken = async (headers) => {
const url = `${ydzUrl}/ydz/setup/openAccess/MainTenant/findMainTenant` const url = `${ydzUrl}/ydz/setup/openAccess/MainTenant/findMainTenant`
const rs = await getRequest(url, {}, headers); const rs = await getRequest(url, {}, headers);
return rs.id; return rs.id;
} }
const postRequest = async(url, data, headers = {}) => { const postRequest = async (url, data, headers = {}) => {
try { try {
console.log(` ${url} : 请求信息 ------- `); console.log(` ${url} : 请求信息 ------- `);
console.log(JSON.stringify(data)) console.log(JSON.stringify(data))
...@@ -68,7 +68,7 @@ const postRequest = async(url, data, headers = {}) => { ...@@ -68,7 +68,7 @@ const postRequest = async(url, data, headers = {}) => {
} }
} }
const getRequest = async(url, data, headers = {}) => { const getRequest = async (url, data, headers = {}) => {
try { try {
console.log(` ${url} : 请求信息 ------- `); console.log(` ${url} : 请求信息 ------- `);
console.log(JSON.stringify(headers)); 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