You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
3.2 KiB

/** @format */
import { dateUtil } from '/nerv-lib/util/date-util';
import mockResource from './resource.json';
10 months ago
import { http } from '/nerv-lib/saas';
import { ref } from 'vue';
import { permission } from '/@/api/origanizemanage';
10 months ago
// const { linkList } = sessionStorage.getItem('userInfo')
// ? JSON.parse(sessionStorage.getItem('userInfo')!)
// : [{}];
// const value = ref(linkList[0]?.orgId);
10 months ago
const transform = (data, map) => {
return Object.keys(map).reduce((pre, cur) => {
pre[cur] = data[map[cur]];
return pre;
}, {});
};
export const appConfig = {
projectType: 'web',
baseApi: '/api',
10 months ago
enablePermissions: false,
10 months ago
// themeColor: '#eee',
siderPosition: 'left',
baseHeader: '/parkingManage',
baseRouter: '/parkingManage/parkingLotManage',
themeConfig: {
bgImageUrl: `${import.meta.env.VITE_PUBLIC_PATH}/asset/image/login/background.png`,
},
// userCustomRouterGuard: (to, from, next, whiteNameList, authorizationStore, appConfig) => {
// console.log({ to, from, next, whiteNameList, authorizationStore, appConfig }, 'routeConfig');
// next();
// },
// customUpdatePwd: () => import('/@/view/updatePassword/updatePassword.vue'),
10 months ago
// userInfoApi: () => {
// return {
// code: 200,
// success: true,
// data: {
// accountCode: '1305107806187376793',
// accountName: 'adm*n',
// accountType: 'admin',
// accountStatus: 1,
// accountRealName: 'admin',
// organizationCode: 'dingcloud',
// authConfigList: [],
// organizeResCode: [],
// leadDepartmentUuidList: [],
// },
// };
// },
headerSlotConfig: {
10 months ago
component: 'NsSelectApi',
componentProps: {
style: { width: '200px' },
10 months ago
api: '/carbon-smart/user/login/logInInfo',
placeholder: '请选择',
10 months ago
autoSelectFirst: true,
onChange: (cur) => {
10 months ago
// value.value = cur;
},
10 months ago
resultField: 'data.linkList',
labelField: 'orgName',
valueField: 'orgId',
immediate: true,
dropdownReload: true,
},
},
timeout: 60 * 1000,
10 months ago
userLoginApi: '/carbon-smart/user/login',
userResourceApi: () => {
return { data: mockResource.menus };
},
userInfoApi: () => {
10 months ago
return http.post('/carbon-smart/user/login/logInInfo').then((res) => {
const info = res.data;
const trD = transform(info, {
accountCode: 'userId',
accountName: 'realName',
accountRealName: 'realName',
10 months ago
orgId: 'orgId',
10 months ago
orgName: 'orgName',
projectId: 'projectId',
10 months ago
linkList: 'linkList',
permissionInfoList: 'permissionInfoList',
10 months ago
});
10 months ago
10 months ago
return { data: { ...trD } };
});
},
10 months ago
useHistoryTag: false,
// 修改密码配置
updatePassWordInfo: {
title: '修改密码',
10 months ago
subtitle: 'huaxing平台',
api: '/api/web/objs/User/changePassword',
},
// headerBellInfo: {
// isShow: true,
// api: '/api/web/objs/bulletin/readCount',
// toRouterName: 'NoticeManageIndex',
// },
resourceInfo: {
// application: {
// version: '1.1.74',
// label: '停车业务平台',
// dataScope: {
// scopeMode: 0,
// scopeType: '',
// dataTips: '',
// },
// },
api: permission.add,
},
};