|
@@ -3,7 +3,7 @@
|
|
* @Author: wang jun
|
|
* @Author: wang jun
|
|
* @Date: 2022-01-18 11:12:23
|
|
* @Date: 2022-01-18 11:12:23
|
|
* @Last Modified by: wang jun
|
|
* @Last Modified by: wang jun
|
|
- * @Last Modified time: 2022-01-18 14:17:55
|
|
|
|
|
|
+ * @Last Modified time: 2022-01-19 10:38:13
|
|
* 微信类
|
|
* 微信类
|
|
*/
|
|
*/
|
|
namespace app\index\logic;
|
|
namespace app\index\logic;
|
|
@@ -11,8 +11,30 @@ namespace app\index\logic;
|
|
use app\index\logic\wxBizDataCrypt;
|
|
use app\index\logic\wxBizDataCrypt;
|
|
use app\index\model\usermodel;
|
|
use app\index\model\usermodel;
|
|
|
|
|
|
-class wechatlogic
|
|
|
|
|
|
+class wechatlogic extends baselogic
|
|
{
|
|
{
|
|
|
|
+ /**
|
|
|
|
+ * 设置请求数据规则
|
|
|
|
+ * 20220107
|
|
|
|
+ * wj
|
|
|
|
+ */
|
|
|
|
+ protected function setrules()
|
|
|
|
+ {
|
|
|
|
+ $list = [
|
|
|
|
+ 'getOpenid' => [
|
|
|
|
+ ['name' => 'code', 'title' => 'code', 'require' => true, 'type' => 'string'],
|
|
|
|
+ ],
|
|
|
|
+ 'create_qrcode' => [
|
|
|
|
+ ['name' => 'scene', 'title' => 'scene', 'require' => true, 'type' => 'string'],
|
|
|
|
+ ['name' => 'page', 'title' => 'page', 'require' => true, 'type' => 'string'],
|
|
|
|
+ ],
|
|
|
|
+ 'down_qrcode' => [
|
|
|
|
+ ['name' => 'scene', 'title' => 'scene', 'require' => true, 'type' => 'string'],
|
|
|
|
+ ['name' => 'page', 'title' => 'page', 'require' => true, 'type' => 'string'],
|
|
|
|
+ ],
|
|
|
|
+ ];
|
|
|
|
+ return $list;
|
|
|
|
+ }
|
|
public function getselfwxconfig()
|
|
public function getselfwxconfig()
|
|
{
|
|
{
|
|
$config = [
|
|
$config = [
|
|
@@ -81,6 +103,10 @@ class wechatlogic
|
|
*/
|
|
*/
|
|
public function getOpenid($arr)
|
|
public function getOpenid($arr)
|
|
{
|
|
{
|
|
|
|
+ $result = $this->checkparam(__FUNCTION__, $arr);
|
|
|
|
+ if (1 != $result['status']) {
|
|
|
|
+ return $result;
|
|
|
|
+ }
|
|
$code = $arr['code'];
|
|
$code = $arr['code'];
|
|
$config = $this->getselfwxconfig();
|
|
$config = $this->getselfwxconfig();
|
|
$appid = $config['appid'];
|
|
$appid = $config['appid'];
|
|
@@ -122,6 +148,10 @@ class wechatlogic
|
|
//获得二维码
|
|
//获得二维码
|
|
public function create_qrcode($arr)
|
|
public function create_qrcode($arr)
|
|
{
|
|
{
|
|
|
|
+ $result = $this->checkparam(__FUNCTION__, $arr);
|
|
|
|
+ if (1 != $result['status']) {
|
|
|
|
+ return $result;
|
|
|
|
+ }
|
|
$sharepage = request()->param();
|
|
$sharepage = request()->param();
|
|
$qr_path = "./Uploads/";
|
|
$qr_path = "./Uploads/";
|
|
if (!file_exists($qr_path . 'user/')) {
|
|
if (!file_exists($qr_path . 'user/')) {
|
|
@@ -204,6 +234,10 @@ class wechatlogic
|
|
*/
|
|
*/
|
|
public function download_qrcode($arr)
|
|
public function download_qrcode($arr)
|
|
{
|
|
{
|
|
|
|
+ $result = $this->checkparam(__FUNCTION__, $arr);
|
|
|
|
+ if (1 != $result['status']) {
|
|
|
|
+ return $result;
|
|
|
|
+ }
|
|
$qr_path = "./Uploads/";
|
|
$qr_path = "./Uploads/";
|
|
if (!file_exists($qr_path . 'user/')) {
|
|
if (!file_exists($qr_path . 'user/')) {
|
|
mkdir($qr_path . 'user/', 0700, true); //判断保存目录是否存在,不存在自动生成文件目录
|
|
mkdir($qr_path . 'user/', 0700, true); //判断保存目录是否存在,不存在自动生成文件目录
|