geek преди 4 години
родител
ревизия
c52df44c51

+ 1 - 1
application/api/BaseController.php

@@ -1,7 +1,7 @@
 <?php
 declare (strict_types = 1);
 
-namespace app\api;
+namespace app\index;
 
 use app\api\exception\ApiException;
 use app\common\until\Token;

+ 4 - 17
application/api/controller/User.php

@@ -1,30 +1,17 @@
 <?php
 /**
  * Author: luzheng.liu
- * Time: 2020/12/5 17:15
+ * Time: 2020/12/5 17:55
  */
 
-namespace app\api\controller;
+namespace app\index\controller;
 
 
-use app\api\BaseController;
 use app\common\service\CommonService;
 
-class User extends BaseController {
+class Index {
 
-    public function login() {
-        $params = [
-            'id'     => CommonService::getChannelId(),
-            'userid' => input('unionid'),
-            'name'   => input('nickName'),
-            'avatar' => input('avatar'),
-            'key'    => md5(input('userid').CommonService::getAuthKey())
-        ];
-        session('unionid', input('unionid'));
-        header('Location:http://mudu.tv/activity.php?a=userAssign&'.http_build_query($params));
-    }
-
-    public function checkLogin() {
+    public function index() {
         $visitorId = input('visitorId');
         $notifyUrl = input('notify_url');
         if (empty(session('unionid'))){

+ 26 - 0
application/index/controller/User.php

@@ -0,0 +1,26 @@
+<?php
+/**
+ * Author: luzheng.liu
+ * Time: 2020/12/5 17:15
+ */
+
+namespace app\index\controller;
+
+
+use app\common\service\CommonService;
+use app\index\BaseController;
+
+class User extends BaseController {
+
+    public function login() {
+        $params = [
+            'id'     => CommonService::getChannelId(),
+            'userid' => input('unionid'),
+            'name'   => input('nickName'),
+            'avatar' => input('avatar'),
+            'key'    => md5(input('userid').CommonService::getAuthKey())
+        ];
+        session('unionid', input('unionid'));
+        header('Location:http://mudu.tv/activity.php?a=userAssign&'.http_build_query($params));
+    }
+}

+ 1 - 1
application/api/exception/ApiException.php

@@ -4,7 +4,7 @@
  * Time: 2020/8/26 16:18
  */
 
-namespace app\api\exception;
+namespace app\index\exception;
 
 
 class ApiException extends \RuntimeException {

+ 1 - 1
application/api/exception/ExceptionHandel.php

@@ -4,7 +4,7 @@
  * Time: 2020/12/5 17:22
  */
 
-namespace app\api\exception;
+namespace app\index\exception;
 
 
 use app\common\until\Enum;

+ 1 - 1
application/api/exception/TokenException.php

@@ -4,7 +4,7 @@
  * Time: 2020/8/26 20:53
  */
 
-namespace app\api\exception;
+namespace app\index\exception;
 
 
 class TokenException extends \RuntimeException {