$(function (){
    /**
     *初始化文件上传框
     */
    try {
        //设置文件类型为打印机驱动
        localStorage.setItem("fileType", "3");
        $("#commonFile").dropzone({
            url: "/thmz/upload",
            headers: {
                'Accept': 'application/json',
                'Authorization': 'Bearer ' + localStorage.getItem("token"),
                'fileType': localStorage.getItem("fileType")
            },
            init: function () {
                this.on("success", function (file, data) {
                    if (data == '401' || data == 401) {
                        window.location.href = '/thmz/login/view'
                        return;
                    }
                    if (data.code == 0) {

                    }
                });
            },
        });
    } catch (e) {
        console.error("出现一些未知错误")
    }
});







