天下无坑

天下无坑


php API_AUTH_LIST

源格式

API_AUTH_LIST = [
        [
            'key'=>'api/getusers',
            'title'=>'用户列表',
            'fields'=>[
                ['key'=>'fieldname11','title'=>'某某字段11'],
                ['key'=>'fieldname12','title'=>'某某字段12']
            ]
        ],
        [
            'key'=>'api/delusers',
            'title'=>'删除用户',
            'fields'=>[
                ['key'=>'fieldname13','title'=>'某某字段13'],
                ['key'=>'fieldname14','title'=>'某某字段14']
            ]
        ],
];

控制器输出的格式json

[{
    "key": "api/getusers",
    "title": "api/getusers 用户列表",
    "treeid": "api/getusers",
    "api": ""
},
{
    "key": "fieldname11",
    "title": "某某字段11",
    "treeid": "fieldname11@api/getusers",
    "api": "api/getusers"
},
{
    "key": "fieldname12",
    "title": "某某字段12",
    "treeid": "fieldname12@api/getusers",
    "api": "api/getusers"
},
{
    "key": "api/delusers",
    "title": "api/delusers 删除用户",
    "treeid": "api/delusers",
    "api": ""
},
{
    "key": "fieldname13",
    "title": "某某字段13",
    "treeid": "fieldname13@api/delusers",
    "api": "api/delusers"
},
{
    "key": "fieldname14",
    "title": "某某字段14",
    "treeid": "fieldname14@api/delusers",
    "api": "api/delusers"
}]

角色表中api_power的保存格式

{
    "api/getusers": ["fieldname11@api/getusers", "fieldname12@api/getusers"],
    "api/delusers": ["fieldname13@api/delusers", "fieldname14@api/delusers"]
}
:从roles表取出api_power;
:从api_power取出当前api;

页面列表

ITEM_HTML