Sfoglia il codice sorgente

Weenier 168otc项目部署 0630

wesmiler 3 anni fa
parent
commit
4947a50546
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8 0
      app/Http/Controllers/Api/IndexController.php

+ 8 - 0
app/Http/Controllers/Api/IndexController.php

@@ -27,6 +27,14 @@ class IndexController extends webApp
      */
      */
     public function index(int $userId=0)
     public function index(int $userId=0)
     {
     {
+        // 语言默认同步更新
+        $locale = request()->get('locale');
+        if($locale){
+            RedisService::set("stores:locale:lang_{$this->userId}", $locale, 24 * 3600);
+            session('lang_locale', $locale);
+        }
+
+
         // 广告幻灯片
         // 广告幻灯片
         $banners = [
         $banners = [
             'top'=> AdService::make()->getList(1, 6),
             'top'=> AdService::make()->getList(1, 6),