feat: 新增请求参数
All checks were successful
Egg CI/CD / build-image (push) Successful in 22s
Egg CI/CD / deploy (push) Successful in 1m25s

This commit is contained in:
zhaoyingbo 2024-06-10 04:24:46 +00:00
parent f7c0d4d747
commit 24f0c43f2e
3 changed files with 9 additions and 4 deletions

View File

@ -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);

View File

@ -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
);

View File

@ -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",