WIN-2308041133\Administrator 1 年之前
父節點
當前提交
7abdb9b4db
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      application/api/controller/Lave.php

+ 3 - 4
application/api/controller/Lave.php

@@ -170,11 +170,10 @@ class Lave extends Api
                 ['from', 'weixin'],
             ], $request
         );
-        try {
-            $where['user_id']=$this->auth->getUserinfo()['id'];
-        } catch (\Exception $e) {
-            $this->error('请登录后操作');
+        if (!$this->auth->isLogin()) {
+            $this->error(__('Please login first'), null, 401);
         }
+        $where['user_id']=$this->auth->getUserinfo()['id'];
         $where1 = $where;
         unset($where1['from']);
         $where1['order_id'] = LaveMonthModel::getNewOrderId();