This commit is contained in:
vchikalkin 2020-11-16 11:06:44 +03:00
parent 2c4b85e743
commit c3f1eb5a4f
5 changed files with 7 additions and 10 deletions

View File

@ -1,5 +0,0 @@
import { observable } from 'mobx';
const CommonStore = observable({});
export default CommonStore;

View File

@ -1,10 +1,8 @@
import CalculationStore from './CalculationStore';
import CommonStore from './CommonStore';
class RootStore {
constructor() {
this.calculationStore = CalculationStore;
this.commonStore = CommonStore;
}
}

View File

@ -1,5 +1,6 @@
import CalculationService from 'client/services/CalculationService';
import { User } from 'core/types/user';
import { domainName } from 'core/constants/domain';
export const getUser = async (): Promise<User> => {
function getFullName(user: User) {
@ -14,7 +15,7 @@ export const getUser = async (): Promise<User> => {
}
}
var username = prompt('Enter username');
const user: User = { UserName: username || '', DomainName: 'EVOLEASING' };
const user: User = { UserName: username || '', DomainName: domainName };
localStorage.setItem('user', JSON.stringify(user));
return { ...user, FullName: getFullName(user) };
}

View File

@ -0,0 +1,2 @@
export const domainName = 'EVOLEASING';
export const LDAP_URL = 'ldap://evoleasing.ru';

View File

@ -8,6 +8,7 @@ import morgan from 'morgan';
import path from 'path';
import 'reflect-metadata';
import { SERVER_PORT } from './../core/constants/urls';
import { domainName, LDAP_URL } from './../core/constants/domain';
import routes from './routes';
const isDevelopmentMode = process.env.NODE_ENV === 'development';
@ -18,8 +19,8 @@ const app = express();
if (!isDevelopmentMode)
app.use(
ntlm({
domain: 'EVOLEASING',
domaincontroller: 'ldap://evoleasing.ru',
domain: domainName,
domaincontroller: LDAP_URL,
}),
);
/** AUTHENTICATION */