addArgument('name', InputArgument::OPTIONAL, 'Name description'); } /** * @param InputInterface $input * @param OutputInterface $output * @return int */ protected function execute(InputInterface $input, OutputInterface $output): int { $encryptStr = (new DyApiService())->encrypt('这是一个测试', env('DY_APPSECRET')); $output->write('加密字符串:' . $encryptStr); $decryptStr = (new DyApiService())->decrypt($encryptStr, env('DY_APPSECRET')); $output->write('解密字符串:' . $decryptStr); return 0; } }