mirror of
https://github.com/simple-login/app.git
synced 2025-02-23 15:23:27 +08:00
move script block to the end
This commit is contained in:
parent
634ad4ac19
commit
ea00e2ba8f
1 changed files with 26 additions and 26 deletions
|
@ -16,33 +16,7 @@
|
|||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#alias-group',
|
||||
data: {
|
||||
ticket_email: '{{ ticket_email }}'
|
||||
},
|
||||
methods: {
|
||||
generateRandomAlias: async function (event) {
|
||||
let result = await fetch('/api/alias/random/new', {method: 'POST'})
|
||||
if (result.ok) {
|
||||
let data = await result.json();
|
||||
this.ticket_email = data.alias;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('.custom-file input').change(function (e) {
|
||||
let files = [];
|
||||
for (let i = 0; i < $(this)[0].files.length; i++) {
|
||||
files.push($(this)[0].files[i].name);
|
||||
}
|
||||
$(this).next('.custom-file-label').html(files.join(', '));
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block default_content %}
|
||||
|
||||
|
@ -98,5 +72,31 @@
|
|||
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#alias-group',
|
||||
data: {
|
||||
ticket_email: '{{ ticket_email }}'
|
||||
},
|
||||
methods: {
|
||||
generateRandomAlias: async function (event) {
|
||||
let result = await fetch('/api/alias/random/new', {method: 'POST'})
|
||||
if (result.ok) {
|
||||
let data = await result.json();
|
||||
this.ticket_email = data.alias;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('.custom-file input').change(function (e) {
|
||||
let files = [];
|
||||
for (let i = 0; i < $(this)[0].files.length; i++) {
|
||||
files.push($(this)[0].files[i].name);
|
||||
}
|
||||
$(this).next('.custom-file-label').html(files.join(', '));
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue