Merge branch 'master' of https://github.com/merelendor/evoleasing-account
This commit is contained in:
commit
38eb804b02
@ -58,6 +58,7 @@ export default class DigitalCertificates extends React.Component
|
||||
.then((cert) =>
|
||||
{
|
||||
console.log("certificate", JSON.stringify(cert));
|
||||
console.log("company", JSON.stringify(company));
|
||||
|
||||
//console.log({ cert });
|
||||
if(cert.IsValid)
|
||||
@ -66,7 +67,7 @@ export default class DigitalCertificates extends React.Component
|
||||
{
|
||||
if(cert.Subject['INN'] !== undefined && cert.Subject['INN'] !== null && cert.Subject['INN'] !== "")
|
||||
{
|
||||
if(company.inn === cert.Subject['INN'])
|
||||
if(main.inn === cert.Subject['INN'])
|
||||
{
|
||||
callback(null, [ { id: certificate.id, fields: cert.Subject, valid_to_date: moment(cert.ValidToDate).format("DD.MM.YYYY") } ]);
|
||||
}
|
||||
@ -286,7 +287,7 @@ export default class DigitalCertificates extends React.Component
|
||||
<FormMessage type="moderate" title="Ошибка" message={ <>Плагин КриптоПРО не активирован, пожалуйста, обновите страницу и подтвердите разрешение для сайта на доступ к списку сертификатов.</> }/>
|
||||
) }
|
||||
{ certificates_error === "ISSUED" && (
|
||||
<FormMessage type="moderate" title="Ошибка" message={ <>Анкету необходимо подписать по ЭЦП сертификатом юридического лица с ИНН: { company.inn }, выданного: { head_person.lastname } { head_person.firstname } { head_person.middlename }. Такой сертификат не найден.</> }/>
|
||||
<FormMessage type="moderate" title="Ошибка" message={ <>Анкету необходимо подписать по ЭЦП сертификатом юридического лица с ИНН: { main.inn }, выданного: { head_person.lastname } { head_person.firstname } { head_person.middlename }. Такой сертификат не найден.</> }/>
|
||||
) }
|
||||
{ certificates_error === "MISMATCH" && (
|
||||
<FormMessage type="moderate" title="Ошибка" message={ <>Подписант не соответствует указанному подписанту в анкете.</> }/>
|
||||
|
||||
@ -117,7 +117,7 @@ export default class FilesList extends React.Component
|
||||
</svg>
|
||||
<p><b>Ошибка</b>
|
||||
{ errors.map((filename, index) => (
|
||||
<React.Fragment key={ index }><span>Файл «{ filename }» превышает допустимый лимит в { process.env.NEXT_PUBLIC_UPLOAD_FILESIZE_LIMIT_MB }мб и не может быть загружен.</span><br/></React.Fragment>
|
||||
<React.Fragment key={ index }><span>Файл «{ filename }» превышает допустимый лимит в { process.env.NEXT_PUBLIC_UPLOAD_FILESIZE__MB }мб и не может быть загружен.</span><br/></React.Fragment>
|
||||
)) }
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@ -114,7 +114,7 @@ main .title_wrapper .right {
|
||||
}
|
||||
main .title_wrapper .company-dropdown {
|
||||
position: relative;
|
||||
z-index: 15;
|
||||
z-index: 100;
|
||||
}
|
||||
main .title_wrapper .company-dropdown .arrow {
|
||||
cursor: pointer;
|
||||
|
||||
@ -121,7 +121,7 @@ main {
|
||||
|
||||
.company-dropdown {
|
||||
position: relative;
|
||||
z-index: 15;
|
||||
z-index: 100;
|
||||
|
||||
.arrow {
|
||||
cursor: pointer;
|
||||
|
||||
9375
package-lock.json
generated
9375
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,8 @@
|
||||
import { reduxWrapper } from '../store'
|
||||
import numeral from 'numeral';
|
||||
import Script from 'next/script';
|
||||
import jwt from 'jsonwebtoken';
|
||||
//import 'https://chat.autofaq.ai/widget/static/css/main.css';
|
||||
|
||||
import '../css/style.css';
|
||||
|
||||
@ -28,7 +30,7 @@ const WrappedApp = (props) =>
|
||||
|
||||
return (
|
||||
<>
|
||||
{ props.observer && (
|
||||
{ !props.observer && (
|
||||
<>
|
||||
<Script id="yandex-metrica" strategy={'afterInteractive'}>
|
||||
{`
|
||||
@ -42,6 +44,37 @@ const WrappedApp = (props) =>
|
||||
console.log(ym, ${ process.env.NEXT_PUBLIC_YANDEX_METRIKA_ID });
|
||||
`}
|
||||
</Script>
|
||||
{ process.env.NEXT_PUBLIC_AUTOFAQ_AI_ENABLED == 1 && (
|
||||
<>
|
||||
<link href="//chat.autofaq.ai/widget/static/css/main.css" rel="stylesheet" />
|
||||
<Script id="auto-faq" strategy={'afterInteractive'}>
|
||||
{`
|
||||
window.widgetHost = "https://chat.autofaq.ai";
|
||||
window.widgetServiceId = "${ process.env.NEXT_PUBLIC_AUTOFAQ_AI_SERVICE_ID }";
|
||||
window.widgetChannelId = "${ process.env.NEXT_PUBLIC_AUTOFAQ_AI_CHANNEL_ID }";
|
||||
|
||||
window.widgetUserLogin = ${ props.acc !== null ? `"${ props.acc }"` : "undefined" };
|
||||
window.widgetUserEmail = ${ props.email !== null ? `"${ props.email }"` : "undefined" };
|
||||
window.widgetUserPayload = ${ props.acc !== null ? `{ "acc_number": "${ props.acc }" }` : "undefined" };
|
||||
|
||||
console.log("widget", {
|
||||
widgetHost: window.widgetHost,
|
||||
widgetServiceId: window.widgetServiceId,
|
||||
widgetChannelId: window.widgetChannelId,
|
||||
widgetUserLogin: window.widgetUserLogin,
|
||||
widgetUserEmail: window.widgetUserEmail,
|
||||
widgetUserPayload: window.widgetUserPayload,
|
||||
});
|
||||
|
||||
const script = document.createElement('script');
|
||||
script.id = "autofaqWidget";
|
||||
script.type = "text/javascript";
|
||||
script.src = "https://chat.autofaq.ai/widget/static/js/main.js";
|
||||
document.head.appendChild(script);
|
||||
`}
|
||||
</Script>
|
||||
</>
|
||||
) }
|
||||
<noscript>
|
||||
<div>
|
||||
<img src={`https://mc.yandex.ru/watch/${ process.env.NEXT_PUBLIC_YANDEX_METRIKA_ID }`} style={{ position:'absolute', left:'-9999px' }} alt=""/>
|
||||
@ -57,20 +90,41 @@ const WrappedApp = (props) =>
|
||||
WrappedApp.getInitialProps = async (props) =>
|
||||
{
|
||||
const { req } = props.ctx;
|
||||
|
||||
let observer = true;
|
||||
|
||||
let observer = false;
|
||||
let acc = null;
|
||||
let email = null;
|
||||
|
||||
if(req !== undefined)
|
||||
{
|
||||
const { cookies } = req;
|
||||
|
||||
if(cookies !== undefined && cookies !== null)
|
||||
{
|
||||
if(cookies.jwt !== undefined && cookies.jwt !== null)
|
||||
{
|
||||
let client_jwt_decoded = jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT);
|
||||
console.log({ client_jwt_decoded });
|
||||
acc = client_jwt_decoded.acc_number;
|
||||
email = client_jwt_decoded.login;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(req !== undefined && req.url !== null && req.url.indexOf("offstage") > -1)
|
||||
{
|
||||
observer = false;
|
||||
observer = true;
|
||||
}
|
||||
|
||||
if(req !== undefined && req.cookies !== undefined && req.cookies.observer !== undefined && req.cookies.observer === "true")
|
||||
{
|
||||
observer = false;
|
||||
observer = true;
|
||||
}
|
||||
|
||||
return {
|
||||
observer,
|
||||
acc,
|
||||
email,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user