function translationVal(type){ //翻译
    layer.load(3)
    $.ajax({
        url: "/json/"+ type +".json",
        type: "get",
        dateType: "json",
        headers: {"token": localStorage.getItem("token")},
        success: (data) => {
            $.each(data, (key, val) => {
                if(typeof $('[data-locale='+ key +']').get(0) != "undefined"){
                    var name = $('[data-locale='+ key +']').get(0).tagName;
                    if(name != "P"){
                        $('[data-locale='+ key +']').text(val);
                    }
                    $('[data-locale='+ key +']').attr("placeholder", val);
                }
            });
            layer.closeAll("loading");
        },
        error: () => {
            layer.closeAll("loading");
        }
    })
}
//单字翻译
function paramReturn(name, type){
    var results = "";
    $.ajax({
        async: false,
        url: "/json/"+ type +".json",
        type: "get",
        dateType: "json",
        headers: {"token": localStorage.getItem("token")},
        success: (data) => {
            results = data[name.replaceAll("&nbsp;", "").trim()]
            layer.closeAll("loading");
        },
        error: () => {
            layer.closeAll("loading");
        }
    })
    return results;
}