Skip to content

自定义菜单

为了更便捷的访问应用内的某个功能,增加了自定义菜单功能。

API

请求地址为: {你的API地址}/message/menu

请求参数

名称类型说明
idint应用ID

返回参数

名称类型说明
namestring菜单名称
appstring应用地址,更多地址类型,可查看“应用短ID”文档
childrenarray子菜单列表
children.namestring子菜单名称
children.appstring应用地址,更多地址类型,可查看“应用短ID”文档

接口示例

php
<?php
$json_data = file_get_contents('php://input');
$data_array = json_decode($json_data, true);
$id = (int)$data_array['id']; // 应用ID
$query = [
    [
        'name' => '审批指南',
        'app' => 'https://******/__UNI__A32122A.wgt',
    ],
    [
        'name' => '审批记录',
        'app' => 'https://******.com/',
    ],
    [
        'name' => '快捷入口',
        'app' => '', // 这里一定要为空值
        'children' => [
            [
                'name' => '请假申请',
                'app' => 'https://******/__UNI__53832368.wgt',
            ],
            [
                'name' => '出差申请',
                'app' => 'app://two',
            ],
            [
                'name' => '快速报销',
                'app' => 'app://one',
            ]
        ]
    ]
];
echo json_encode($query, 256);
// echo json_encode([]); // 返回为空数组时,则不显示自定义菜单