Commit 68ae12c0 by 王昆

gsb

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