人人商城返回Json格式的数据
人人商城返回Json格式的数据
1、找到该插件对应的 core/mobile 路径
2、新建一个 api.php 文件
<?php header('Content-Type:application/json; charset=utf-8'); if (!defined('IN_IA')) { exit('Access Denied'); } class Api_EweiShopV2Page extends PluginMobileLoginPage { /** * GetcharZp 测试发送 Json 数据 */ public function apiTestGetcharZp() { global $_GPC; exit(json_encode(array('msg' => 'code123', 'code' => 1, 'id' => $_GPC['my_id']))); } } ?>
3、前端调用接口 ./index.php?i=公众号ID&c=entry&m=ewei_shopv2&do=mobile&r=插件名称.api.函数名称
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步