You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<script>
// =================================================接口1===========================================
function fetchGetRequest(url) {returnfetch(url).then(response=>{if(!response.ok){thrownewError('Network response was not ok');}returnresponse.json();// 解析 JSON 数据}).then(data=>{//console.log(data);console.log(data.result.rating_index);// 结果:1 所有人,2 青少年 ,3 为不良图片returndata;// 返回解析后的数据}).catch(error=>{console.error('There has been a problem with your fetch operation:',error);throwerror;// 抛出错误,可根据需要处理});}
//const apiUrl = 'https://api.oioweb.cn/api/ai/jianhuang?url=https://cn.bing.com/th?id=OHR.ArizonaPinkMoon_ZH-CN5545607389_1920x1080.jpg';
//fetchGetRequest(apiUrl)
// =================================================接口2===========================================
function fetchPostRequest(url, data) {returnfetch(url,{method: 'POST',headers: {'Content-Type': 'application/json',// 根据实际情况设置 Content-Type},body: JSON.stringify(data),// 将 JavaScript 对象转换为 JSON 字符串}).then(response=>{if(!response.ok){thrownewError('Network response was not ok');}returnresponse.json();// 解析 JSON 数据}).then(data=>{returndata;// 返回解析后的数据}).catch(error=>{console.error('There has been a problem with your fetch operation:',error);throwerror;// 抛出错误,可根据需要处理});}
const apiUrl = 'https://tools.mgtv100.com/external/v1/qcloud_content_audit';
const postData = {audit_content: 'https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png',audit_type: 'image'};
fetchPostRequest(apiUrl, postData)
.then(data =>{console.log('POST 请求成功:',data.data.Lable);// 结果: })
.catch(error =>{// 处理请求失败的情况console.error('请求失败:',error);});
</script>
The text was updated successfully, but these errors were encountered:
图片鉴黄和图片内容审核
The text was updated successfully, but these errors were encountered: