Commit 271ae4a8 authored by hujun's avatar hujun

二维码路径和域名修改,取当前网址

parent a5ceac4c
...@@ -338,9 +338,9 @@ class Member extends Basic ...@@ -338,9 +338,9 @@ class Member extends Basic
if ($result) { if ($result) {
$code = new \app\api\untils\GenerateCode(); $code = new \app\api\untils\GenerateCode();
$url = config('url').'test.html?referrer_source=0&id='.$result->id; $url = $this->request->domain().'/test.html?referrer_source=0&id='.$result->id;
$path = $code->getCode($url, $result->id); $path = $code->getCode($url, $result->id);
$data['data'] = ['path' => config('url').$path]; $data['data'] = ['path' => $this->request->domain().'/'.$path];
$data['status'] = 200; $data['status'] = 200;
} else { } else {
$data['msg'] = '没有该用户'; $data['msg'] = '没有该用户';
......
...@@ -21,7 +21,7 @@ class GenerateCode { ...@@ -21,7 +21,7 @@ class GenerateCode {
$qrCode->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0]); $qrCode->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0]);
$qrCode->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255]); $qrCode->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255]);
$qrCode->setValidateResult(false); $qrCode->setValidateResult(false);
$path = './qrcode/'.$file_name.'.png'; $path = 'resource/qrcode/'.$file_name.'.png';
$qrCode->writeFile($path); $qrCode->writeFile($path);
return $path; return $path;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment