1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +00:00

6.3 perm error (#2294)

* Add login url to context

* [backbone] turn to login page when 403
This commit is contained in:
llj
2018-08-23 13:41:17 +08:00
committed by Daniel Pan
parent 5eba3e385e
commit ffca232d4d
4 changed files with 9 additions and 3 deletions

View File

@@ -454,10 +454,13 @@ define([
prepareCollectionFetchErrorMsg: function(collection, response, opts) {
var err_msg;
if (response.responseText) {
if (response['status'] == 401 || response['status'] == 403) {
if (response['status'] == 401) {
err_msg = gettext("Permission error");
} else if (response['status'] == 403) {
err_msg = gettext("Permission error");
location.href = app.config.loginUrl + '?next='
+ encodeURIComponent(location.pathname + location.hash);
} else {
//err_msg = gettext("Error");
err_msg = this.HTMLescape(JSON.parse(response.responseText).error_msg);
}
} else {