睿达图片系统备份

编程入门 行业动态 更新时间:2024-10-19 22:35:59

睿达图片<a href=https://www.elefans.com/category/jswz/34/1761594.html style=系统备份"/>

睿达图片系统备份

管理图片上传下载网上有不少版本,我这里整理了下我系统中用到的图片系统,用作备份

1.

  <span><i class="red">*</i>名片:</span>
                    <div>
                      <div v-show='isshow2' class="pic">
                        <img :src="src2" alt="user image">
                      </div>
                      <input type="file" @change="getFile2" ref="file" id="file2">
                    </div>

2. getFile (e) {
        this.isshow = true;
        var that=this;
        var file = e.target.files[0];
         var imgSize=file.size/1024;
        if(!/image\/\w+/.test(file.type)){  
            alert("请上传图片!");  
            return;  
        }else if(imgSize>200){
            alert('请上传大小不要超过200KB的图片')
        }else{
            var rd = new FileReader();
            rd.readAsDataURL(file); 
            rd.onloadend=function(){
            var dataURL = rd .result;
            that.src = dataURL;
          }
        }
      
       
      },

3. reg_submit(){
        let parm={
          user_group:thispyname,
          user_logo:this.src,
          card:this.src2,
          agent_project:this.daili.join(","),
          area_id:this.areaid,
          province_id:this.cityid,
          main_cust:this.customer,
          app_people:this.applicant,
          tel:this.phone,
          job:this.office
        };
            UserClient.post('/user/UserController/zhuceByQuDao',parm).then((res) => {
             if(res.code == 200){
                if(res.data >0){
                  alert("申请已提交,请耐心等待审核");
                }else{
                  alert("渠道已注册或申请有异常")
                }
              }else{
                console.info(res.desc);
              }
            }).catch(e=>{
              console.info(e);
            })

4.//制作图片保存在文件系统中   生产图片保存在图片自动中   数据库保存url
         String str = user_logo.substring(user_logo.indexOf(",")+1);
         String str2 = card.substring(card.indexOf(",")+1);
         String user_logoPath =  System.currentTimeMillis()+1+".jpg";
         String cardPath =  System.currentTimeMillis()+2+".jpg";
        Base64.GenerateImage(str,pictures+user_logoPath);
        Base64.GenerateImage(str2,pictures+cardPath);
        
        String insql = "insert into  user_group_t(user_logo,card,user_group,agent_project,area_id,province_id,main_cust,app_people,tel,job,status,create_time) values(?,?,?,?,?,?,?,?,?,?,?,NOW())"; 
        return userJt.update(insql, new Object[]{pictures_http+user_logoPath,pictures_http+cardPath,user_group,agent_project,area_id,province_id,main_cust,app_people,tel,job,"0"});
    }

更多推荐

睿达图片系统备份

本文发布于:2024-02-07 00:49:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1751709.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:系统备份   图片

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!