diff --git a/app/Http/Admin/Controllers/UserController.php b/app/Http/Admin/Controllers/UserController.php index e90039d3..d1482164 100644 --- a/app/Http/Admin/Controllers/UserController.php +++ b/app/Http/Admin/Controllers/UserController.php @@ -84,7 +84,7 @@ class UserController extends Controller $roles = $userService->getRoles(); if ($user->admin_role == RoleModel::ROLE_ROOT) { - $this->response->redirect(['action' => 'list']); + $this->response->redirect(['for' => 'admin.user.list']); } $this->view->setVar('user', $user); diff --git a/app/Http/Admin/Views/nav/list.volt b/app/Http/Admin/Views/nav/list.volt index 669a1eed..20bf8ba2 100644 --- a/app/Http/Admin/Views/nav/list.volt +++ b/app/Http/Admin/Views/nav/list.volt @@ -4,17 +4,17 @@ {%- macro position_info(value) %} {% if value == 1 %} - 顶部 + 顶部 {% elseif value == 2 %} - 底部 + 底部 {% endif %} {%- endmacro %} {%- macro target_info(value) %} {% if value == '_blank' %} - 新窗口 + 新窗口 {% elseif value == '_self' %} - 原窗口 + 原窗口 {% endif %} {%- endmacro %} diff --git a/app/Http/Admin/Views/order/macro.volt b/app/Http/Admin/Views/order/macro.volt index f6ef13a7..6424d9f7 100644 --- a/app/Http/Admin/Views/order/macro.volt +++ b/app/Http/Admin/Views/order/macro.volt @@ -38,28 +38,28 @@ {%- macro item_type(value) %} {% if value == 1 %} - 课程 + 课程 {% elseif value == 2 %} - 套餐 + 套餐 {% elseif value == 3 %} - 赞赏 + 赞赏 {% elseif value == 4 %} - 会员 + 会员 {% elseif value == 99 %} - 测试 + 测试 {% endif %} {%- endmacro %} {%- macro order_status(value) %} {% if value == 1 %} - 待支付 + 待支付 {% elseif value == 2 %} - 发货中 + 发货中 {% elseif value == 3 %} - 已完成 + 已完成 {% elseif value == 4 %} - 已关闭 + 已关闭 {% elseif value == 5 %} - 已退款 + 已退款 {% endif %} {%- endmacro %} \ No newline at end of file diff --git a/app/Http/Admin/Views/refund/macro.volt b/app/Http/Admin/Views/refund/macro.volt index d377f90e..6320281f 100644 --- a/app/Http/Admin/Views/refund/macro.volt +++ b/app/Http/Admin/Views/refund/macro.volt @@ -1,16 +1,16 @@ {%- macro refund_status(value) %} {% if value == 1 %} - 待处理 + 待处理 {% elseif value == 2 %} - 已取消 + 已取消 {% elseif value == 3 %} - 已审核 + 已审核 {% elseif value == 4 %} - 已拒绝 + 已拒绝 {% elseif value == 5 %} - 已完成 + 已完成 {% elseif value == 6 %} - 已失败 + 已失败 {% endif %} {%- endmacro %} diff --git a/app/Http/Admin/Views/role/list.volt b/app/Http/Admin/Views/role/list.volt index b89a2d79..ab2dceab 100644 --- a/app/Http/Admin/Views/role/list.volt +++ b/app/Http/Admin/Views/role/list.volt @@ -3,10 +3,10 @@ {% block content %} {%- macro type_info(value) %} - {% if value == 'system' %} - 内置 - {% elseif value == 'custom' %} - 自定 + {% if value == 1 %} + 内置 + {% elseif value == 2 %} + 自定义 {% endif %} {%- endmacro %} @@ -43,7 +43,7 @@ {% set restore_url = url({'for':'admin.role.restore','id':item.id}) %} {{ item.id }} - {{ item.name }} + {{ item.name }} {{ type_info(item.type) }} diff --git a/app/Http/Admin/Views/slide/list.volt b/app/Http/Admin/Views/slide/list.volt index fb832a23..919d8c0c 100644 --- a/app/Http/Admin/Views/slide/list.volt +++ b/app/Http/Admin/Views/slide/list.volt @@ -4,11 +4,11 @@ {%- macro target_info(value) %} {% if value == 1 %} - 课程 + 课程 {% elseif value == 2 %} - 单页 + 单页 {% elseif value == 3 %} - 链接 + 链接 {% endif %} {%- endmacro %} diff --git a/app/Http/Admin/Views/student/list.volt b/app/Http/Admin/Views/student/list.volt index 453db91d..bc673b7b 100644 --- a/app/Http/Admin/Views/student/list.volt +++ b/app/Http/Admin/Views/student/list.volt @@ -4,11 +4,11 @@ {%- macro source_type_info(value) %} {% if value == 1 %} - 免费 + 免费 {% elseif value == 2 %} 付费 {% elseif value == 3 %} - 导入 + 导入 {% endif %} {%- endmacro %} diff --git a/app/Http/Admin/Views/templates/layer.volt b/app/Http/Admin/Views/templates/layer.volt index 96287252..529288fe 100644 --- a/app/Http/Admin/Views/templates/layer.volt +++ b/app/Http/Admin/Views/templates/layer.volt @@ -1,7 +1,7 @@ - + diff --git a/app/Http/Admin/Views/templates/main.volt b/app/Http/Admin/Views/templates/main.volt index 5e222058..3c1345f1 100644 --- a/app/Http/Admin/Views/templates/main.volt +++ b/app/Http/Admin/Views/templates/main.volt @@ -1,7 +1,7 @@ - + diff --git a/app/Http/Admin/Views/trade/macro.volt b/app/Http/Admin/Views/trade/macro.volt index df25e586..331f7ad3 100644 --- a/app/Http/Admin/Views/trade/macro.volt +++ b/app/Http/Admin/Views/trade/macro.volt @@ -1,20 +1,20 @@ {%- macro channel_type(value) %} {% if value == 1 %} - 支付宝 + 支付宝 {% elseif value == 2 %} - 微信 + 微信 {% endif %} {%- endmacro %} {%- macro trade_status(value) %} {% if value == 1 %} - 待支付 + 待支付 {% elseif value == 2 %} - 已完成 + 已完成 {% elseif value == 3 %} - 已关闭 + 已关闭 {% elseif value == 4 %} - 已退款 + 已退款 {% endif %} {%- endmacro %} diff --git a/app/Http/Admin/Views/user/list.volt b/app/Http/Admin/Views/user/list.volt index 837e94cb..19eac204 100644 --- a/app/Http/Admin/Views/user/list.volt +++ b/app/Http/Admin/Views/user/list.volt @@ -4,25 +4,25 @@ {%- macro gender_info(value) %} {% if value == 1 %} - + 男 {% elseif value == 2 %} - + 女 {% elseif value == 3 %} - + 密 {% endif %} {%- endmacro %} {%- macro edu_role_info(user) %} {% if user.edu_role.id == 1 %} - 学员 + 学员 {% elseif user.edu_role.id == 2 %} - 讲师 + 讲师 {% endif %} {%- endmacro %} {%- macro admin_role_info(user) %} - {% if user.admin_role.id %} - {{ user.admin_role.name }} + {% if user.admin_role.id > 0 %} + {{ user.admin_role.name }} {% endif %} {%- endmacro %} diff --git a/app/Http/Home/Controllers/AccountController.php b/app/Http/Home/Controllers/AccountController.php index a0a22076..4e2fc3d0 100644 --- a/app/Http/Home/Controllers/AccountController.php +++ b/app/Http/Home/Controllers/AccountController.php @@ -7,11 +7,7 @@ use App\Services\Logic\Account\EmailUpdate as EmailUpdateService; use App\Services\Logic\Account\PasswordReset as PasswordResetService; use App\Services\Logic\Account\PasswordUpdate as PasswordUpdateService; use App\Services\Logic\Account\PhoneUpdate as PhoneUpdateService; -use Phalcon\Mvc\View; -/** - * @RoutePrefix("/account") - */ class AccountController extends Controller { @@ -24,12 +20,12 @@ class AccountController extends Controller $this->response->redirect('/'); } + $returnUrl = $this->request->getHTTPReferer(); + $service = new AccountService(); $captcha = $service->getSettings('captcha'); - $returnUrl = $this->request->getHTTPReferer(); - $this->view->setVar('return_url', $returnUrl); $this->view->setVar('captcha', $captcha); } @@ -137,60 +133,6 @@ class AccountController extends Controller $this->view->setVar('captcha', $captcha); } - /** - * @Get("/password/edit", name="home.account.edit_pwd") - */ - public function editPasswordAction() - { - if ($this->authUser->id == 0) { - $this->response->redirect(['for' => 'home.account.login']); - } - - $service = new AccountService(); - - $captcha = $service->getSettings('captcha'); - - $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW); - $this->view->pick('account/edit_password'); - $this->view->setVar('captcha', $captcha); - } - - /** - * @Get("/phone/edit", name="home.account.edit_phone") - */ - public function editPhoneAction() - { - if ($this->authUser->id == 0) { - $this->response->redirect(['for' => 'home.account.login']); - } - - $service = new AccountService(); - - $captcha = $service->getSettings('captcha'); - - $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW); - $this->view->pick('account/edit_phone'); - $this->view->setVar('captcha', $captcha); - } - - /** - * @Get("/email/edit", name="home.account.edit_email") - */ - public function editEmailAction() - { - if ($this->authUser->id == 0) { - $this->response->redirect(['for' => 'home.account.login']); - } - - $service = new AccountService(); - - $captcha = $service->getSettings('captcha'); - - $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW); - $this->view->pick('account/edit_email'); - $this->view->setVar('captcha', $captcha); - } - /** * @Post("/password/reset", name="home.account.reset_pwd") */ @@ -219,7 +161,12 @@ class AccountController extends Controller $service->handle(); - $content = ['msg' => '更新手机成功']; + $location = $this->url->get(['for' => 'home.uc.account']); + + $content = [ + 'location' => $location, + 'msg' => '更新手机成功', + ]; return $this->jsonSuccess($content); } @@ -233,7 +180,12 @@ class AccountController extends Controller $service->handle(); - $content = ['msg' => '更新邮箱成功']; + $location = $this->url->get(['for' => 'home.uc.account']); + + $content = [ + 'location' => $location, + 'msg' => '更新邮箱成功', + ]; return $this->jsonSuccess($content); } @@ -247,7 +199,12 @@ class AccountController extends Controller $service->handle(); - $content = ['msg' => '更新密码成功']; + $location = $this->url->get(['for' => 'home.uc.account']); + + $content = [ + 'location' => $location, + 'msg' => '更新密码成功', + ]; return $this->jsonSuccess($content); } diff --git a/app/Http/Home/Controllers/ImController.php b/app/Http/Home/Controllers/ImController.php index a42f4066..f768edb4 100644 --- a/app/Http/Home/Controllers/ImController.php +++ b/app/Http/Home/Controllers/ImController.php @@ -24,7 +24,7 @@ class ImController extends Controller } /** - * @Get("/index", name="home.im.index") + * @Get("/", name="home.im.index") */ public function indexAction() { diff --git a/app/Http/Home/Controllers/TeacherConsoleController.php b/app/Http/Home/Controllers/TeacherConsoleController.php index d98b46c7..53164fe3 100644 --- a/app/Http/Home/Controllers/TeacherConsoleController.php +++ b/app/Http/Home/Controllers/TeacherConsoleController.php @@ -1,6 +1,5 @@ substr($pushUrl, $pos + 1), ]; - $this->view->pick('teacher/console/live_push'); + $this->view->pick('teacher/console/live'); $this->view->setVar('qrcode', $qrcode); $this->view->setVar('obs', $obs); } diff --git a/app/Http/Home/Controllers/UserConsoleController.php b/app/Http/Home/Controllers/UserConsoleController.php index dd814a93..5e159e0e 100644 --- a/app/Http/Home/Controllers/UserConsoleController.php +++ b/app/Http/Home/Controllers/UserConsoleController.php @@ -34,7 +34,7 @@ class UserConsoleController extends Controller } /** - * @Get("/index", name="home.uc.index") + * @Get("/", name="home.uc.index") */ public function indexAction() { @@ -61,9 +61,23 @@ class UserConsoleController extends Controller { $service = new AccountInfoService(); + $captcha = $service->getSettings('captcha'); + $account = $service->handle(); - $this->view->pick('user/console/account'); + $type = $this->request->getQuery('type', 'string', 'info'); + + if ($type == 'info') { + $this->view->pick('user/console/account_info'); + } elseif ($type == 'phone') { + $this->view->pick('user/console/account_phone'); + } elseif ($type == 'email') { + $this->view->pick('user/console/account_email'); + } elseif ($type == 'password') { + $this->view->pick('user/console/account_password'); + } + + $this->view->setVar('captcha', $captcha); $this->view->setVar('account', $account); } @@ -183,8 +197,10 @@ class UserConsoleController extends Controller $service->handle(); + $location = $this->url->get(['for' => 'home.uc.profile']); + $content = [ - 'location' => $this->request->getHTTPReferer(), + 'location' => $location, 'msg' => '更新资料成功', ]; diff --git a/app/Http/Home/Views/account/edit_email.volt b/app/Http/Home/Views/account/edit_email.volt deleted file mode 100644 index 9a9b1b09..00000000 --- a/app/Http/Home/Views/account/edit_email.volt +++ /dev/null @@ -1,42 +0,0 @@ -{% extends 'templates/layer.volt' %} - -{% block content %} - -
-

-
-
- -
-
-
-
- -
-
-
-
- -
-
- -
-
-
-
- - - - -
-
-
- -{% endblock %} - -{% block include_js %} - - {{ js_include('https://ssl.captcha.qq.com/TCaptcha.js',false) }} - {{ js_include('home/js/captcha.verify.js') }} - -{% endblock %} \ No newline at end of file diff --git a/app/Http/Home/Views/account/edit_password.volt b/app/Http/Home/Views/account/edit_password.volt deleted file mode 100644 index b13a77d8..00000000 --- a/app/Http/Home/Views/account/edit_password.volt +++ /dev/null @@ -1,29 +0,0 @@ -{% extends 'templates/layer.volt' %} - -{% block content %} - -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
- -{% endblock %} \ No newline at end of file diff --git a/app/Http/Home/Views/account/edit_phone.volt b/app/Http/Home/Views/account/edit_phone.volt deleted file mode 100644 index d24685ca..00000000 --- a/app/Http/Home/Views/account/edit_phone.volt +++ /dev/null @@ -1,42 +0,0 @@ -{% extends 'templates/layer.volt' %} - -{% block content %} - -
-

-
-
- -
-
-
-
- -
-
-
-
- -
-
- -
-
-
-
- - - - -
-
-
- -{% endblock %} - -{% block include_js %} - - {{ js_include('https://ssl.captcha.qq.com/TCaptcha.js',false) }} - {{ js_include('home/js/captcha.verify.js') }} - -{% endblock %} \ No newline at end of file diff --git a/app/Http/Home/Views/account/forget_password.volt b/app/Http/Home/Views/account/forget_password.volt index d72ccd9d..e6db53df 100644 --- a/app/Http/Home/Views/account/forget_password.volt +++ b/app/Http/Home/Views/account/forget_password.volt @@ -16,20 +16,20 @@
- +
-
+
-
+
- + diff --git a/app/Http/Home/Views/account/login_by_verify.volt b/app/Http/Home/Views/account/login_by_verify.volt index adee53ed..98bfe9a7 100644 --- a/app/Http/Home/Views/account/login_by_verify.volt +++ b/app/Http/Home/Views/account/login_by_verify.volt @@ -5,10 +5,10 @@
-
+
-
+
diff --git a/app/Http/Home/Views/account/register.volt b/app/Http/Home/Views/account/register.volt index 25d65749..160a4121 100644 --- a/app/Http/Home/Views/account/register.volt +++ b/app/Http/Home/Views/account/register.volt @@ -16,20 +16,20 @@
- +
-
+
-
+
- + diff --git a/app/Http/Home/Views/im/group/show.volt b/app/Http/Home/Views/im/group/show.volt index 885f6451..52c54c91 100644 --- a/app/Http/Home/Views/im/group/show.volt +++ b/app/Http/Home/Views/im/group/show.volt @@ -8,7 +8,8 @@ diff --git a/app/Http/Home/Views/templates/error.volt b/app/Http/Home/Views/templates/error.volt index 4fd2b2ad..72c38285 100644 --- a/app/Http/Home/Views/templates/error.volt +++ b/app/Http/Home/Views/templates/error.volt @@ -1,7 +1,8 @@ - + + 出错啦 {{ icon_link("favicon.ico") }} diff --git a/app/Http/Home/Views/templates/layer.volt b/app/Http/Home/Views/templates/layer.volt index 4fa12365..45b9c517 100644 --- a/app/Http/Home/Views/templates/layer.volt +++ b/app/Http/Home/Views/templates/layer.volt @@ -1,7 +1,7 @@ - + diff --git a/app/Http/Home/Views/templates/main.volt b/app/Http/Home/Views/templates/main.volt index dff1f544..a7e06fc3 100644 --- a/app/Http/Home/Views/templates/main.volt +++ b/app/Http/Home/Views/templates/main.volt @@ -1,7 +1,7 @@ - + diff --git a/app/Http/Home/Views/user/console/account_email.volt b/app/Http/Home/Views/user/console/account_email.volt new file mode 100644 index 00000000..5f4dde35 --- /dev/null +++ b/app/Http/Home/Views/user/console/account_email.volt @@ -0,0 +1,54 @@ +{% extends 'templates/main.volt' %} + +{% block content %} + +
+
{{ partial('user/console/menu') }}
+
+
+
+ 账号安全 - 修改邮箱 +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + + + +
+
+
+
+
+
+ +{% endblock %} + +{% block include_js %} + + {{ js_include('https://ssl.captcha.qq.com/TCaptcha.js',false) }} + {{ js_include('home/js/captcha.verify.js') }} + +{% endblock %} \ No newline at end of file diff --git a/app/Http/Home/Views/user/console/account.volt b/app/Http/Home/Views/user/console/account_info.volt similarity index 72% rename from app/Http/Home/Views/user/console/account.volt rename to app/Http/Home/Views/user/console/account_info.volt index 882c5547..958e8a33 100644 --- a/app/Http/Home/Views/user/console/account.volt +++ b/app/Http/Home/Views/user/console/account_info.volt @@ -2,9 +2,9 @@ {% block content %} - {% set edit_pwd_url = url({'for':'home.account.edit_pwd'}) %} - {% set edit_phone_url = url({'for':'home.account.edit_phone'}) %} - {% set edit_email_url = url({'for':'home.account.edit_email'}) %} + {% set edit_pwd_url = url({'for':'home.uc.account'},{'type':'password'}) %} + {% set edit_phone_url = url({'for':'home.uc.account'},{'type':'phone'}) %} + {% set edit_email_url = url({'for':'home.uc.account'},{'type':'email'}) %}
{{ partial('user/console/menu') }}
@@ -18,17 +18,17 @@ 登录密码 经常更改密码有助于保护您的帐号安全 - 修改 + 修改
手机绑定 {% if account.phone %} 已绑定手机:{{ account.phone|anonymous }} - 修改 + 修改 {% else %} 可用于登录和重置密码 - 绑定 + 绑定 {% endif %}
@@ -36,10 +36,10 @@ 邮箱绑定 {% if account.phone %} 已绑定邮箱:{{ account.email|anonymous }} - 修改 + 修改 {% else %} 可用于登录和重置密码 - 绑定 + 绑定 {% endif %}
@@ -47,10 +47,4 @@
-{% endblock %} - -{% block include_js %} - - {{ js_include('home/js/user.console.account.js') }} - {% endblock %} \ No newline at end of file diff --git a/app/Http/Home/Views/user/console/account_password.volt b/app/Http/Home/Views/user/console/account_password.volt new file mode 100644 index 00000000..ee187402 --- /dev/null +++ b/app/Http/Home/Views/user/console/account_password.volt @@ -0,0 +1,44 @@ +{% extends 'templates/main.volt' %} + +{% block content %} + +
+
{{ partial('user/console/menu') }}
+
+
+
+ 账号安全 - 修改密码 +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+
+
+
+ +{% endblock %} + diff --git a/app/Http/Home/Views/user/console/account_phone.volt b/app/Http/Home/Views/user/console/account_phone.volt new file mode 100644 index 00000000..93459066 --- /dev/null +++ b/app/Http/Home/Views/user/console/account_phone.volt @@ -0,0 +1,54 @@ +{% extends 'templates/main.volt' %} + +{% block content %} + +
+
{{ partial('user/console/menu') }}
+
+
+
+ 账号安全 - 修改手机 +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + + + +
+
+
+
+
+
+ +{% endblock %} + +{% block include_js %} + + {{ js_include('https://ssl.captcha.qq.com/TCaptcha.js',false) }} + {{ js_include('home/js/captcha.verify.js') }} + +{% endblock %} \ No newline at end of file diff --git a/app/Library/Validators/Common.php b/app/Library/Validators/Common.php index 3e69d0b8..66fac0a5 100644 --- a/app/Library/Validators/Common.php +++ b/app/Library/Validators/Common.php @@ -90,7 +90,7 @@ class Common public static function password($str) { - $pattern = '/^[A-Za-z0-9]{6,16}$/'; + $pattern = '/^[[:graph:]]{6,16}$/'; return preg_match($pattern, $str) ? true : false; } diff --git a/public/static/admin/js/xm-course.js b/public/static/admin/js/xm-course.js index 3ddc43cb..5e360cce 100644 --- a/public/static/admin/js/xm-course.js +++ b/public/static/admin/js/xm-course.js @@ -43,24 +43,24 @@ function xmCourse(data, url) { {field: 'title', title: '标题', width: 390}, { field: 'model', title: '类型', width: 50, templet: function (d) { - if (d.model === 'vod') { + if (d.model === 1) { return '点播'; - } else if (d.model === 'live') { + } else if (d.model === 2) { return '直播'; - } else if (d.model === 'read') { + } else if (d.model === 3) { return '图文'; } } }, { field: 'level', title: '难度', width: 50, templet: function (d) { - if (d.level === 'entry') { + if (d.level === 1) { return '入门'; - } else if (d.level === 'junior') { + } else if (d.level === 2) { return '初级'; - } else if (d.level === 'medium') { + } else if (d.level === 3) { return '中级'; - } else if (d.level === 'senior') { + } else if (d.level === 4) { return '高级'; } } diff --git a/public/static/home/css/common.css b/public/static/home/css/common.css index 45961c94..c22f01a2 100644 --- a/public/static/home/css/common.css +++ b/public/static/home/css/common.css @@ -1161,18 +1161,18 @@ } .account-form .verify-input-inline { - display: inline-block; - width: 283px; - margin-right: 5px; + width: 280px; + margin-right: 10px; } .account-form .verify-btn-inline { - display: inline-block; - vertical-align: top; + width: 110px; + margin-right: 0; } .verify-btn-inline button { - min-width: 108px; + min-width: 100px; + width: 100%; } .login-tab { @@ -1523,6 +1523,19 @@ word-wrap: break-word; } +.security-form { + width: 600px; +} + +.security-form .verify-input-inline { + width: 360px; +} + +.security-form .verify-btn-inline { + width: 120px; + margin-right: 0; +} + .security-item { padding: 15px; line-height: 50px; diff --git a/public/static/home/js/captcha.login.js b/public/static/home/js/captcha.login.js index d6464d19..05a10ee3 100644 --- a/public/static/home/js/captcha.login.js +++ b/public/static/home/js/captcha.login.js @@ -1,5 +1,7 @@ layui.use(['jquery'], function () { + var $ = layui.jquery; + var captcha = new TencentCaptcha( $('#captcha-btn')[0], $('#captcha-btn').data('app-id'), @@ -12,4 +14,5 @@ layui.use(['jquery'], function () { } } ); + }); \ No newline at end of file