作者 开飞机的舒克

后台优化

@@ -6,9 +6,10 @@ use tinymeng\code\Generate; @@ -6,9 +6,10 @@ use tinymeng\code\Generate;
6 6
7 class Resource 7 class Resource
8 { 8 {
9 - public static function StudyBar($id){ 9 + public static function StudyBar($unique){
10 $generate = Generate::bar(); 10 $generate = Generate::bar();
11 -// $file_path = $generate->create($id,true);  
12 -// return $file_path; 11 + $file_path = $generate->create($unique,false,true);
  12 + $file_path = substr($file_path,strripos($file_path,"public")+6);
  13 + return $file_path;
13 } 14 }
14 } 15 }
@@ -54,9 +54,9 @@ class Bar extends Gateway{ @@ -54,9 +54,9 @@ class Bar extends Gateway{
54 } 54 }
55 55
56 if(is_int($data)){ 56 if(is_int($data)){
57 - $file_name = 'bar'.$data.'.png'; 57 + $file_name = $data;
58 }else{ 58 }else{
59 - $file_name = 'bar'.date('YmdHis').rand(1111,9999).'.png'; 59 + $file_name = date('YmdHis').rand(1111,9999);
60 } 60 }
61 $filename = $filePath.$file_name.'.png'; 61 $filename = $filePath.$file_name.'.png';
62 $drawing = new BCGDrawing($filename, $colorBack); 62 $drawing = new BCGDrawing($filename, $colorBack);
@@ -10,7 +10,7 @@ use \tinymeng\tools\Strings; @@ -10,7 +10,7 @@ use \tinymeng\tools\Strings;
10 * @method static \tinymeng\code\Gateways\Qr qr(array $config=[]) 二维码 10 * @method static \tinymeng\code\Gateways\Qr qr(array $config=[]) 二维码
11 * @package tinymeng\mailer 11 * @package tinymeng\mailer
12 */ 12 */
13 -define('saveFilePath',dirname(dirname(dirname(dirname(__DIR__)))).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'tinymeng'.DIRECTORY_SEPARATOR.'code'.DIRECTORY_SEPARATOR); 13 +define('saveFilePath',dirname(dirname(dirname(dirname(__DIR__)))).DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'barimages'.DIRECTORY_SEPARATOR.date('Ymd').DIRECTORY_SEPARATOR);
14 14
15 class Generate 15 class Generate
16 { 16 {