wechatMp增加获取运力id列表接口
This commit is contained in:
parent
4d8b864734
commit
9fb9aee154
|
|
@ -172,5 +172,10 @@ export declare class WechatMpInstance {
|
||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
}>;
|
}>;
|
||||||
|
/**
|
||||||
|
* 获取运力id列表get_delivery_list
|
||||||
|
* https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/express_search.html#%E8%8E%B7%E5%8F%96%E8%BF%90%E5%8A%9Bid%E5%88%97%E8%A1%A8get-delivery-list
|
||||||
|
*/
|
||||||
|
getDeliveryList(): Promise<any>;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
|
|
||||||
|
|
@ -376,4 +376,20 @@ export class WechatMpInstance {
|
||||||
shipping: shipping
|
shipping: shipping
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 获取运力id列表get_delivery_list
|
||||||
|
* https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/express_search.html#%E8%8E%B7%E5%8F%96%E8%BF%90%E5%8A%9Bid%E5%88%97%E8%A1%A8get-delivery-list
|
||||||
|
*/
|
||||||
|
async getDeliveryList() {
|
||||||
|
const token = this.getAccessToken();
|
||||||
|
const result = await this.access(`https://api.weixin.qq.com/cgi-bin/express/delivery/open_msg/get_delivery_list?access_token=${token}`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify({}),
|
||||||
|
});
|
||||||
|
// const { errcode, delivery_list, count } = result;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -172,5 +172,10 @@ export declare class WechatMpInstance {
|
||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
}>;
|
}>;
|
||||||
|
/**
|
||||||
|
* 获取运力id列表get_delivery_list
|
||||||
|
* https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/express_search.html#%E8%8E%B7%E5%8F%96%E8%BF%90%E5%8A%9Bid%E5%88%97%E8%A1%A8get-delivery-list
|
||||||
|
*/
|
||||||
|
getDeliveryList(): Promise<any>;
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
|
|
|
||||||
|
|
@ -380,5 +380,21 @@ class WechatMpInstance {
|
||||||
shipping: shipping
|
shipping: shipping
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 获取运力id列表get_delivery_list
|
||||||
|
* https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/express_search.html#%E8%8E%B7%E5%8F%96%E8%BF%90%E5%8A%9Bid%E5%88%97%E8%A1%A8get-delivery-list
|
||||||
|
*/
|
||||||
|
async getDeliveryList() {
|
||||||
|
const token = this.getAccessToken();
|
||||||
|
const result = await this.access(`https://api.weixin.qq.com/cgi-bin/express/delivery/open_msg/get_delivery_list?access_token=${token}`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify({}),
|
||||||
|
});
|
||||||
|
// const { errcode, delivery_list, count } = result;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exports.WechatMpInstance = WechatMpInstance;
|
exports.WechatMpInstance = WechatMpInstance;
|
||||||
|
|
|
||||||
|
|
@ -202,8 +202,8 @@ export class WechatMpInstance {
|
||||||
const result = this.externalRefreshFn
|
const result = this.externalRefreshFn
|
||||||
? await this.externalRefreshFn(this.appId)
|
? await this.externalRefreshFn(this.appId)
|
||||||
: await this.access(
|
: await this.access(
|
||||||
`https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${this.appId}&secret=${this.appSecret}`
|
`https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${this.appId}&secret=${this.appSecret}`
|
||||||
);
|
);
|
||||||
const { access_token, expires_in } = result;
|
const { access_token, expires_in } = result;
|
||||||
this.accessToken = access_token;
|
this.accessToken = access_token;
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
|
|
@ -629,4 +629,24 @@ export class WechatMpInstance {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取运力id列表get_delivery_list
|
||||||
|
* https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/express_search.html#%E8%8E%B7%E5%8F%96%E8%BF%90%E5%8A%9Bid%E5%88%97%E8%A1%A8get-delivery-list
|
||||||
|
*/
|
||||||
|
async getDeliveryList() {
|
||||||
|
const token = this.getAccessToken();
|
||||||
|
const result = await this.access(
|
||||||
|
`https://api.weixin.qq.com/cgi-bin/express/delivery/open_msg/get_delivery_list?access_token=${token}`,
|
||||||
|
{
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify({}),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
// const { errcode, delivery_list, count } = result;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue