|
@@ -5,8 +5,35 @@ class app extends Base
|
|
|
{
|
|
|
protected $template_note;
|
|
|
|
|
|
+ function getMobileType() {
|
|
|
+ $userAgent = $_SERVER['HTTP_USER_AGENT'];
|
|
|
+
|
|
|
+ // 检查iOS设备
|
|
|
+ if (dstrpos($userAgent, ['iphone', 'ipad', 'ipod', 'ios'])) {
|
|
|
+ return 'ios';
|
|
|
+ }
|
|
|
+
|
|
|
+ // 检查Android设备
|
|
|
+ if (dstrpos($userAgent, ['android'])) {
|
|
|
+ return 'android';
|
|
|
+ }
|
|
|
+
|
|
|
+ return 'unknown';
|
|
|
+ }
|
|
|
+
|
|
|
function index($info = '', $module = '')
|
|
|
{
|
|
|
+
|
|
|
+
|
|
|
+ $uri = trim($_SERVER['REQUEST_URI'], '/');
|
|
|
+ if($uri){
|
|
|
+ $check = db("combine")->where('short', $uri)->find();
|
|
|
+ // print_r($check);die;
|
|
|
+ if(!empty($check)){
|
|
|
+ $system = $this->getMobileType();
|
|
|
+ header("Location: ".$check[$system]);
|
|
|
+ }
|
|
|
+ }
|
|
|
$ssid = SafeRequest('ssid', 'get');
|
|
|
$authcode = SafeRequest('authcode', 'get');
|
|
|
$authcode && setcookie('downcode', $authcode);
|