Commit 68ae12c0 by 王昆

gsb

parent f1ed8dd0
...@@ -111,6 +111,7 @@ class innerApi { ...@@ -111,6 +111,7 @@ class innerApi {
async appFaceAuth(obj, req) { async appFaceAuth(obj, req) {
try { try {
let accountId = this.trim(obj.accountId); let accountId = this.trim(obj.accountId);
let appKey = this.trim(obj.appKey);
let account = await this.usereaccountSve.findById(accountId); let account = await this.usereaccountSve.findById(accountId);
if (!account) { if (!account) {
return system.getErrResult2("账户不存在"); return system.getErrResult2("账户不存在");
...@@ -127,6 +128,7 @@ class innerApi { ...@@ -127,6 +128,7 @@ class innerApi {
notifyUrl: obj.notifyUrl || "https://bpohhr.gongsibao.com/api/econtractApi/transferNotify", notifyUrl: obj.notifyUrl || "https://bpohhr.gongsibao.com/api/econtractApi/transferNotify",
// sysNotifyUrl: "https://bpohhr.gongsibao.com/api/econtractApi/transferNotify", // sysNotifyUrl: "https://bpohhr.gongsibao.com/api/econtractApi/transferNotify",
sysNotifyUrl: "https://bpohhr.gongsibao.com/api/innerApi/faceAuthNotify", sysNotifyUrl: "https://bpohhr.gongsibao.com/api/innerApi/faceAuthNotify",
appKey: appKey
}, },
}); });
authRes = authRes.data; authRes = authRes.data;
...@@ -220,12 +222,13 @@ class innerApi { ...@@ -220,12 +222,13 @@ class innerApi {
* @returns {Promise<{msg: string, data: *, status: number}>} * @returns {Promise<{msg: string, data: *, status: number}>}
*/ */
async appHandSign(obj, req) { async appHandSign(obj, req) {
let mchtId, accountId, notifyUrl, val, key; let mchtId, accountId, notifyUrl, val, key, appKey;
try { try {
await this.valid(obj, req); await this.valid(obj, req);
accountId = this.trim(obj.accountId); accountId = this.trim(obj.accountId);
mchtId = this.trim(obj.mchtId); mchtId = this.trim(obj.mchtId);
notifyUrl = this.trim(obj.notifyUrl); notifyUrl = this.trim(obj.notifyUrl);
appKey = this.trim(obj.appKey);
key = `${mchtId}_${accountId}`; key = `${mchtId}_${accountId}`;
val = uuidv4(); val = uuidv4();
...@@ -255,6 +258,7 @@ class innerApi { ...@@ -255,6 +258,7 @@ class innerApi {
notifyUrl: notifyUrl, notifyUrl: notifyUrl,
noticeUrl: "https://bpohhr.gongsibao.com/api/innerApi/appHandSignNotice", noticeUrl: "https://bpohhr.gongsibao.com/api/innerApi/appHandSignNotice",
callbackUrl: obj.callbackUrl || "https://bpohhr.gongsibao.com/blank", callbackUrl: obj.callbackUrl || "https://bpohhr.gongsibao.com/blank",
appKey: appKey
}); });
if (res.status === 0) { if (res.status === 0) {
...@@ -298,6 +302,9 @@ class innerApi { ...@@ -298,6 +302,9 @@ class innerApi {
let notifyResult = await axios({ let notifyResult = await axios({
method: 'post', method: 'post',
url: contract.notify_url, url: contract.notify_url,
headers: {
'XAPPKEY': this.trim(contract.app_key),
},
data: { data: {
contractId: contract.id, contractId: contract.id,
accountId: contract.usereaccount_id, accountId: contract.usereaccount_id,
......
...@@ -34,6 +34,7 @@ module.exports = (db, DataTypes) => { ...@@ -34,6 +34,7 @@ module.exports = (db, DataTypes) => {
end_at:DataTypes.DATE, end_at:DataTypes.DATE,
notify_url: DataTypes.STRING, notify_url: DataTypes.STRING,
app_key: DataTypes.STRING,
},{ },{
paranoid: true,//假的删除 paranoid: true,//假的删除
underscored: true, underscored: true,
......
...@@ -886,6 +886,7 @@ class DKcontractService extends ServiceBase { ...@@ -886,6 +886,7 @@ class DKcontractService extends ServiceBase {
esignUrl: "", esignUrl: "",
eflowstatus: "1", eflowstatus: "1",
notify_url: params.notifyUrl, notify_url: params.notifyUrl,
app_key: params.appKey,
} }
dkcontract = await this.create(dkcontract); dkcontract = await this.create(dkcontract);
......
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