用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/qq5855144/GitHubM --skill phone-location-lookup命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | phone-location-lookup |
| description | 根据手机号查询归属地(省份-城市)、原运营商及是否为虚拟运营商,适用于风控校验、用户画像、客服辅助等场景。 |
| license | MIT |
通过手机号实时查询号码归属地信息,直连三大运营商数据源,非缓存,支持携号转网状态识别。
POST https://app-bo4w33bsdqm9-api-ELbWz8OmB58Y-gateway.appmiaoda.com/mobile/areamobile_number(手机号,查询参数传递)响应示例:
{
"code": 200,
"taskNo": "69564903663951243279",
"data": {
"area": "江苏-南通",
"originalIsp": "电信",
"isVirtuallyIsp": 1
}
}
traefik: true → platform_managed,密钥由平台注入,从 process.env["INTEGRATIONS_API_KEY"] 读取。
注意:所有参数通过 URL Query 参数传递,请求体为空。
const apiKey = process.env["INTEGRATIONS_API_KEY"]!; // platform_managed:密钥由平台注入
/**
* 查询手机号归属地、原运营商及是否为虚拟运营商。
* @param mobileNumber - 手机号,例如:13800138000
* @returns 包含 area、originalIsp、isVirtuallyIsp 的对象
*/
async function queryMobileLocation(
mobileNumber: string
): Promise<{ area: string; originalIsp: string; isVirtuallyIsp: number }> {
const url = new URL("https://app-bo4w33bsdqm9-api-ELbWz8OmB58Y-gateway.appmiaoda.com/mobile/area");
url.searchParams.set("mobile_number", mobileNumber);
const response = await fetch(url.toString(), {
method: "POST",
headers: {
"Content-Type": "application/json;charset=UTF-8",
"X-Gateway-Authorization": `Bearer ${apiKey}`,
},
});
if (!response.ok) throw new Error(`HTTP error: ${response.status}`);
const json = await response.();
(json. !== ) ();
json.;
}
result = ();
.(result.);
.(result.);
.(result.);
// edge-functions/phone-location-lookup.ts
import { serve } from "https://deno.land/std/http/server.ts";
serve(async (req: Request): Promise<Response> => {
if (req.method !== "POST") {
return new Response("Method Not Allowed", { status: 405 });
}
// --- 解析客户端请求 ---
let mobileNumber: string;
try {
const body = await req.json();
mobileNumber = body.mobile_number;
if (!mobileNumber) throw new Error("Missing mobile_number");
} catch {
return new Response(JSON.stringify({ error: "Invalid request body" }), {
status: 400,
headers: { "Content-Type": "application/json" },
});
}
// --- 注入平台密钥(严禁暴露到前端) ---
const apiKey = Deno.env.get();
(!apiKey) {
(.({ : }), {
: ,
: { : },
});
}
upstreamUrl = ();
upstreamUrl..(, mobileNumber);
upstream = (upstreamUrl.(), {
: ,
: {
: ,
: ,
},
});
(upstream. === || upstream. === ) {
errText = upstream.();
(errText, {
: upstream.,
: { : },
});
}
(!upstream.) {
(
.({ : }),
{ : , : { : } }
);
}
data = upstream.();
(.(data), {
: ,
: { : },
});
});
推荐方式(supabase client 可用时):
/**
* 通过 Edge Function 查询手机号归属地。
* @param mobileNumber - 手机号,例如:13800138000
* @returns 包含 area、originalIsp、isVirtuallyIsp 的对象
*/
async function fetchMobileLocation(mobileNumber: string) {
const { data, error } = await supabase.functions.invoke("phone-location-lookup", {
body: { mobile_number: mobileNumber },
});
if (error) throw error;
if (data.code !== 200) throw new Error(`API 错误 ${data.code}:${data.msg}`);
return data.data;
}
备用方式(无法使用 supabase client 时):
/**
* 通过原生 fetch 调用 Edge Function 查询手机号归属地。
* @param mobileNumber - 手机号,例如:13800138000
* @returns 包含 area、originalIsp、isVirtuallyIsp 的对象
*/
async function fetchMobileLocation(mobileNumber: string) {
const res = await fetch(
`${import.meta.env.VITE_SUPABASE_URL}/functions/v1/phone-location-lookup`,
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ mobile_number: mobileNumber }),
}
);
if (res.status === 429) {
const err = await res.json();
throw new Error(`配额已用尽:${err.message ?? res.statusText}`);
}
if (res.status === 402) {
const err = await res.json();
throw new Error(`余额不足:${err.message ?? res.statusText}`);
}
if (!res.ok) throw ();
json = res.();
(json. !== ) ();
json.;
}
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
mobile_number | string | 是 | 手机号,例如:13800138000。通过 URL Query 参数传递,不在请求体中 |
成功响应(code: 200):
| 字段路径 | 类型 | 说明 |
|---|---|---|
code | number | 状态码,200 表示成功 |
taskNo | string | 任务编号 |
data.area | string | 手机号归属地(省份-城市),例如:江苏-南通 |
data.originalIsp | string | 原运营商,例如:电信 / 移动 / 联通 |
data.isVirtuallyIsp | number | 是否虚拟运营商:0 = 否,1 = 是 |
失败响应:
| 字段路径 | 类型 | 说明 |
|---|---|---|
code | number | 错误码,见下表 |
msg | string | 错误描述 |
错误码说明:
| code | 说明 |
|---|---|
| 400 | 参数错误(如手机号格式不正确) |
| 501 | 官方数据源维护,请稍候再试 |
| 999 | 其他错误,以实际返回为准 |
INTEGRATIONS_API_KEY 仅可在 Edge Function 服务端读取,严禁暴露到前端。mobile_number 必须通过 URL Query 参数传递,不在请求体中,请勿放入 POST body。693a129f-b564-47d3-8d45-a080bab70148api-ELbWz8OmB58Y高级图片生成与编辑,支持文生图、图生图、多图合成,异步任务轮询。需要 AI 生成图片、对图片做内容编辑或风格转换时优先使用该工具。
基于 SOC 职业分类