给系统设置增加演示用户禁止操作的判断

This commit is contained in:
季圣华
2020-05-11 20:57:44 +08:00
parent 6ae669c289
commit 53a4338533
2 changed files with 24 additions and 0 deletions

View File

@@ -422,6 +422,21 @@
return res; return res;
} }
/**
* 检查当前用户是否是演示用户
*/
function checkIsTestUser() {
var res = false;
var loginName = sessionStorage.getItem("loginName");
if (loginName == "jsh") {
$.messager.alert('提示', '演示用户禁止操作!', 'warning');
res = true;
} else {
res = false;
}
return res;
}
/** /**
* 判断一个值是否数字 * 判断一个值是否数字
* @param value * @param value

View File

@@ -231,6 +231,9 @@
//删除系统配置信息 //删除系统配置信息
function deleteSystemConfig(systemConfigId) { function deleteSystemConfig(systemConfigId) {
if(checkIsTestUser()) {
return;
}
$.messager.confirm('删除确认', '确定要删除此系统配置信息吗?', function (r) { $.messager.confirm('删除确认', '确定要删除此系统配置信息吗?', function (r) {
if (r) { if (r) {
$.ajax({ $.ajax({
@@ -259,6 +262,9 @@
//批量删除系统配置 //批量删除系统配置
function batDeleteSystemConfig() { function batDeleteSystemConfig() {
if(checkIsTestUser()) {
return;
}
var row = $('#tableData').datagrid('getChecked'); var row = $('#tableData').datagrid('getChecked');
if (row.length == 0) { if (row.length == 0) {
$.messager.alert('删除提示', '没有记录被选中!', 'warning'); $.messager.alert('删除提示', '没有记录被选中!', 'warning');
@@ -335,6 +341,9 @@
//保存系统配置信息 //保存系统配置信息
$("#saveSystemConfig").off("click").on("click", function () { $("#saveSystemConfig").off("click").on("click", function () {
if(checkIsTestUser()) {
return;
}
if (checkCompanyName()) { if (checkCompanyName()) {
return; return;
} }