12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Bear
- * Date: 2018/12/5
- * Time: 下午4:56
- */
- namespace app\main\constants;
- use think\Config;
- /**
- * 处理关于链接的常量
- * Class UrlConstants
- * @package app\main\constants
- */
- class UrlConstants
- {
- const REFERRAL_READING_PAGE_SPREAD = '1';//阅读页推广
- const REFERRAL_FRONT_PAGE_SPREAD = '2';//书城首页推广
- const REFERRAL_GROUND_PAGE_SPREAD = '3';//落地页推广
- const REFERRAL_PUSH_IN = '1';//内推
- const REFERRAL_PUSH_OUT = '0';//外派
- public static function get_page_404()
- {
- return Config::get('site.cdnurl').'/404.html';
- }
- public static $callbackIgnore = [
- 'mpapi',
- 'opticket',
- ];
- //忽略全部处理逻辑的页面url
- public static $ignoreCallbackInitialize = [
- 'api/wechat/opticket',
- 'api/wechat/mpapi',
- 'api/wechat/ttlttback',
- 'api/wechat/getToken',
- ];
- /**
- * 返回当前url 对应的位置索引
- * @param $action
- * @return int|mixed
- */
- public static function getLocation($action)
- {
- $location = [
- '/index/user/recent' => 1,
- '/index/user/index' => 2,
- '/index/index/index' => 3
- ];
- return $location[$action] ?? 0;
- }
- }
|