62 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
			
		
		
	
	
			62 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
| <?php
 | |
| namespace app\service;
 | |
| 
 | |
| use think\facade\Config as CConfig;
 | |
| 
 | |
| /**
 | |
|  * 扩展配置项工具类
 | |
|  * Class ExtraConfig
 | |
|  * @package app\service
 | |
|  */
 | |
| class ExtraConfig
 | |
| {
 | |
|     private static string $extraDir = 'extra/';
 | |
| 
 | |
|     /**
 | |
|      * 比率设置
 | |
|      * @return array|mixed
 | |
|      */
 | |
|     public static function ratio()
 | |
|     {
 | |
|         CConfig::load(self::$extraDir.'ratio', 'ratio');
 | |
|         return config('ratio') ?? [];
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * 微信相关设置
 | |
|      * @return array|mixed
 | |
|      */
 | |
|     public static function wechat()
 | |
|     {
 | |
|         CConfig::load(self::$extraDir.'wechat', 'wechat');
 | |
|         return config('wechat') ?? [];
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * 小程序个性装修配置
 | |
|      * @return array|mixed
 | |
|      */
 | |
|     public static function miniProgram()
 | |
|     {
 | |
|         CConfig::load('extra/mini_program', 'mini_program');
 | |
|         return config('mini_program') ?? [];
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * 基础配置
 | |
|      */
 | |
|     public static function base()
 | |
|     {
 | |
|         CConfig::load('extra/base', 'base');
 | |
|         return config('base') ?? [];
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * 阿里OSS配置
 | |
|      */
 | |
|     public static function aliOss()
 | |
|     {
 | |
|         CConfig::load('extra/alioss', 'alioss');
 | |
|         return config('alioss') ?? [];
 | |
|     }
 | |
| } |