【备用】移动话费查询
移动话费查询-只支持移动号码查询

频率: 不限制

价格:¥0.0500

接口文档

响应码文档

示例代码

在线调试

异常上报

异常情况

联系QQ

axios

curl

PHP

java

go

python

fetch

c#


{{ code }}
                            

Params

Body

Headers

Cookies

参数名参数值参数类型描述操作

none

from-data

x-www-from-urlencoded

json

xml

raw

无参数

参数名参数值参数类型描述操作
参数名参数值参数类型描述操作
参数名参数值参数类型描述操作
function updateCode(code, lang = 'javascript') { const codeEl = document.getElementById('codeBlock'); codeEl.removeAttribute('data-highlighted'); codeEl.className = 'language-' + lang; codeEl.textContent = code; hljs.highlightElement(codeEl); } function updateCode2(code, lang = 'javascript') { const codeEl = document.getElementById('codeBlocsk'); codeEl.removeAttribute('data-highlighted'); codeEl.className = 'language-' + lang; codeEl.textContent = code; hljs.highlightElement(codeEl); } const { ref, createApp } = Vue; const App = { data() { const showbox = ref(1) const code = ref(getrequestcode(apiinfo, 'node')); const getrequode = (lang) => { code.value = getrequestcode(apiinfo, lang) setTimeout(() => { updateCode(code.value); }, 100) } const infofrom = ref({}) infofrom.value = apiinfo const inufrom = [{ xu_key: '', xu_value: '', xu_explain: '', xu_status: 'string' }] const jsondata = ref('') if (infofrom.value.xu_cookies == null || infofrom.value.xu_cookies.length == 0) { infofrom.value.xu_cookies = inufrom } if (infofrom.value.xu_headerper == null || infofrom.value.xu_headerper.length == 0) { infofrom.value.xu_headerper = inufrom } if (infofrom.value.xu_bodyper == null || infofrom.value.xu_bodyper.length == 0) { infofrom.value.xu_bodyper = inufrom } if (infofrom.value.xu_queryper == null || infofrom.value.xu_queryper.length == 0) { infofrom.value.xu_queryper = inufrom } if (infofrom.value.xu_bodyjson !== null || infofrom.value.xu_bodyjson.length !== 0) { jsondata.value = infofrom.value.xu_bodyjson } const showindex = ref(1) const backtype = ref('') const ursl = ref(infofrom.value.xu_apidan || location.origin + '/api/' + infofrom.value.xu_api) if (infofrom.value.xu_type == 'pg') { infofrom.value.xu_type = 'POST' } const backdata = ref('') const sends = async () => { const url = ursl.value; const method = (infofrom.value.xu_type || 'GET').toUpperCase(); const bodyType = infofrom.value.xu_bodystatus || 'none'; // headers const headers = {}; (infofrom.value.xu_headerpre || []).forEach(item => { if (item.xu_key && item.xu_value && item.xu_value !== '') headers[item.xu_key] = item.xu_value; }); // query params const params = {}; (infofrom.value.xu_queryper || []).forEach(item => { if (item.xu_key && item.xu_value && item.xu_value !== '') params[item.xu_key] = item.xu_value; }); // cookies const cookieStr = (infofrom.value.xu_cookies || []) .filter(item => item.xu_key && item.xu_value) .map(item => `${item.xu_key}=${item.xu_value}`) .join('; '); if (cookieStr) headers['Cookie'] = cookieStr; // body let data = null; const bodyList = infofrom.value.xu_bodyper || []; console.log(jsondata.value); switch (bodyType) { case 'json': headers['Content-Type'] = 'application/json'; data = jsondata.value || '{}'; break; case 'x-www-form-urlencoded': headers['Content-Type'] = 'application/x-www-form-urlencoded'; data = new URLSearchParams(); bodyList.forEach(item => { if (item.xu_key && item.xu_value && item.xu_value !== '') data.append(item.xu_key, item.xu_value); }); break; case 'from-data': headers['Content-Type'] = 'multipart/form-data'; data = new FormData(); bodyList.forEach(item => { if (item.xu_key && item.xu_value && item.xu_value !== '') data.append(item.xu_key, item.xu_value); }); // Axios 自动设置 multipart 边界,不要手动设置 Content-Type delete headers['Content-Type']; break; case 'xml': headers['Content-Type'] = 'application/xml'; data = jsondata.value || ''; break; case 'raw': headers['Content-Type'] = 'text/plain'; data = jsondata.value || ''; break; case 'none': default: data = null; break; } // 发送请求 try { let loadis = showxLoading() const res = await axios({ url, method, headers, params, data, responseType: 'arraybuffer' }); hidexLoading(loadis) const contentType = res.headers['content-type'] || ''; const rawText = new TextDecoder().decode(res.data); let parsed; try { const obj = JSON.parse(rawText); const pretty = JSON.stringify(obj, null, 2); backtype.value = 'json'; backdata.value = pretty; setTimeout(() => { updateCode2(pretty); }, 100) } catch { if (contentType.startsWith('image/')) { const blob = new Blob([res.data], { type: contentType }); const imageUrl = URL.createObjectURL(blob); backtype.value = 'image'; backdata.value = imageUrl; console.log('图片链接:', imageUrl); } else if (contentType.startsWith('video/')) { const blob = new Blob([res.data], { type: contentType }); const videoUrl = URL.createObjectURL(blob); console.log('视频链接:', videoUrl); backdata.value = videoUrl; backtype.value = 'video'; } else if (contentType.startsWith('audio/')) { const blob = new Blob([res.data], { type: contentType }); const audioUrl = URL.createObjectURL(blob); backdata.value = audioUrl; backtype.value = 'audio'; console.log('音频链接:', audioUrl); } else { console.log('文本数据:', rawText); backdata.value = rawText; backtype.value = 'text'; } } } catch (err) { hidexLoading(loadis) console.error('请求失败:', err); backdata.value = err.message; backtype.value = 'error'; // 可选:记录错误信息到 infofrom.value.xu_errlist } }; const apiins = ref({}) const getapiinfo = async () => { const res = await xget('/apis/getapiitem?id=' + infofrom.value.id); if (res.code == 200) { apiins.value = res.data; } else { showxModal('error', res.msg) } } getapiinfo(); const CapiMy = async () => { const res = await xpost('/av1/CapiMy', { id: infofrom.value.id }) if (res.code == 200) { getapiinfo(); showxModal('success', '操作成功') } else { showxModal('error', res.msg) } } const opfrom = ref({ xu_word: "", xu_qqnum: "", xu_status:1, xu_name:"接口异常上报" }) const Opinion = async () => { if (!opfrom.value.xu_word || !opfrom.value.xu_qqnum) { showxModal('error', '请将信息填写完整') return } let loadis = showxLoading() const res = await xpost('/av1/Opinion', opfrom.value, true) hidexLoading(loadis) if (res.code == 200) { showxModal('success', '反馈成功!我们将尽快排查。感谢您的反馈!') opfrom.value.xu_word = ""; opfrom.value.xu_qqnum = ""; } else { showxModal('error', res.msg) } } const getleyinfo = async () => { const res = await xpost('/av1/getApiKey') if (res.code == 200) { infofrom.value.xu_queryper.unshift({ xu_key: 'ckey', xu_value: res.data[0]['xu_key'], xu_explain: '调用CKEY', xu_status: 'string' }) } else { infofrom.value.xu_queryper.unshift({ xu_key: 'ckey', xu_value: '', xu_explain: '调用CKEY', xu_status: 'string' }) } } getleyinfo() return { showbox, code, getrequode, showindex, infofrom, backtype, sends, ursl, backdata, CapiMy, apiins, Opinion, opfrom, jsondata } } } const app = Vue.createApp(App); window.vm = app.mount("#container");

接口响应:

json

text

image

video

audio

error


{{ backdata }}
                            
{{ backdata }}
{{ backdata }}

等待发起...