思路:将图片base64值转换生成图片文件并保存,将图片保存路径转换成二维码。二维码的生成使用了phpqrcode类增加了一个删除的操作,传入开始和结束日期,删除该范围内生成的图片及二维码<?php //包含一个文件上传类中的上传类 header('Content-Type: text/html; charset=utf-8'); $content = file_get_contents("php://input"); $content = json_decode($content,true); $type = $content['type']; $errcode = 0; $errtext = ""; $myJson = array(); $savepath = 'static/upload/'; //保存base64图片目录 $qrpath = 'static/qrcode/

后端 2018-08-14

接收前端发送的文本,使用php内置函数实现文本转换图片<?php header('Content-Type: text/html; charset=utf-8'); $content = file_get_contents("php://input"); $content = json_decode($content,true); $type = $content['type']; $errcode = 0; $errtext = ""; $myJson = array(); $greetingpath = 'static/greeting/';//合成图片目录 $jsonfile = 'config.json';//语言合成config文件 $fontttf = "./static/dist/fonts/xiekai.ttf"; //文本字体

后端 2018-08-14