欢迎光临
感谢一路有你

0210220总结

如果你对该文章中的内容有疑问/不解,可以点击此处链接提问
要注明问题和此文章链接地址 点击此处跳转
 

总结下今天遇到的内容

  1. jq 判断复选框是否选中
$('.jqcheck').on('click',function(){
  var res = $(this).prev();//这个获取的等同于$("#1")
  console.log(res.attr('checked')) 
 })

 

  1. 禁止打开审查元素
    http://oss002.wangmingchang.com/upload_mac/cktoole.js

3.tp5.1上传图片添加水印

public function upload_one_addwater(){
      $file = request()->file('file');
      $file_glo = $_FILES['file'];

      $image = \think\Image::open($file);
      $img_config = config()['img'];
      $img_config['save_path'] = ($img_config['save_path']==''?'/public/upload/admin/file':$img_config['save_path']);
      $water_name =  $img_config['save_path'].'/water/'.date("YmdHis",time()).'_'.mt_rand(1000,9999).'.png';
      //临时参数修改
      $img_config['is_water'] = 2;
      if($img_config['pic_save_type']==0){
          // 给原图左上角添加水印并保存water_image.png
          if($img_config['is_water']==1){
              //图片水印
              $img_config['water_position'] = ($img_config['water_position']==''?'1':$img_config['water_position']);
              $img_config['water_clarity'] = ($img_config['water_clarity']==''?'100':$img_config['water_clarity']);
              $water_path = substr(config()['img']['water_path'],1);
              $image->water($water_path, $img_config['water_position'])->save('.'.$water_name); 
              $msg = $water_name;
          }elseif($img_config['is_water']==2){
              //文字水印
              $img_config['water_text'] = ($img_config['water_text']==''?'未设置默认文字水印':$img_config['water_text']);
              $img_config['water_font_path'] = ($img_config['water_font_path']==''?'./public/upload/1.ttf':$img_config['water_font_path']);
              $img_config['water_text_size'] = ($img_config['water_text_size']==''?'20':$img_config['water_text_size']);
              $img_config['water_text_color'] = ($img_config['water_text_color']==''?'#000':$img_config['water_text_color']);
              $image->text($img_config['water_text'],$img_config['water_font_path'],$img_config['water_text_size'],$img_config['water_text_color'],$img_config['water_position'],'-10')->save('.'.$water_name);
              $msg = $water_name;
          }else{
              //不加
              $info = $file->validate(['ext'=>config()['web']['pic_ext']])->move( './public/upload/admin/image');
              $getSaveName = str_replace('\\', '/', $info->getSaveName());//win下反斜杠替换成斜杠
              $msg = '/public/upload/admin/image/'.$getSaveName;
          }
      }
      if($msg){
          return jssuccess('http://plugintest.v1.fast.zf.90ckm.com'.$msg);
      }else{
          return jserror("error");
      }

  }

 

简单记录下,接着要继续完善我的影视网站了,再见

赞(2) 打赏
未经允许不得转载:王明昌博客 » 0210220总结
分享到: 更多 (0)

相关推荐

  • 暂无文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

×
订阅图标按钮