Commit f4fded9c authored by hujun's avatar hujun

区分图片

parent 458e7049
...@@ -61,9 +61,45 @@ class UploadImg extends Basic ...@@ -61,9 +61,45 @@ class UploadImg extends Basic
$type = request()->param('type'); $type = request()->param('type');
$uploadResult = $this->uFService->upload($file, $type); $uploadResult = $this->uFService->upload($file, $type);
if (CURRENT_URL == 'https://api.tonglianjituan.com') {
$path = IMAGES_URL;
} else {
$path = 'https://pre2.tonglianjituan.com';
}
switch ($type) {
case 'chat':
$path .= 'static/chat_image/';
break;
case 'user_header' :
$path .= 'static/user_header/';
break;
case 'agent_header' :
$path .= 'static/head_portrait/';
break;
case 'house_img':
$path .= 'resource/lib/Attachments/images/';
break;
case 'business_school' :
$path .= 'static/business_school/';
break;
case 'business_school_file' :
$path .= 'static/business_school_file/';
break;
case 'shop_image_depot' :
$path .= 'static/shop_image_depot/';
break;
case 'exclusive_file' :
$path .= 'static/exclusive_file/';
break;
case 'agent_black_list_img':
$path .= 'static/agent_black_list/';
break;
}
$cb = $_GET['CKEditorFuncNum']; //获得ck的回调id $cb = $_GET['CKEditorFuncNum']; //获得ck的回调id
try { try {
$url = $uploadResult["msg"]['internet_img_name']; //我自己的放置上传图片的逻辑,返回图片放置后的url $url = $path . $uploadResult["msg"]['internet_img_name']; //我自己的放置上传图片的逻辑,返回图片放置后的url
echo "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction($cb,'".$url."','');</script>"; echo "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction($cb,'".$url."','');</script>";
}catch (\Exception $e) { }catch (\Exception $e) {
$erro = $e->getMessage(); $erro = $e->getMessage();
......
...@@ -56,9 +56,45 @@ class UploadImg extends Basic ...@@ -56,9 +56,45 @@ class UploadImg extends Basic
$type = request()->param('type'); $type = request()->param('type');
$uploadResult = $this->uFService->upload($file, $type); $uploadResult = $this->uFService->upload($file, $type);
if (CURRENT_URL == 'https://api.tonglianjituan.com') {
$path = IMAGES_URL;
} else {
$path = 'https://pre2.tonglianjituan.com';
}
switch ($type) {
case 'chat':
$path .= 'static/chat_image/';
break;
case 'user_header' :
$path .= 'static/user_header/';
break;
case 'agent_header' :
$path .= 'static/head_portrait/';
break;
case 'house_img':
$path .= 'resource/lib/Attachments/images/';
break;
case 'business_school' :
$path .= 'static/business_school/';
break;
case 'business_school_file' :
$path .= 'static/business_school_file/';
break;
case 'shop_image_depot' :
$path .= 'static/shop_image_depot/';
break;
case 'exclusive_file' :
$path .= 'static/exclusive_file/';
break;
case 'agent_black_list_img':
$path .= 'static/agent_black_list/';
break;
}
$cb = $_GET['CKEditorFuncNum']; //获得ck的回调id $cb = $_GET['CKEditorFuncNum']; //获得ck的回调id
try { try {
$url = $uploadResult["msg"]['internet_img_name']; //我自己的放置上传图片的逻辑,返回图片放置后的url $url = $path . $uploadResult["msg"]['internet_img_name']; //我自己的放置上传图片的逻辑,返回图片放置后的url
echo "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction($cb,'".$url."','');</script>"; echo "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction($cb,'".$url."','');</script>";
}catch (\Exception $e) { }catch (\Exception $e) {
$erro = $e->getMessage(); $erro = $e->getMessage();
......
...@@ -324,7 +324,13 @@ ...@@ -324,7 +324,13 @@
<div class="" style="width: 100%;"> <div class="" style="width: 100%;">
<div class="input-group" style="width: 100%;" id="dajiangtang"> <div class="input-group" style="width: 100%;" id="dajiangtang">
<?php <?php
create_editor('goods_sup_id','',['filebrowserUploadUrl'=>IMAGES_URL.'index/uploadEditor?type=business_school']); if (CURRENT_URL == 'https://api.tonglianjituan.com') {
$url = IMAGES_URL;
} else {
$url = 'https://pre2.tonglianjituan.com/';
}
create_editor('goods_sup_id','',['filebrowserUploadUrl'=>$url.'index/uploadEditor?type=business_school']);
?> ?>
</div> </div>
</div> </div>
......
...@@ -282,7 +282,14 @@ ...@@ -282,7 +282,14 @@
<!--<label for="" style="width: 100%;">内容</label>--> <!--<label for="" style="width: 100%;">内容</label>-->
<div class="input-group" style="width: 100%;" id="dajiangtang"> <div class="input-group" style="width: 100%;" id="dajiangtang">
<?php <?php
create_editor('goods_sup_id','', ['filebrowserUploadUrl'=>IMAGES_URL.'index/uploadEditor?type=house_img']);
if (CURRENT_URL == 'https://api.tonglianjituan.com') {
$url = IMAGES_URL;
} else {
$url = 'https://pre2.tonglianjituan.com/';
}
create_editor('goods_sup_id','', ['filebrowserUploadUrl'=> $url.'index/uploadEditor?type=house_img']);
?> ?>
</div> </div>
</div> </div>
...@@ -292,7 +299,7 @@ ...@@ -292,7 +299,7 @@
<!--附件--> <!--附件-->
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">附件(格式为pdf/doc,选填,上限为5个):</label> <label class="col-sm-2 control-label"><?php echo $url.'index/uploadEditor?type=house_img'; ?>附件(格式为pdf/doc,选填,上限为5个):</label>
<div class="col-sm-9"> <div class="col-sm-9">
<div class="file-upload-area"> <div class="file-upload-area">
<div class="btn-area"> <div class="btn-area">
......
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