Если с массивом в жидкости - PullRequest
0 голосов
/ 19 марта 2020

Я пытаюсь ограничить, сколько доменов может получить доступ к порталу. Изначально мы использовали contains, поскольку это был только 1 домен, но мы открываем его и не работаем с кратными в жидкости Совсем новый

Код с содержанием.

{% else  %}
	{% if portal.has_user_signed_in == true and {{portal.user.email}} contains @domain1 %}
	{% else %}
    <script>
      jQuery(document).ready(function() {
        window.location.replace("website");
            event.stopImmediatePropagation();
        });
    </script>
	{% endif %}
{% endif %}

Я пытаюсь добавить от 5 до 6 дополнительных доменов, и меня отключают. Должен ли я использовать содержит с или или построить массив с содержит

Содержит с ИЛИ

</script>

{% else  %}

	{% if portal.has_user_signed_in == true and {{portal.user.email}} contains domain1 or domain2 %}
	{% else %}
    <script>
      jQuery(document).ready(function() {
        window.location.replace("website");
            event.stopImmediatePropagation();
        });
    </script>
	{% endif %}
{% endif %}
**Array with Contain**

{% else  %}
{% assign mydomains = "domain1|domain2|domain3"| split: "|" %}
	{% if portal.has_user_signed_in == true and {{portal.user.email}} contains mydomains %}
	{% else %}
    <script>
      jQuery(document).ready(function() {
        window.location.replace("website");
            event.stopImmediatePropagation();
        });
    </script>
	{% endif %}
{% endif %}
...