diff --git a/app/admin/controller/Plugins.php b/app/admin/controller/Plugins.php index 82e467813bd7049dbecff79bea9cbe2de7220fc8..422061774eecfbfa36524a49590ed70c51c79f77 100755 --- a/app/admin/controller/Plugins.php +++ b/app/admin/controller/Plugins.php @@ -10,6 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; +use app\service\SystemService; use app\service\ApiService; use app\service\PluginsService; use app\service\ResourcesService; @@ -85,7 +86,7 @@ class Plugins extends Common } // 插件权限校验 - $power_plugins = MyCache(MyConfig('shopxo.cache_admin_power_plugins_key').$this->admin['id']); + $power_plugins = MyCache(SystemService::CacheKey('shopxo.cache_admin_power_plugins_key').$this->admin['id']); if(empty($power_plugins) || !array_key_exists($params['data_request']['pluginsname'], $power_plugins)) { $msg = '无权限使用该插件'; diff --git a/app/admin/controller/Site.php b/app/admin/controller/Site.php index ef19011f62744835bc476e0cfea3953e95408d97..1589cc93eab2e297fe813999997aa430144dd012 100755 --- a/app/admin/controller/Site.php +++ b/app/admin/controller/Site.php @@ -10,6 +10,7 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; +use app\service\SystemService; use app\service\ConfigService; use app\service\GoodsService; use app\service\SiteService; @@ -382,11 +383,11 @@ class Site extends Common { // 登录 case 'login' : - MyCache(MyConfig('shopxo.cache_user_login_left_key'), null); + MyCache(SystemService::CacheKey('shopxo.cache_user_login_left_key'), null); // 密码找回 case 'forgetpwd' : - MyCache(MyConfig('shopxo.cache_user_forgetpwd_left_key'), null); + MyCache(SystemService::CacheKey('shopxo.cache_user_forgetpwd_left_key'), null); break; } } diff --git a/app/index/controller/User.php b/app/index/controller/User.php index 64b97df41ee49f28e24de471d62c96e58777dd89..e711e29700eb3c4ede425235d9e617b73acd1bb8 100755 --- a/app/index/controller/User.php +++ b/app/index/controller/User.php @@ -10,6 +10,7 @@ // +---------------------------------------------------------------------- namespace app\index\controller; +use app\service\SystemService; use app\service\OrderService; use app\service\GoodsService; use app\service\UserService; @@ -221,7 +222,7 @@ class User extends Common MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('密码找回', 1)); // 左侧图片,随机其中一个 - $left_data = UserService::UserEntranceLeftData(['left_key'=>'forgetpwd', 'cache_key'=>MyConfig('shopxo.cache_user_forgetpwd_left_key')]); + $left_data = UserService::UserEntranceLeftData(['left_key'=>'forgetpwd', 'cache_key'=>SystemService::CacheKey('shopxo.cache_user_forgetpwd_left_key')]); MyViewAssign('user_forgetpwd_left_data', empty($left_data['data']) ? [] : $left_data['data'][array_rand($left_data['data'], 1)]); return MyView(); @@ -287,7 +288,7 @@ class User extends Common MyViewAssign('referer_url', $this->GetrefererUrl()); // 左侧图片,随机其中一个 - $left_data = UserService::UserEntranceLeftData(['left_key'=>'login', 'cache_key'=>MyConfig('shopxo.cache_user_login_left_key')]); + $left_data = UserService::UserEntranceLeftData(['left_key'=>'login', 'cache_key'=>SystemService::CacheKey('shopxo.cache_user_login_left_key')]); MyViewAssign('user_login_left_data', empty($left_data['data']) ? [] : $left_data['data'][array_rand($left_data['data'], 1)]); return MyView(); diff --git a/app/service/AdminPowerService.php b/app/service/AdminPowerService.php index 9b9dde23c3805d14e26f918d8719bd7b20218a37..a9dfa0d15935c81f19e73dbed61ffb6eca79cd18 100755 --- a/app/service/AdminPowerService.php +++ b/app/service/AdminPowerService.php @@ -11,6 +11,7 @@ namespace app\service; use think\facade\Db; +use app\service\SystemService; use app\service\AdminService; use app\service\AdminRoleService; @@ -189,9 +190,9 @@ class AdminPowerService { foreach($admin as $id) { - MyCache(MyConfig('shopxo.cache_admin_left_menu_key').$id, null); - MyCache(MyConfig('shopxo.cache_admin_power_key').$id, null); - MyCache(MyConfig('shopxo.cache_admin_power_plugins_key').$id, null); + MyCache(SystemService::CacheKey('shopxo.cache_admin_left_menu_key').$id, null); + MyCache(SystemService::CacheKey('shopxo.cache_admin_power_key').$id, null); + MyCache(SystemService::CacheKey('shopxo.cache_admin_power_plugins_key').$id, null); } } } @@ -213,9 +214,9 @@ class AdminPowerService $role_id = isset($admin['role_id']) ? intval($admin['role_id']) : 0; // 读取缓存数据 - $admin_left_menu = MyCache(MyConfig('shopxo.cache_admin_left_menu_key').$admin_id); - $admin_power = MyCache(MyConfig('shopxo.cache_admin_power_key').$admin_id); - $admin_plugins = MyCache(MyConfig('shopxo.cache_admin_power_plugins_key').$admin_id); + $admin_left_menu = MyCache(SystemService::CacheKey('shopxo.cache_admin_left_menu_key').$admin_id); + $admin_power = MyCache(SystemService::CacheKey('shopxo.cache_admin_power_key').$admin_id); + $admin_plugins = MyCache(SystemService::CacheKey('shopxo.cache_admin_power_plugins_key').$admin_id); // 缓存没数据则从数据库重新读取 if((($role_id > 0 || $admin_id == 1) && empty($admin_left_menu)) || $is_refresh || MyEnv('app_debug')) @@ -309,9 +310,9 @@ class AdminPowerService $admin_plugins = Db::name('RolePlugins')->where(['role_id'=>$role_id])->column('name', 'plugins'); } } - MyCache(MyConfig('shopxo.cache_admin_left_menu_key').$admin_id, $admin_left_menu); - MyCache(MyConfig('shopxo.cache_admin_power_key').$admin_id, $admin_power); - MyCache(MyConfig('shopxo.cache_admin_power_plugins_key').$admin_id, $admin_plugins); + MyCache(SystemService::CacheKey('shopxo.cache_admin_left_menu_key').$admin_id, $admin_left_menu); + MyCache(SystemService::CacheKey('shopxo.cache_admin_power_key').$admin_id, $admin_power); + MyCache(SystemService::CacheKey('shopxo.cache_admin_power_plugins_key').$admin_id, $admin_plugins); } return true; } @@ -329,7 +330,7 @@ class AdminPowerService $admin = AdminService::LoginInfo(); if(!empty($admin['id'])) { - $data = MyCache(MyConfig('shopxo.cache_admin_left_menu_key').$admin['id']); + $data = MyCache(SystemService::CacheKey('shopxo.cache_admin_left_menu_key').$admin['id']); } // 后台左侧菜单钩子 @@ -357,7 +358,7 @@ class AdminPowerService $admin = AdminService::LoginInfo(); if(!empty($admin['id'])) { - $data = MyCache(MyConfig('shopxo.cache_admin_power_key').$admin['id']); + $data = MyCache(SystemService::CacheKey('shopxo.cache_admin_power_key').$admin['id']); } // 后台左侧菜单权限钩子 diff --git a/app/service/AdminService.php b/app/service/AdminService.php index bba445271b3e0d6763d61c4ee6ed55952f485412..ca8c727d308872062c032207f4cf0911ef338c72 100755 --- a/app/service/AdminService.php +++ b/app/service/AdminService.php @@ -11,6 +11,7 @@ namespace app\service; use think\facade\Db; +use app\service\SystemService; use app\service\AdminPowerService; /** @@ -506,9 +507,9 @@ class AdminService if(Db::name('Admin')->where(['id'=>$admin['id']])->update($data)) { // 清空权限缓存数据 - MyCache(MyConfig('shopxo.cache_admin_left_menu_key').$admin['id'], null); - MyCache(MyConfig('shopxo.cache_admin_power_key').$admin['id'], null); - MyCache(MyConfig('shopxo.cache_admin_power_plugins_key').$admin['id'], null); + MyCache(SystemService::CacheKey('shopxo.cache_admin_left_menu_key').$admin['id'], null); + MyCache(SystemService::CacheKey('shopxo.cache_admin_power_key').$admin['id'], null); + MyCache(SystemService::CacheKey('shopxo.cache_admin_power_plugins_key').$admin['id'], null); // 权限菜单初始化 AdminPowerService::PowerMenuInit(); diff --git a/app/service/AppCenterNavService.php b/app/service/AppCenterNavService.php index b2a845d421e23f1f372525eebcad2d529036683b..bf4814a95571adb3920e10ba7862b8eb4c26fcdd 100755 --- a/app/service/AppCenterNavService.php +++ b/app/service/AppCenterNavService.php @@ -11,6 +11,7 @@ namespace app\service; use think\facade\Db; +use app\service\SystemService; use app\service\ResourcesService; /** @@ -274,7 +275,7 @@ class AppCenterNavService public static function AppCenterNav($params = []) { // 缓存 - $key = MyConfig('shopxo.cache_app_user_center_navigation_key').APPLICATION_CLIENT_TYPE; + $key = SystemService::CacheKey('shopxo.cache_app_user_center_navigation_key').APPLICATION_CLIENT_TYPE; $data = MyCache($key); if(empty($data)) diff --git a/app/service/AppHomeNavService.php b/app/service/AppHomeNavService.php index 1944b9d34a34db046b193a19659c464990da6771..bbd8d7f15d34fe6862c5055cedd67b773265009f 100755 --- a/app/service/AppHomeNavService.php +++ b/app/service/AppHomeNavService.php @@ -11,6 +11,7 @@ namespace app\service; use think\facade\Db; +use app\service\SystemService; use app\service\ResourcesService; /** @@ -269,7 +270,7 @@ class AppHomeNavService public static function AppHomeNav($params = []) { // 缓存 - $key = MyConfig('shopxo.cache_app_home_navigation_key').APPLICATION_CLIENT_TYPE; + $key = SystemService::CacheKey('shopxo.cache_app_home_navigation_key').APPLICATION_CLIENT_TYPE; $data = MyCache($key); if($data === null || MyEnv('app_debug')) { diff --git a/app/service/ArticleService.php b/app/service/ArticleService.php index a6f8d7c97e2ce652e8a4474dfd501aa4934f4d63..39e30091f57f28133dd888a71052ecf87b61b3f3 100755 --- a/app/service/ArticleService.php +++ b/app/service/ArticleService.php @@ -11,6 +11,7 @@ namespace app\service; use think\facade\Db; +use app\service\SystemService; use app\service\ResourcesService; /** @@ -34,7 +35,7 @@ class ArticleService public static function HomeArticleList($params = []) { // 从缓存获取 - $key = MyConfig('shopxo.cache_home_article_list_key'); + $key = SystemService::CacheKey('shopxo.cache_home_article_list_key'); $data = MyCache($key); if($data === null || MyEnv('app_debug')) { diff --git a/app/service/BannerService.php b/app/service/BannerService.php index ea1d149ead2aad73855ad0ce4e6ba72406cb92b7..09f9bb2d8a25e8417cd4214bc61f1f0f74c602ed 100755 --- a/app/service/BannerService.php +++ b/app/service/BannerService.php @@ -11,6 +11,7 @@ namespace app\service; use think\facade\Db; +use app\service\SystemService; use app\service\ResourcesService; /** @@ -34,7 +35,7 @@ class BannerService public static function Banner($params = []) { // 缓存 - $key = MyConfig('shopxo.cache_banner_list_key').APPLICATION_CLIENT_TYPE; + $key = SystemService::CacheKey('shopxo.cache_banner_list_key').APPLICATION_CLIENT_TYPE; $data = MyCache($key); if($data === null || MyEnv('app_debug')) { diff --git a/app/service/ConfigService.php b/app/service/ConfigService.php index 686b719b50c9ac0a2b84bcb0d0633f2968d7d601..add9c69c4fb2af57d6d9d4fd9795c1c31ab1f2aa 100755 --- a/app/service/ConfigService.php +++ b/app/service/ConfigService.php @@ -11,6 +11,7 @@ namespace app\service; use think\facade\Db; +use app\service\SystemService; use app\service\ResourcesService; /** @@ -204,7 +205,7 @@ class ConfigService if($success > 0) { // 删除所有配置的缓存数据 - MyCache(MyConfig('shopxo.cache_common_my_config_key'), null); + MyCache(SystemService::CacheKey('shopxo.cache_common_my_config_key'), null); // 所有配置信息更新 self::ConfigInit(1); @@ -257,7 +258,7 @@ class ConfigService */ public static function ConfigInit($status = 0) { - $key = MyConfig('shopxo.cache_common_my_config_key'); + $key = SystemService::CacheKey('shopxo.cache_common_my_config_key'); $data = MyCache($key); if($data === null || $status == 1) { diff --git a/app/service/GoodsService.php b/app/service/GoodsService.php index 71a8744e6ec1bf71ab1c956cf0f15ffe610ee7e5..25e341b1e3681753e925c9177cd12d9b2da55f8e 100755 --- a/app/service/GoodsService.php +++ b/app/service/GoodsService.php @@ -11,6 +11,7 @@ namespace app\service; use think\facade\Db; +use app\service\SystemService; use app\service\SystemBaseService; use app\service\ResourcesService; use app\service\BrandService; @@ -63,7 +64,7 @@ class GoodsService public static function GoodsCategoryAll($params = []) { // 从缓存获取 - $key = MyConfig('shopxo.cache_goods_category_key'); + $key = SystemService::CacheKey('shopxo.cache_goods_category_key'); $data = MyCache($key); if($data === null || MyEnv('app_debug')) { @@ -219,7 +220,7 @@ class GoodsService public static function HomeFloorList($params = []) { // 缓存 - $key = MyConfig('shopxo.cache_goods_floor_list_key'); + $key = SystemService::CacheKey('shopxo.cache_goods_floor_list_key'); $data = MyCache($key); if($data === null || MyEnv('app_debug')) { @@ -2639,7 +2640,7 @@ class GoodsService } // 删除大分类缓存 - MyCache(MyConfig('shopxo.cache_goods_category_key'), null); + MyCache(SystemService::CacheKey('shopxo.cache_goods_category_key'), null); $res = self::GoodsCategoryDataHandle([$data]); return DataReturn('操作成功', 0, json_encode($res[0])); @@ -2681,7 +2682,7 @@ class GoodsService if(Db::name('GoodsCategory')->where(['id'=>$ids])->delete()) { // 删除大分类缓存 - MyCache(MyConfig('shopxo.cache_goods_category_key'), null); + MyCache(SystemService::CacheKey('shopxo.cache_goods_category_key'), null); return DataReturn('删除成功', 0); } diff --git a/app/service/LinkService.php b/app/service/LinkService.php index 037569b063cccf7f1eede7f56c8268f4913dd65e..108edc9bafe578d7a21d9f7bf3d5c6fc651b5b2f 100755 --- a/app/service/LinkService.php +++ b/app/service/LinkService.php @@ -11,6 +11,7 @@ namespace app\service; use think\facade\Db; +use app\service\SystemService; use app\service\GoodsService; /** @@ -34,7 +35,7 @@ class LinkService public static function HomeLinkList($params = []) { // 从缓存获取 - $key = MyConfig('shopxo.cache_home_link_list_key'); + $key = SystemService::CacheKey('shopxo.cache_home_link_list_key'); $data = MyCache($key); if($data == null || MyEnv('app_debug')) { diff --git a/app/service/NavigationService.php b/app/service/NavigationService.php index b5d83a07b9844769433385e3ea799be33a7770bc..3c9507c9cbdacaad9ca2143d09728574a8dfe391 100755 --- a/app/service/NavigationService.php +++ b/app/service/NavigationService.php @@ -11,6 +11,7 @@ namespace app\service; use think\facade\Db; +use app\service\SystemService; use app\service\BuyService; use app\service\MessageService; use app\service\OrderService; @@ -40,8 +41,8 @@ class NavigationService public static function Nav($params = []) { // 读取缓存数据 - $header = MyCache(MyConfig('shopxo.cache_common_home_nav_header_key')); - $footer = MyCache(MyConfig('shopxo.cache_common_home_nav_footer_key')); + $header = MyCache(SystemService::CacheKey('shopxo.cache_common_home_nav_header_key')); + $footer = MyCache(SystemService::CacheKey('shopxo.cache_common_home_nav_footer_key')); // 缓存没数据则从数据库重新读取,顶部菜单 if($header === null || MyEnv('app_debug')) @@ -157,7 +158,7 @@ class NavigationService } // 缓存 - MyCache(MyConfig('shopxo.cache_common_home_nav_'.$nav_type.'_key'), $data, 180); + MyCache(SystemService::CacheKey('shopxo.cache_common_home_nav_'.$nav_type.'_key'), $data, 180); return $data; } @@ -470,7 +471,7 @@ class NavigationService public static function NacDataSave($params = []) { // 缓存 key - $cache_key = MyConfig('shopxo.cache_common_home_nav_'.$params['nav_type'].'_key'); + $cache_key = SystemService::CacheKey('shopxo.cache_common_home_nav_'.$params['nav_type'].'_key'); // 非自定义导航数据处理 if(empty($params['name'])) @@ -573,8 +574,8 @@ class NavigationService Db::commit(); // 清除缓存 - MyCache(MyConfig('shopxo.cache_common_home_nav_header_key'), null); - MyCache(MyConfig('shopxo.cache_common_home_nav_footer_key'), null); + MyCache(SystemService::CacheKey('shopxo.cache_common_home_nav_header_key'), null); + MyCache(SystemService::CacheKey('shopxo.cache_common_home_nav_footer_key'), null); return DataReturn('删除成功'); } @@ -623,8 +624,8 @@ class NavigationService if(Db::name('Navigation')->where(['id'=>intval($params['id'])])->update([$params['field']=>intval($params['state']), 'upd_time'=>time()])) { // 清除缓存 - MyCache(MyConfig('shopxo.cache_common_home_nav_header_key'), null); - MyCache(MyConfig('shopxo.cache_common_home_nav_footer_key'), null); + MyCache(SystemService::CacheKey('shopxo.cache_common_home_nav_header_key'), null); + MyCache(SystemService::CacheKey('shopxo.cache_common_home_nav_footer_key'), null); return DataReturn('编辑成功'); } diff --git a/app/service/PluginsAdminService.php b/app/service/PluginsAdminService.php index d4429368c845bbd4dcab3612cf88b1bc63cef7ab..22800b2704fe99de3add2c68650cabb0dd2ed418 100755 --- a/app/service/PluginsAdminService.php +++ b/app/service/PluginsAdminService.php @@ -11,6 +11,7 @@ namespace app\service; use think\facade\Db; +use app\service\SystemService; use app\service\PluginsService; use app\service\ResourcesService; use app\service\SqlConsoleService; @@ -64,7 +65,7 @@ class PluginsAdminService $admin = AdminService::LoginInfo(); if(!empty($admin)) { - $res = MyCache(MyConfig('shopxo.cache_admin_power_plugins_key').$admin['id']); + $res = MyCache(SystemService::CacheKey('shopxo.cache_admin_power_plugins_key').$admin['id']); if(!empty($res)) { $power_plugins = $res; diff --git a/app/service/PluginsService.php b/app/service/PluginsService.php index 587395f0ad5972e63bde23f5e0fda23f09be17dc..ac2012309edec1860b3373a279d2fe193279790c 100755 --- a/app/service/PluginsService.php +++ b/app/service/PluginsService.php @@ -11,6 +11,7 @@ namespace app\service; use think\facade\Db; +use app\service\SystemService; use app\service\ResourcesService; use app\service\PluginsAdminService; use app\service\StoreService; @@ -186,7 +187,7 @@ class PluginsService */ public static function PluginsCacheStorage($plugins, $data) { - return MyCache(MyConfig('shopxo.cache_plugins_data_key').$plugins, $data); + return MyCache(SystemService::CacheKey('shopxo.cache_plugins_data_key').$plugins, $data); } /** @@ -200,7 +201,7 @@ class PluginsService */ public static function PluginsCacheData($plugins) { - return MyCache(MyConfig('shopxo.cache_plugins_data_key').$plugins); + return MyCache(SystemService::CacheKey('shopxo.cache_plugins_data_key').$plugins); } /** @@ -214,7 +215,7 @@ class PluginsService */ public static function PluginsCacheDelete($plugins) { - MyCache(MyConfig('shopxo.cache_plugins_data_key').$plugins, null); + MyCache(SystemService::CacheKey('shopxo.cache_plugins_data_key').$plugins, null); } /** diff --git a/app/service/QuickNavService.php b/app/service/QuickNavService.php index 4448a63f0d8a8a9e3e60ba9d402f905a2af1c7cf..f40becbcc242a6db7e305e5104307fc8b57e8766 100755 --- a/app/service/QuickNavService.php +++ b/app/service/QuickNavService.php @@ -11,6 +11,7 @@ namespace app\service; use think\facade\Db; +use app\service\SystemService; use app\service\ResourcesService; /** @@ -268,7 +269,7 @@ class QuickNavService public static function QuickNav($params = []) { // 缓存 - $key = MyConfig('shopxo.cache_quick_navigation_key').APPLICATION_CLIENT_TYPE; + $key = SystemService::CacheKey('shopxo.cache_quick_navigation_key').APPLICATION_CLIENT_TYPE; $data = MyCache($key); if($data === null || MyEnv('app_debug')) { diff --git a/app/service/RegionService.php b/app/service/RegionService.php index 2e80ad5516e3dc11a173ab26b1aa96bba20cf751..630366c5afb3ba644fd126e2753c73d69a54e45e 100755 --- a/app/service/RegionService.php +++ b/app/service/RegionService.php @@ -11,6 +11,7 @@ namespace app\service; use think\facade\Db; +use app\service\SystemService; /** * 地区服务层 @@ -261,7 +262,7 @@ class RegionService public static function RegionAll($params = []) { // 缓存 - $key = MyConfig('shopxo.cache_region_all_key'); + $key = SystemService::CacheKey('shopxo.cache_region_all_key'); $data = MyCache($key); if(empty($data)) { diff --git a/app/service/SearchService.php b/app/service/SearchService.php index 44516ca16726b25933cd24f8a2163787f8169309..0d42eaa4901e8ef1cacf54133ea123aedc595c65 100755 --- a/app/service/SearchService.php +++ b/app/service/SearchService.php @@ -11,6 +11,7 @@ namespace app\service; use think\facade\Db; +use app\service\SystemService; use app\service\GoodsService; use app\service\BrandService; use app\service\ResourcesService; @@ -380,7 +381,7 @@ class SearchService */ public static function SearchKeywordsList($params = []) { - $key = MyConfig('shopxo.cache_search_keywords_key'); + $key = SystemService::CacheKey('shopxo.cache_search_keywords_key'); $data = MyCache($key); if($data === null || MyEnv('app_debug')) { diff --git a/app/service/SystemService.php b/app/service/SystemService.php index b3f7ac2a40d0fedd45058dbb02aec8fc0bcadc90..068fb6b82b2caeef878ddc90ad2b978016efa02d 100644 --- a/app/service/SystemService.php +++ b/app/service/SystemService.php @@ -139,5 +139,19 @@ class SystemService return $value; } + + /** + * 缓存key获取 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2022-04-21 + * @desc description + * @param [string] $key [缓存key] + */ + public static function CacheKey($key) + { + return MyConfig($key).'_'.SYSTEM_TYPE; + } } ?> \ No newline at end of file diff --git a/app/service/UserService.php b/app/service/UserService.php index 94181ae56c28e3c8a73893ea7e39d9e183e8e841..3e0485e914bee1d5b7d01cf78bc9c6812f9d18de 100755 --- a/app/service/UserService.php +++ b/app/service/UserService.php @@ -95,7 +95,7 @@ class UserService self::UserLoginRecord($user_login_info['id']); if(!empty($user_login_info['token'])) { - MyCache(MyConfig('shopxo.cache_user_info').$user_login_info['token'], $user_login_info); + MyCache(SystemService::CacheKey('shopxo.cache_user_info').$user_login_info['token'], $user_login_info); } } } @@ -114,7 +114,7 @@ class UserService */ public static function UserTokenData($token) { - $user = MyCache(MyConfig('shopxo.cache_user_info').$token); + $user = MyCache(SystemService::CacheKey('shopxo.cache_user_info').$token); if($user !== null && isset($user['id'])) { return $user; @@ -2107,7 +2107,7 @@ class UserService $user['token'] = self::CreatedUserToken($user_id); if(Db::name('User')->where(['id'=>$user_id])->update(['token'=>$user['token'], 'upd_time'=>time()])) { - MyCache(MyConfig('shopxo.cache_user_info').$user['token'], $user); + MyCache(SystemService::CacheKey('shopxo.cache_user_info').$user['token'], $user); } // web端用户登录纪录处理