Shopware 6 - AuthControllerDecorator已弃用。解决方法是使用Authenticator。可参考下方的代码示例:
// 以前的用法
use Shopware\Core\Framework\Routing\Annotation\RouteScope;
use Shopware\Core\System\Annotation\Concept\ExtensionPattern\DecoratableExtension;
use Shopware\Core\System\SalesChannel\Context\SalesChannelContextFactoryInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Shopware\Core\Framework\Context;
/**
- @RouteScope(scopes={store-api"})
- @DecoratableExtension()
*/
class AuthControllerDecorator extends AuthController
{
// 方法的实现
}
// 新的用法
use Shopware\Core\System\SalesChannel\Context\SalesChannelContextFactoryInterface;
use Shopware\Core\Framework\Routing\Annotation\RouteScope;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Shopware\Core\Framework\Context;
use Shopware\Core\Framework\Routing\Annotation\Authenticator;
/**
- @RouteScope(scopes={"store-api"})
- @Authenticator(enabled=true)
*/
class AuthController extends StoreApiFrameworkController
{
// 方法实现
}"