<?php
namespace app\mobile\controller;
use think\facade\Session;
use app\common\variable\MsgCode;
use think\facade\Cache;
use app\common\model\CompanyIndustry as CompanyIndustryModel;
use app\common\controller\Config as ConfigController;
class CacheData extends Base
{
    public function getKey()
    {
        $D=request()->post();
        switch ($D['key']) {
            case 'company_industry':
                $Data=CompanyIndustryModel::getCate();
                break;
            case 'appDefaultConfig':
                $Data=ConfigController::appDefaultConfig();
                break;
            default:
                $Data=Cache::get($D['key']);
                break;
        }
        if ($Data) {
            return $this->ajaxReturn('',MsgCode::$success,$Data);
        }else{
            return $this->ajaxReturn('数据不存在',MsgCode::$error);
        }
    }
}
