!6 管理员显示

Merge pull request !6 from Arno/master
This commit is contained in:
Arno 2018-09-29 17:49:06 +08:00 committed by 不忘初心
commit ac084c3af0
4 changed files with 102 additions and 3 deletions

View File

@ -0,0 +1,11 @@
package cn.jiangzeyin.controller.manage;
import cn.jiangzeyin.controller.BaseController;
/**
* 内存查看
*/
public class InternalController extends BaseController {
}

View File

@ -77,6 +77,11 @@ public class UserService extends BaseService {
String key = (String) entry.getKey();
JSONObject value = (JSONObject) entry.getValue();
value.remove("password");
if(value.containsKey("role")){
value.put("role","");
}else {
value.put("role","");
}
array.add(value);
}
return array;
@ -161,7 +166,6 @@ public class UserService extends BaseService {
if (user == null) {
return JsonMessage.getString(400, "用户信息为空");
}
System.out.println(user.toString());
String id = user.getId();
if (StrUtil.isEmpty(id)) {
return JsonMessage.getString(400, "修改失败,获取id失败");

View File

@ -0,0 +1,84 @@
<!DOCTYPE html>
<html>
<head>
#parse("./common/head.vm")
<title>项目管理系统</title>
<style>
body {
padding: 20px;
}
</style>
</head>
<body>
<div class="layui-form">
<table class="layui-table">
<thead>
<tr>
<th>文件名</th>
<th>修改时间</th>
<th>文件大小</th>
<th>操作</th>
</tr>
</thead>
<tbody>
#foreach($item in $array)
<tr>
<td>$item.shortKey</td>
<td>$item.time</td>
<td>$item.size</td>
<td>
<button name="install" data-name="$item.shortKey" data-key="$item.key" data-id="$id"
class="layui-btn layui-btn-normal layui-btn-sm">安装
</button>
</td>
</tr>
#end
</tbody>
</table>
</div>
</body>
<script type="text/javascript">
layui.use(['layer', 'element', 'table', 'form'], function () {
var $ = layui.$;
var layer = layui.layer;
$("button[name='install']").click(function () {
var that = $(this);
var name = that.attr("data-name");
layer.confirm('您确定要安装【' + name + '】?', {
btn: ['确定', '不确定'] //按钮
}, function (index) {
layer.close(index);
index = layer.load(1, {
shade: [0.5, '#fff'] //0.1透明度的白色背景
});
var key = that.attr("data-key");
var id = that.attr("data-id");
$.ajax({
url: './build_install',
type: 'POST',
dataType: 'json',
data: {id: id, key: key},
success: function (data) {
layer.msg(data.msg);
if (200 == data.code) {
}
},
error: function (err) {
layer.msg('安装失败');
},
complete: function () {
layer.close(index);
}
});
}, function () {
});
});
});
</script>
</html>

View File

@ -28,7 +28,7 @@
<div class="layui-inline">
<label class="layui-form-label">密码</label>
<div class="layui-input-block">
<input type="text" name="password" placeholder=""
<input type="password" name="password" placeholder=""
class="layui-input">
</div>
</div>
@ -162,7 +162,7 @@
// 设置表单值
for (var key in data) {
if ("role" == key) {
if (data[key])
if ("是" === data[key])
$('#form_project [name="role"]').attr('checked', true);
} else {
$('#form_project [name="' + key + '"]').val(data[key]);