Skip to content

Commit

Permalink
fix logout bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
baletu committed Mar 25, 2024
1 parent b76e7e0 commit 0520aac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion simpleui/static/admin/simpleui-x/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,10 @@
delete sessionStorage['tabs'];
setCookie('theme', '');
setCookie('theme_name', '');
window.location.href = window.urls.logout;

//创建一个form post方式提交
document.querySelector("#logout_form").submit();
// window.location.href = window.urls.logout;
}).catch(function () {

});
Expand Down
3 changes: 3 additions & 0 deletions simpleui/templates/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@
</div>
</el-dialog>
{% endblock %}
<form style="display: none" id="logout_form" method="post" action="{% url 'admin:logout' %}">
{% csrf_token %}
</form>
</div>
{% block base_script %}
<script type="text/javascript">
Expand Down

0 comments on commit 0520aac

Please sign in to comment.