beego课程实战使用的是layui前端框架,这里说一下layui框架怎么关闭当前iframe并且刷新父页面:

ions_alert.alertSuccessToast(data["msg"]);
setTimeout(reload_list,2000);  // 定时器,间隔2s

function reload_list() {
    // 获得frame索引
    var index = parent.layer.getFrameIndex(window.name);
    // 刷新父页面,一定要在close之前
    parent.location.reload();   // 和原来课程里面的区别就在这句,一定要在close之前
    
    //关闭当前frame
    parent.layer.close(index);
    
    window.location.href = "{{urlfor "DepartmentController.List"}}"
}