[前端]修复了添加比赛,添加公告的后台页面对超级管理员也提示权限不足的问题[CI SKIP]

This commit is contained in:
esp 2015-08-27 14:03:48 +08:00
parent 235e042b5e
commit e7aac0a6e0
2 changed files with 24 additions and 23 deletions

View File

@ -130,6 +130,19 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "validator"],
getPageData(1); getPageData(1);
$.ajax({
url: "/api/user/",
method: "get",
dataType: "json",
success: function (data) {
if (!data.code) {
var admin_type = data.data.admin_type;
if (data.data.admin_type == 1) {
vm.isGlobal = false;
vm.showGlobalViewRadio = false;
}
}
$.ajax({ $.ajax({
url: "/api/admin/group/", url: "/api/admin/group/",
method: "get", method: "get",
@ -137,6 +150,7 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "validator"],
success: function (data) { success: function (data) {
if (!data.code) { if (!data.code) {
if (!data.data.length) { if (!data.data.length) {
if (admin_type != 2)
bsAlert("您的用户权限只能创建组内公告,但是您还没有创建过小组"); bsAlert("您的用户权限只能创建组内公告,但是您还没有创建过小组");
return; return;
} }
@ -151,18 +165,6 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "validator"],
} }
} }
}); });
$.ajax({
url: "/api/user/",
method: "get",
dataType: "json",
success: function (data) {
if (!data.code) {
if (data.data.admin_type == 1) {
vm.isGlobal = false;
vm.showGlobalViewRadio = false;
}
}
} }
}); });

View File

@ -131,7 +131,6 @@ require(["jquery", "avalon", "editor", "uploader", "bsAlert", "csrfToken", "date
success: function (data) { success: function (data) {
if (!data.code) { if (!data.code) {
if (!data.data.length) { if (!data.data.length) {
bsAlert("您的用户权限只能创建组内比赛,但是您还没有创建过小组");
return; return;
} }
for (var i = 0; i < data.data.length; i++) { for (var i = 0; i < data.data.length; i++) {