Explorar o código

share and dist

zz %!s(int64=5) %!d(string=hai) anos
pai
achega
eae687b8ad

+ 2 - 2
app/Http/Controllers/Wap/Other/WeixinController.php

@@ -15,8 +15,8 @@ class WeixinController extends Controller
         //$base_url =   env('PROTOCOL').'://site'.$channel_id.'.'.$doamin.'.com/';
         $url = $request->post('url');
         if($url) $url = urldecode($url);
-        $appid = 'wx126331d1732978b0';
-        $appSecret = '76231c41c24d4363243866f5f9dee55f';
+        $appid = 'wx32473d47826d656f';
+        $appSecret = '2aa0e49566adf24e6415e8c0d1698a89';
         $config = new ChapterShareWechatConfigService($appid,$appSecret);
         //$config->setAccessToken('');
         $config->requestAccessToken();

+ 22 - 10
app/Http/Controllers/Wap/Web/RedirectController.php

@@ -4,6 +4,9 @@ namespace App\Http\Controllers\Wap\Web;
 
 use App\Modules\Book\Services\BookConfigService;
 use App\Modules\Book\Services\ChapterService;
+use App\Modules\OfficialAccount\Models\CustomSendMsgs;
+use App\Modules\OfficialAccount\Models\WechatTemplateMsgs;
+use App\Modules\OfficialAccount\Models\WechatTemplates;
 use App\Modules\Subscribe\Services\OrderService;
 use App\Modules\User\Services\ReadRecordService;
 use Illuminate\Routing\Controller;
@@ -315,12 +318,6 @@ class RedirectController extends BaseController
         }
         parse_str($info['query'],$output);
         if(!isset($output['bid']) || !isset($output['cid'])) return redirect()->to('/');
-        $bid = explode(',',$output['bid'])[0];
-        $book_info = BookConfigService::getBookById($bid);
-        $chapter_content = ChapterService::getChapter($book_info->bid, $output['cid']);
-        $data['chapter_list'] = explode("\r\n",$chapter_content->content);
-        $data['name'] = $book_info->book_name;
-        $data['next_url'] = '/reader?bid='.$output['bid'].'&cid='.$chapter_content->next_cid.'&fromtype='.$from_type;
         if($from_type){
             //['custom','template']
             $push_info = explode('_',$from_type);
@@ -329,26 +326,41 @@ class RedirectController extends BaseController
                 $push_id = $push_info[1];
             }
             if(str_contains($from_type,['custom']) && $push_id){
+                $info = CustomSendMsgs::customSendMsgsById($push_id);
+                if(!$info || $info->distribution_channel_id != $this->distribution_channel_id){
+                    return redirect()->to('/');
+                }
                 $push_transfer_custom_flag = Cookie::get('push_transfer_custom_flag');
                 if(!$push_transfer_custom_flag || !in_array($push_id,explode(',',$push_transfer_custom_flag))){
                     Redis::hincrby('push_transfer_page_custom_uv' , $push_id,  1);
-                    if($push_transfer_custom_flag) $push_transfer_custom_flag = $push_transfer_custom_flag.','.$push_id;
-                    else $push_transfer_custom_flag = $push_id;
+                    if($push_transfer_custom_flag) {$push_transfer_custom_flag = $push_transfer_custom_flag.','.$push_id;}
+                    else {$push_transfer_custom_flag = $push_id;}
                     Cookie::queue('push_transfer_custom_flag',$push_transfer_custom_flag, env('U_COOKIE_EXPIRE'), null, null, false, false);
                 }
                 Redis::hincrby('push_transfer_page_custom_pv' , $push_id,  1);
             }
             if(str_contains($from_type,['template']) && $push_id){
+                $info = WechatTemplateMsgs::wechatTemplateMsgsById($push_id);
+                if(!$info || $info->distribution_channel_id != $this->distribution_channel_id){
+                    return redirect()->to('/');
+                }
                 $push_transfer_template_flag = Cookie::get('push_transfer_template_flag');
                 if(!$push_transfer_template_flag || !in_array($push_id,explode(',',$push_transfer_template_flag))){
                     Redis::hincrby('push_transfer_page_template_uv' , $push_id,  1);
-                    if($push_transfer_template_flag) $push_transfer_template_flag = $push_transfer_template_flag.','.$push_id;
-                    else $push_transfer_template_flag = $push_id;
+                    if($push_transfer_template_flag) {$push_transfer_template_flag = $push_transfer_template_flag.','.$push_id;}
+                    else {$push_transfer_template_flag = $push_id;}
                     Cookie::queue('push_transfer_template_flag',$push_transfer_template_flag, env('U_COOKIE_EXPIRE'), null, null, false, false);
                 }
                 Redis::hincrby('push_transfer_page_template' , $push_id, 1);
             }
         }
+        $bid = Hashids::decode($output['bid'])[0];
+        $book_info = BookConfigService::getBookById($bid);
+        $chapter_content = ChapterService::getChapter($bid, $output['cid']);
+
+        $data['chapter_list'] = explode("\r\n",$chapter_content->content);
+        $data['name'] = $book_info->book_name;
+        $data['next_url'] = '/reader?bid='.$output['bid'].'&cid='.$chapter_content->next_cid.'&fromtype='.$from_type;
         return view('wap.customPushtransfer',$data);
     }
 }

+ 5 - 0
resources/views/wap/customPushtransfer.blade.php

@@ -30,6 +30,7 @@
         p {
             margin: 0;
             padding: 0;
+            user-select: none;
         }
 
         html {
@@ -59,6 +60,10 @@
             line-height: 40px;
             margin-bottom: 20px;
         }
+        .next-chapter__btn a{
+            text-decoration: none;
+            color: #1a1a1a;
+        }
     </style>
     <title>{{$name}}</title>
 </head>

+ 4 - 4
resources/views/wap/index.blade.php

@@ -9,7 +9,7 @@
     <script>window.VueRouter || document.write('<script src="https://cdn-novel.iycdm.com/static/vue-router.min.js"><\/script>')</script>
     <script>(window.Vue && window.VueLazyload) || document.write('<script src="https://cdn-novel.iycdm.com/static/vue-lazyload.js"><\/script>')</script>
     <title>{{$title}}</title>
-    <link href=https://cdn-novel.iycdm.com/static2019-9-2/css/app.b17904f8edd65bf28937d1f06ea6e51c.css rel=stylesheet>
+    <link href=https://cdn-novel.iycdm.com/static2019-9-4/css/app.79f01dea37831efca4a2b7e7870a3685.css rel=stylesheet>
 </head>
 <body>
 <div id=app></div>
@@ -32,8 +32,8 @@
     })();</script>
 <script id=options>window.options = {!! $options!!};</script>
 <script type=text/javascript
-        src=https://cdn-novel.iycdm.com/static2019-9-2/js/manifest.5e58aea12b580c35972a.js></script>
-<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-9-2/js/vendor.67516a6a43f9adc48771.js></script>
-<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-9-2/js/app.4b617f5372aa625c782f.js></script>
+        src=https://cdn-novel.iycdm.com/static2019-9-4/js/manifest.c9117a4e709eda6a0b96.js></script>
+<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-9-4/js/vendor.67516a6a43f9adc48771.js></script>
+<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-9-4/js/app.4e2077d9e4204a3c89b1.js></script>
 </body>
 </html>