12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import ajax from 'jquery/src/ajax/xhr.js'
- import $ from 'jquery/src/ajax';
- module.exports = {
- getMenu: function (index) {
- var menuArr = [];
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- async: false,
- url: globalConfig.context + "/api/admin/selectMenuList",
- data: {
- navId: index[0]
- },
- success: function (data) {
- if (!data.data) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- return;
- };
- };
- menuArr = data.data;
- // 如果不是管理员 某某人员变更审核简单写为变更审核
- // window.setTimeout(() => {
- // console.log($(".account-left"));
- // })
- if (window.adminData.isSuperAdmin) return
- menuArr.forEach(first => {
- first.subMenus.forEach(second => {
- let str = second.name.substring(second.name.length - 6, second.name.length)
- if (str == "变更审核列表") {
- second.name = "变更审核"
- } else if (str == "变更查看列表") {
- second.name = "变更查看"
- }
- })
- });
- }
- })
- return menuArr;
- },
- }
|