src/Biz/Mp/Service/Impl/MpServiceImpl.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace Biz\Mp\Service\Impl;

use Biz\BaseService;
use Biz\Mp\Service\MpService;
use Biz\System\Service\SettingService;

class MpServiceImpl extends BaseService implements MpService
{
    public function getMpSdk()
    {
        return $this->biz['qiQiuYunSdk.mp'];
    }

    public function getAuthorization()
    {
        return $this->getMpSdk()->getAuthorization();
    }

    public function generateInitUrl($params, $schema = 'http')
    {
        return $this->getMpServerUrl($schema).'/es/setup?token='.$this->getToken($params);
    }

    public function generateVersionManagementUrl($params, $schema = 'http')
    {
        return $this->getMpServerUrl($schema).'/es/mini_program?token='.$this->getToken($params);
    }

    protected function getToken($params)
    {
        $token = $this->getMpSdk()->getToken($params);

        return $token['token'];
    }

    protected function getMpServerUrl($schema)
    {
        $developerSetting = $this->getSettingService()->get('developer', array());
        $hostUrl = 'mp-service.qiqiuyun.net';
        if (isset($developerSetting['mp_service_url']) && !empty($developerSetting['mp_service_url'])) {
            $urlSegs = explode('://', $developerSetting['mp_service_url']);
            if (2 == count($urlSegs)) {
                $hostUrl = $urlSegs[1];
            }
        }

        return $schema.'://'.$hostUrl;
    }

    /**
     * @return SettingService
     */
    protected function getSettingService()
    {
        return $this->biz->service('System:SettingService');
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。