xiao commited on
Commit
ce6586e
·
1 Parent(s): 72fb56a

万卷添加权限请求

Browse files
Files changed (1) hide show
  1. app/api/wanjuan/route.ts +4 -0
app/api/wanjuan/route.ts CHANGED
@@ -1,11 +1,15 @@
1
  export async function POST(req: Request) {
2
  try {
 
3
  let body = { message: await req.json() };
4
 
5
  console.log(JSON.stringify(body));
6
  let res = "";
7
  await fetch("http://47.94.237.159:8080/v1/wanjuan", {
8
  method: "POST",
 
 
 
9
  body: JSON.stringify(body),
10
  })
11
  .then((response) => response.json())
 
1
  export async function POST(req: Request) {
2
  try {
3
+ let token = process.env.WANJUAN_TOKEN;
4
  let body = { message: await req.json() };
5
 
6
  console.log(JSON.stringify(body));
7
  let res = "";
8
  await fetch("http://47.94.237.159:8080/v1/wanjuan", {
9
  method: "POST",
10
+ headers:{
11
+ "Authorization":"Bearer "+token
12
+ },
13
  body: JSON.stringify(body),
14
  })
15
  .then((response) => response.json())