Yahoo пре 4 година
родитељ
комит
f1ca338ff4

+ 6 - 6
app/admin/service/admin/User.php

@@ -31,7 +31,7 @@ class User extends BaseService
     public static function getLoginInfo()
     {
         if (($token = self::getToken()) !== false) {
-            return Cache::instance()->get($token);
+            return Cache::get($token);
         }
         return false;
     }
@@ -44,11 +44,11 @@ class User extends BaseService
     public static function login(array $userInfo)
     {
         // 生成token
-        $token = self::makeToken((int)$userInfo['admin_user_id']);
+        $token = self::makeToken((int)$userInfo['admin_user_id']);
         // 记录缓存, 7天
-        Cache::instance()->set($token, [
+        Cache::set($token, [
             'user' => [
-                'admin_user_id' => (int)$userInfo['admin_user_id'],
+                'admin_user_id' => (int)$userInfo['admin_user_id'],
                 'user_name' => $userInfo['user_name'],
             ],
             'is_login' => true,
@@ -62,7 +62,7 @@ class User extends BaseService
      */
     public static function logout()
     {
-        Cache::instance()->delete(self::getToken());
+        Cache::delete(self::getToken());
         return true;
     }
 
@@ -73,7 +73,7 @@ class User extends BaseService
      */
     public static function update(array $userInfo)
     {
-        return Cache::instance()->set(self::getToken(), [
+        return Cache::set(self::getToken(), [
             'user' => [
                 'admin_user_id' => $userInfo['admin_user_id'],
                 'user_name' => $userInfo['user_name'],

+ 0 - 47
app/api/controller/Wxapp.php

@@ -1,47 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
-// +----------------------------------------------------------------------
-// | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
-// +----------------------------------------------------------------------
-// | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
-// +----------------------------------------------------------------------
-// | Author: 萤火科技 <admin@yiovo.com>
-// +----------------------------------------------------------------------
-declare (strict_types = 1);
-
-namespace app\api\controller;
-
-use app\api\model\Help;
-
-/**
- * 微信小程序
- * Class Wxapp
- * @package app\api\controller
- */
-class Wxapp extends Controller
-{
-    /**
-     * 小程序基础信息
-     * @return array
-     */
-    public function base()
-    {
-        return $this->renderSuccess([]);
-    }
-
-    /**
-     * 帮助中心
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     */
-    public function help()
-    {
-        $model = new Help;
-        $list = $model->getList();
-        return $this->renderSuccess(compact('list'));
-    }
-
-}

+ 2 - 2
app/common/library/express/Kuaidi100.php

@@ -48,7 +48,7 @@ class Kuaidi100
     {
         // 缓存索引
         $cacheIndex = "express_{$code}_$expressNo";
-        if ($data = Cache::instance()->get($cacheIndex)) {
+        if ($data = Cache::get($cacheIndex)) {
             return $data;
         }
         // 参数设置
@@ -71,7 +71,7 @@ class Kuaidi100
             return false;
         }
         // 记录缓存, 时效5分钟
-        Cache::instance()->set($cacheIndex, $express['data'], 300);
+        Cache::set($cacheIndex, $express['data'], 300);
         return $express['data'];
     }
 

+ 3 - 3
app/common/library/wechat/WxBase.php

@@ -53,7 +53,7 @@ class WxBase
     protected function getAccessToken()
     {
         $cacheKey = $this->appId . '@access_token';
-        if (!Cache::instance()->get($cacheKey)) {
+        if (!Cache::get($cacheKey)) {
             // 请求API获取 access_token
             $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$this->appId}&secret={$this->appSecret}";
             $result = $this->get($url);
@@ -69,9 +69,9 @@ class WxBase
                 'result' => $result
             ]);
             // 写入缓存
-            Cache::instance()->set($cacheKey, $response['access_token'], 6000);
+            Cache::set($cacheKey, $response['access_token'], 6000);
         }
-        return Cache::instance()->get($cacheKey);
+        return Cache::get($cacheKey);
     }
 
     /**