rest.js 919 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. async function ClassesGet(classesName)
  2. {
  3. let response = await
  4. fetch(
  5. "http://web2023.fmode.cn:9999/parse/classes/?"+classesName,//url
  6. {
  7. "headers": {
  8. "accept": "*/*",
  9. "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
  10. "if-none-match": "W/\"19f-gvNjdCzTNrgDv/sckM9+BRABBVY\"",
  11. "x-parse-application-id": "dev"
  12. },
  13. "referrer": "http://127.0.0.1:4040/",
  14. "referrerPolicy": "strict-origin-when-cross-origin",
  15. "body": null,
  16. "method": "GET",
  17. "mode": "cors",
  18. "credentials": "omit"
  19. });
  20. // console.log(response);
  21. // return[]
  22. if(response?.status=="200")
  23. {
  24. let json = await response.json()
  25. console.log(json)
  26. return json?.results || []
  27. }
  28. else
  29. {
  30. return[]
  31. }
  32. }
  33. async function main()
  34. {
  35. let FaceNameList = await ClassesGet("MagicMirror")
  36. //console.log(FaceNameList)
  37. }
  38. main()