|
@@ -1,6 +1,7 @@
|
|
|
<?php namespace App\Http\Controllers\Admin;
|
|
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
+use App\Facades\Servers\WechatMini\Mini;
|
|
|
|
|
|
/**
|
|
|
* 后台控制器
|
|
@@ -26,9 +27,19 @@ class Index extends Auth{
|
|
|
* */
|
|
|
public function welcome()
|
|
|
{
|
|
|
-
|
|
|
+ // 结果数据
|
|
|
+ $link = cache('admin:wechat:mini:index:mpurl');
|
|
|
+ // 不存在数据
|
|
|
+ if ( is_null($link) ) {
|
|
|
+ // 从数据库获取数据
|
|
|
+ $link = Mini::getUrlLink('pages/index/index');
|
|
|
+ // 存起来
|
|
|
+ cache(['admin:wechat:mini:index:mpurl'=>$link],$link ? now()->addDays(28) : now()->addMinutes(3));
|
|
|
+ }
|
|
|
+ // 分配参数
|
|
|
+ $this->assign('link',$link);
|
|
|
// 加载模板
|
|
|
- return $this->fetch();
|
|
|
+ return $this->fetch();
|
|
|
}
|
|
|
|
|
|
|