mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
路由管理优化
This commit is contained in:
24
sop-admin/sop-admin-front/assets/js/common.js
Normal file
24
sop-admin/sop-admin-front/assets/js/common.js
Normal file
@@ -0,0 +1,24 @@
|
||||
var Common = (function () {
|
||||
|
||||
function initProfiles() {
|
||||
var $profileList = $('#profileList');
|
||||
if ($profileList.length > 0) {
|
||||
ApiUtil.post('system.profile.list', {}, function (resp) {
|
||||
var list = resp.data;
|
||||
var html = [];
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
html.push('<li' + (i == 0 ? ' class="layui-this"' : '') + '>' + list[i] + '</li>');
|
||||
}
|
||||
$profileList.html(html.join(''))
|
||||
|
||||
$profileList.find('li').on('click', function () {
|
||||
window.profile = $(this).text();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
initProfiles();
|
||||
|
||||
return {}
|
||||
})();
|
Reference in New Issue
Block a user