feat: 新增请求参数
This commit is contained in:
parent
f7c0d4d747
commit
24f0c43f2e
@ -41,12 +41,13 @@ const manageLogin = async (req: Request, isSeek = false) => {
|
||||
const manageBatchUser = async (req: Request, isSeek = false) => {
|
||||
const body = (await req.json()) as any;
|
||||
console.log("🚀 ~ manageBatchUser ~ body:", body);
|
||||
const { user_ids } = body;
|
||||
const { user_ids, user_id_type } = body;
|
||||
if (!user_ids) {
|
||||
return new Response("user_ids not found", { status: 400 });
|
||||
}
|
||||
const { code, data, msg } = await service.lark.user.batchGet(
|
||||
user_ids,
|
||||
user_id_type,
|
||||
isSeek
|
||||
);
|
||||
console.log("🚀 ~ manageBatchUser:", code, data, msg);
|
||||
|
@ -48,7 +48,11 @@ const get = async (user_id: string, isSeek = false) => {
|
||||
* @param user_ids
|
||||
* @returns
|
||||
*/
|
||||
const batchGet = async (user_ids: string[], isSeek = false) => {
|
||||
const batchGet = async (
|
||||
user_ids: string[],
|
||||
user_id_type: "open_id" | "user_id",
|
||||
isSeek = false
|
||||
) => {
|
||||
const URL = `https://open.f.mioffice.cn/open-apis/contact/v3/users/batch`;
|
||||
const headers = isSeek
|
||||
? {
|
||||
@ -59,7 +63,7 @@ const batchGet = async (user_ids: string[], isSeek = false) => {
|
||||
URL,
|
||||
{
|
||||
user_ids,
|
||||
user_id_type: "user_id",
|
||||
user_id_type,
|
||||
},
|
||||
headers
|
||||
);
|
||||
|
@ -1,4 +1,4 @@
|
||||
const res = await fetch("http://localhost:3000/micro_app/egg/batch_user", {
|
||||
const res = await fetch("https://egg.imoaix.cn/micro_app/egg/batch_user", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
Loading…
x
Reference in New Issue
Block a user