const fs = require('fs');
// 读取json
const list = JSON.parse(fs.readFileSync('./pc_menu_ermcp_v6.json'));

const resetKey = arr => {
    arr.forEach(el => {
        if(el.rulekey && !el.rulekey.includes('client_pc'))  {
            el.rulekey = 'client_pc_web_qiyefengguan_' + el.rulekey
        }
        if(el.children) {
            resetKey(el.children)
        }
        if(el.auth) {
            resetKey(el.auth)
        }
    });
}
resetKey(list)

fs.writeFileSync("./out/pc_menu_ermcp_v6.json", JSON.stringify(list, null, '\t'));