From 20be8af0b8bb6ede39b91237f9f9975dba5ad04d Mon Sep 17 00:00:00 2001
From: laurieryayoi <14360417+laurieryayoi@users.noreply.github.com>
Date: Sun, 31 Mar 2019 16:12:26 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BF=AB=E9=80=9F=E5=88=9B=E5=BB=BA=E7=94=A8?=
=?UTF-8?q?=E6=88=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/Controllers/Admin/UserController.php | 2 +-
resources/views/material/admin/user/index.tpl | 47 ++++++++++++++++++-
2 files changed, 46 insertions(+), 3 deletions(-)
diff --git a/app/Controllers/Admin/UserController.php b/app/Controllers/Admin/UserController.php
index 255e0362..73754c3f 100644
--- a/app/Controllers/Admin/UserController.php
+++ b/app/Controllers/Admin/UserController.php
@@ -18,7 +18,7 @@ use App\Utils\Radius;
use App\Utils\QQWry;
use App\Utils\Check;
use App\Utils\Tools;
-
+use App\Utils\GA;
class UserController extends AdminController
{
diff --git a/resources/views/material/admin/user/index.tpl b/resources/views/material/admin/user/index.tpl
index 1df3cf95..3fbef160 100644
--- a/resources/views/material/admin/user/index.tpl
+++ b/resources/views/material/admin/user/index.tpl
@@ -21,6 +21,22 @@
+
+
{include file='table/table.tpl'}
@@ -178,7 +194,7 @@ window.addEventListener('load', () => {
},
error: jqXHR => {
$("#result").modal();
- $$.getElementById('msg').innerHTML = `${ldelim}data.msg{rdelim} 发生了错误。`;
+ $$.getElementById('msg').innerHTML = `${ldelim}jqXHR{rdelim} 发生了错误。`;
}
});
}
@@ -213,12 +229,39 @@ window.addEventListener('load', () => {
},
error: jqXHR => {
$("#result").modal();
- $$.getElementById('msg').innerHTML = `${ldelim}data.msg{rdelim} 发生了错误。`;
+ $$.getElementById('msg').innerHTML = `${ldelim}jqXHR{rdelim} 发生了错误。`;
}
});
}
$$.getElementById('changetouser_input').addEventListener('click', changetouser_id);
+
+ function quickCreate() {
+ $.ajax({
+ type: 'POST',
+ url: '/admin/user/create',
+ dataType: 'json',
+ data: {
+ userEmail: $$getValue('quick_create')
+ },
+ success: data => {
+ if (data.ret) {
+ $("#result").modal();
+ $$.getElementById('msg').innerHTML = data.msg;
+ window.setTimeout("location.href='/admin/user'", {$config['jump_delay']});
+ } else {
+ $("#result").modal();
+ $$.getElementById('msg').innerHTML = data.msg;
+ }
+ },
+ error: jqXHR => {
+ $("#result").modal();
+ $$.getElementById('msg').innerHTML = `${ldelim}jqXHR{rdelim} 发生了错误。`;
+ }
+ })
+ }
+
+ $$.getElementById('quick_create_confirm').addEventListener('click', quickCreate)
})