|
@ -1,9 +1,9 @@ |
|
|
/** @format */ |
|
|
import { userInfo, userResource } from './../../../hx-op/src/api/user'; |
|
|
import { dateUtil } from '/nerv-lib/util/date-util'; |
|
|
|
|
|
import mockResource from './resource.json'; |
|
|
|
|
|
import { http } from '/nerv-lib/saas'; |
|
|
import { http } from '/nerv-lib/saas'; |
|
|
import { ref } from 'vue'; |
|
|
|
|
|
import { permission } from '/@/api/origanizemanage'; |
|
|
import { permission } from '/@/api/origanizemanage'; |
|
|
|
|
|
import { appConfigStore } from '/nerv-lib/saas/store/modules/app-config'; |
|
|
|
|
|
import { authorizationService } from '/nerv-base/store/modules/authorization-service'; |
|
|
|
|
|
import { isEmpty } from 'lodash-es'; |
|
|
|
|
|
|
|
|
// const { permissionVos } = sessionStorage.getItem('userInfo');
|
|
|
// const { permissionVos } = sessionStorage.getItem('userInfo');
|
|
|
// ? JSON.parse(sessionStorage.getItem('userInfo')!)
|
|
|
// ? JSON.parse(sessionStorage.getItem('userInfo')!)
|
|
@ -59,7 +59,13 @@ export const appConfig = { |
|
|
api: '/carbon-smart/user/login/logInInfo', |
|
|
api: '/carbon-smart/user/login/logInInfo', |
|
|
placeholder: '请选择', |
|
|
placeholder: '请选择', |
|
|
autoSelectFirst: true, |
|
|
autoSelectFirst: true, |
|
|
onChange: (cur) => { |
|
|
onChange: async (cur, record) => { |
|
|
|
|
|
console.log(cur, record); |
|
|
|
|
|
const configStore = appConfigStore(); |
|
|
|
|
|
const useAuthorization = authorizationService(); |
|
|
|
|
|
|
|
|
|
|
|
const res = await configStore.userResource(record); |
|
|
|
|
|
useAuthorization.updateUserResource(res.data); |
|
|
// value.value = cur;
|
|
|
// value.value = cur;
|
|
|
}, |
|
|
}, |
|
|
resultField: 'data.linkList', |
|
|
resultField: 'data.linkList', |
|
@ -73,18 +79,24 @@ export const appConfig = { |
|
|
userLoginApi: (params) => { |
|
|
userLoginApi: (params) => { |
|
|
return http.post('/carbon-smart/user/login', { ...params }); |
|
|
return http.post('/carbon-smart/user/login', { ...params }); |
|
|
}, |
|
|
}, |
|
|
userResourceApi: () => { |
|
|
userResourceApi: (params) => { |
|
|
return http.post('/carbon-smart/user/login/logInInfo').then((res) => { |
|
|
console.log(params, 'userResource'); |
|
|
return { data: res.data.permissionVos }; |
|
|
|
|
|
}); |
|
|
const userInfo = JSON.parse(sessionStorage.getItem('userInfo')!); |
|
|
|
|
|
const ownOrgInfo = userInfo.linkList?.filter(({ isOwn }) => isOwn)[0]; |
|
|
|
|
|
return http |
|
|
|
|
|
.post('/carbon-smart/user/login/logInPermission', !isEmpty(params) ? params : ownOrgInfo) |
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
return res; |
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
userInfoApi: () => { |
|
|
userInfoApi: () => { |
|
|
return http.post('/carbon-smart/user/login/logInInfo').then((res) => { |
|
|
return http.post('/carbon-smart/user/login/logInInfo').then((res) => { |
|
|
const info = res.data; |
|
|
const info = res.data; |
|
|
const trD = transform(info, { |
|
|
const trD = transform(info, { |
|
|
accountCode: 'userId', |
|
|
accountCode: 'userId', |
|
|
accountName: 'realName', |
|
|
accountName: 'accountNo', |
|
|
accountRealName: 'realName', |
|
|
accountRealName: 'accountNo', |
|
|
orgId: 'orgId', |
|
|
orgId: 'orgId', |
|
|
orgName: 'orgName', |
|
|
orgName: 'orgName', |
|
|
projectId: 'projectId', |
|
|
projectId: 'projectId', |
|
|