Browse Source

feat: open permission

main
xuziqiang 4 months ago
parent
commit
bd89f7973d
  1. 3
      hx-ai-intelligent/src/api/origanizemanage.ts
  2. 25
      hx-ai-intelligent/src/config/app.config.ts
  3. 4291
      hx-ai-intelligent/src/config/resource.json
  4. 8
      lib/saas/store/modules/route.ts

3
hx-ai-intelligent/src/api/origanizemanage.ts

@ -1,4 +1,7 @@
const BASE_URL = '/carbon-smart'; const BASE_URL = '/carbon-smart';
export enum permission {
add = `${BASE_URL}/admin/permission/save`,
}
export enum origanizemanage { export enum origanizemanage {
userList = '/carbon-smart/api/user/queryUserByPage', userList = '/carbon-smart/api/user/queryUserByPage',

25
hx-ai-intelligent/src/config/app.config.ts

@ -3,6 +3,8 @@ import { dateUtil } from '/nerv-lib/util/date-util';
import mockResource from './resource.json'; import mockResource from './resource.json';
import { http } from '/nerv-lib/saas'; import { http } from '/nerv-lib/saas';
import { ref } from 'vue'; import { ref } from 'vue';
import { permission } from '/@/api/origanizemanage';
const value = ref('1'); const value = ref('1');
const transform = (data, map) => { const transform = (data, map) => {
return Object.keys(map).reduce((pre, cur) => { return Object.keys(map).reduce((pre, cur) => {
@ -13,7 +15,7 @@ const transform = (data, map) => {
export const appConfig = { export const appConfig = {
projectType: 'web', projectType: 'web',
baseApi: '/api', baseApi: '/api',
enablePermissions: false, enablePermissions: true,
// themeColor: '#eee', // themeColor: '#eee',
siderPosition: 'left', siderPosition: 'left',
baseHeader: '/parkingManage', baseHeader: '/parkingManage',
@ -94,16 +96,15 @@ export const appConfig = {
// toRouterName: 'NoticeManageIndex', // toRouterName: 'NoticeManageIndex',
// }, // },
resourceInfo: { resourceInfo: {
application: { // application: {
version: '1.1.74', // version: '1.1.74',
label: '停车业务平台', // label: '停车业务平台',
dataScope: { // dataScope: {
scopeMode: 0, // scopeMode: 0,
scopeType: '', // scopeType: '',
dataTips: '', // dataTips: '',
}, // },
}, // },
api: '/qa/Operation/Resources/Pc/init', api: permission.add,
token: `${dateUtil().format('YYYYMMDD')}1a329ffasasozozxqq66cfab7`,
}, },
}; };

4291
hx-ai-intelligent/src/config/resource.json

File diff suppressed because it is too large

8
lib/saas/store/modules/route.ts

@ -1,4 +1,3 @@
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import { RouteMenu } from '/nerv-base/router/helper/menu-helper'; import { RouteMenu } from '/nerv-base/router/helper/menu-helper';
import { ModuleMenu } from '/nerv-base/router/types'; import { ModuleMenu } from '/nerv-base/router/types';
@ -89,7 +88,8 @@ export const useRouteStore = defineStore({
this.route.sort((a, b) => { this.route.sort((a, b) => {
return a.meta?.index - b.meta?.index; return a.meta?.index - b.meta?.index;
}); });
const initPcResource = { application: {}, menus: [] }; // const initPcResource = { application: {}, menus: [] };
let initPcResource = [];
this.routeModule.sort((a, b) => { this.routeModule.sort((a, b) => {
return a.route?.meta?.index - b.route?.meta?.index; return a.route?.meta?.index - b.route?.meta?.index;
}); });
@ -115,8 +115,8 @@ export const useRouteStore = defineStore({
delete item.route; delete item.route;
}); });
} }
initPcResource.application = appConfig.resourceInfo?.application as object; // initPcResource.application = appConfig.resourceInfo?.application as object;
initPcResource.menus = appConfig.resourceInfo?.dealReosurceList initPcResource = appConfig.resourceInfo?.dealReosurceList
? appConfig.resourceInfo?.dealReosurceList(info) ? appConfig.resourceInfo?.dealReosurceList(info)
: info; : info;
new NSAxios({ new NSAxios({

Loading…
Cancel
Save