你有没有同样的问题,你的二维码不再加载?这是因为Google Charts不再活跃。谷歌在过去的几天里禁用了这项服务!所以如果你在苦苦挣扎,这是原因:
https://groups.google.com/forum/#!topic/Google-chart-api/rZtHTyYgyXI
为此,您需要使用新的Google图表工具:
https://developers.google.com/chart/
我将弄清楚,如何替换生成二维码的旧实现,并让您知道如何做到这一点。
发布于 2019-03-20 02:45:41
我也找到了一个很好的解决方案,如果你只是想使用一个URL,就像之前的Google一样:
http://goqr.me/api/
问题是,新的Google API不再实现二维码-可悲的是。
发布于 2019-03-20 02:40:38
几个月前我遇到了这个问题,所以我刚刚做了我自己的二维码生成器,我使用Laravel框架(PHP)来解决这个问题:
首先,我使用了这个库:
simplesoftwareio/simple-qrcode
这当然是针对PHP的
如下所示:
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Str;
use SimpleSoftwareIO\QrCode\Facades\QrCode;
class QrCodeController extends BaseController
{
/**
* @param $uuid
* @return mixed
*/
public function generate($parameter) {
$fileName = $parameter.'.png';
$file = storage_path()."/".$this->app_directory."/".$fileName;
QrCode::format('png')->size(1000)->generate($parameter, $file);
return Response::download($file, $fileName)->deleteFileAfterSend(true);
}
}然后我只需添加到routes文件:
Route::get('qr/{parameter}', 'QrCodeController@generate');这只是我解决这个问题的一个想法。
https://stackoverflow.com/questions/55247825
复制相似问题