function update() {
    var displayName = document.getElementById("display_name").value;
    if (displayName.length == 0) {
        alert("用户名不可为空！");
        return;
    }
    $.ajax({
        type: "POST",
        url: "/settings/update",
        data: JSON.stringify({ display_name: displayName }),
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success : function(settings) {
            alert("更新成功")
        },
        error: function (xhr, textStatus, error) {
            var msg = JSON.parse(xhr.responseText);
            alert(msg.error);
        }
    });
}