fix[通用模块]:接口文档说明优化

This commit is contained in:
2025-02-11 09:34:33 +08:00
parent 8184407a6a
commit c5c9d02a8f
25 changed files with 122 additions and 63 deletions
@@ -96,7 +96,7 @@
success: function (data) {
//console.log(JSON.stringify(data));
if (data.resp_code === 0) {
config.putToken(data.datas);
config.putToken(data.data);
layer.msg('登录成功', {icon: 1, time: 500}, function () {
location.replace('./');
});
@@ -33,7 +33,7 @@ layui.define(['config', 'admin', 'layer', 'laytpl', 'element', 'form'], function
var laytpl = layui.laytpl;
var element = layui.element;
var form = layui.form;
var index = {
// 渲染左侧菜单栏
initLeftNav: function () {
@@ -191,7 +191,7 @@ layui.define(['config', 'admin', 'layer', 'laytpl', 'element', 'form'], function
admin.req('api-user/users/current', {}, function (data) {
layer.closeAll('loading');
if (data && data.resp_code === 0) {
let user = data.datas;
let user = data.data;
config.putUser(user);
admin.putTempData("permissions",user.permissions);
success(user);
@@ -24,7 +24,7 @@
admin.req('api-search/admin/index', {'indexName':indexName}, function (data) {
layer.closeAll('loading');
if (0 == data.resp_code) {
$('#data').html(syntaxHighlight(data.datas));
$('#data').html(syntaxHighlight(data.data));
} else {
layer.msg('获取索引信息失败', {icon: 2, time: 500});
}
@@ -53,4 +53,4 @@
return '<span class="' + cls + '">' + match + '</span>';
});
}
</script>
</script>
@@ -83,7 +83,7 @@
layer.closeAll('loading');
if (0 === data.resp_code) {
let selected = false;
$.each(data.datas,function(index,item){
$.each(data.data,function(index,item){
if (config.clientId === item.clientId) {
selected = true;
} else {
@@ -185,4 +185,4 @@
renderTable(data.value);
});
});
</script>
</script>
@@ -59,7 +59,7 @@
admin.req('api-user/users/current', {}, function (data) {
// 回显user数据
if (data && data.resp_code === 0) {
let user = data.datas;
let user = data.data;
user.sex = user.sex.toString();
form.val('user-form', user);
$('#user-form').attr('method', 'PUT');
@@ -75,7 +75,7 @@
$(".layui-nav-img").attr("src",$("[name=headImgUrl]").val());
layer.msg("操作成功", {icon: 1, time: 500});
form.val('user-form',data.datas);
form.val('user-form',data.data);
} else {
layer.msg(data.resp_msg, {icon: 2, time: 500});
}
@@ -109,4 +109,4 @@
});
});
</script>
</script>
@@ -101,7 +101,7 @@
layer.closeAll('loading');
if (0 === data.resp_code) {
let selected = false;
$.each(data.datas,function(index,item){
$.each(data.data,function(index,item){
if (config.clientId === item.clientId) {
selected = true;
} else {
@@ -257,4 +257,4 @@
});
});
</script>
</script>
@@ -62,7 +62,7 @@
layer.closeAll('loading');
if (0 === data.resp_code) {
let selected = false;
$.each(data.datas,function(index,item){
$.each(data.data,function(index,item){
if (config.clientId === item.clientId) {
selected = true;
} else {
@@ -108,4 +108,4 @@
table.reload('tokens-table', {where: {tenantId: data.value}});
});
});
</script>
</script>
@@ -58,8 +58,8 @@
if (0 == data.resp_code) {
// 渲染多选下拉框
var roleSelectData = new Array();
for (var i = 0; i < data.datas.length; i++) {
roleSelectData.push({name: data.datas[i].name, value: data.datas[i].id});
for (var i = 0; i < data.data.length; i++) {
roleSelectData.push({name: data.data[i].name, value: data.data[i].id});
}
formSelects.data('roleId', 'local', {arr: roleSelectData});
@@ -96,4 +96,4 @@
return false;
});
});
</script>
</script>