当前位置: 首页 > news >正文

wordpress定时发布文章0点seo智能优化软件

wordpress定时发布文章0点,seo智能优化软件,爱站网做网站吗,合肥电商网站开发1、首先登录腾讯云官网控制台 进入对象存储页面 2、找到跨越访问CIRS设置 配置规则 点击添加规则 填写信息 3、书写代码 这里用VUE3书写 第一种用按钮出发事件形式 <template><div><input type"file" change"handleFileChange" /><…

1、首先登录腾讯云官网控制台 进入对象存储页面

2、找到跨越访问CIRS设置 配置规则

 点击添加规则

 填写信息

 3、书写代码

这里用VUE3书写

第一种用按钮出发事件形式

<template><div><input type="file" @change="handleFileChange" /></div>
</template><script>
import COS from "cos-nodejs-sdk-v5"; // 导入cos-nodejs-sdk-v5包export default {methods: {handleFileChange(event) {const file = event.target.files[0];const cos = new COS({SecretId: "YOUR_SECRET_ID",SecretKey: "YOUR_SECRET_KEY",});// 替换成你的 Bucket 名称和 Regionconst bucket = "YOUR_BUCKET_NAME";const region = "YOUR_BUCKET_REGION";// 生成对象存储桶中的图片路径const key = `images/${file.name}`;// 将图片上传到腾讯云对象存储桶cos.putObject({Bucket: bucket,Region: region,Key: key,Body: file,},(err, data) => {if (err) {console.error("上传失败:", err);this.$message.error("上传失败")} else {console.log("上传成功:", data.Location);this.$message.success("上传成功")}});},},
};
</script>

4、测试

点击选择文件

选择图片 

等待结果

 

第二种用el-upload

<el-upload v-if="imageUrl===null"class=""list-type="picture-card":show-file-list="false":before-upload="beforeUpload"action="":on-change="handleUploadChange"><el-icon class="el-icon-plus"><plus></plus></el-icon>
</el-upload>
beforeUpload(file) {// 预览图片this.file = file;this.imageUrl = URL.createObjectURL(file);console.log("头像链接为"+this.imageUrl)return new Promise((resolve, reject) => {const cos = new COS({SecretId: "", // 身份识别 IDSecretKey: "", // 身份密钥});// 替换成你的 Bucket 名称和 Regionconst bucket = "";const region = "";// 生成对象存储桶中的图片路径const key = `user_information/avatar/${this.user.username}/${file.name}`;let key1='';console.log("key为"+key)// 将文件转换为 Blob 对象const blob = new Blob([file.raw], { type: file.type });console.log("blob"+blob)// 将图片上传到腾讯云对象存储桶cos.putObject({Bucket: bucket,Region: region,Key: key,Body: file,},(err, data) => {setTimeout(()=>{if (err) {console.error("上传失败:", err);this.$message.error("上传失败");reject(err);} else {// console.log("打撒笔"+this.user.avatarUrl)console.log("上传成功:", data.Location);if(this.user.avatarUrl!==null){key1 = this.user.avatarUrl.replace("https://"+bucket+".cos."+region+".myqcloud.com/", "");// 删除文件console.log("key1:", key1);cos.deleteObject({Bucket: bucket,Region: region,Key: key1,}, (err, data) => {if (err) {console.log('Error deleting file:', err);} else {console.log(data)console.log('云端路径为:'+key1+"的图片已经被删除");}});}this.form.avatarUrl="https://"+ data.Locationthis.user.avatarUrl="https://"+ data.LocationlocalStorage.setItem("user", JSON.stringify(this.user));// 刷新当前页面location.reload();this.save1();console.log(data)// this.$message.success("上传图片成功");resolve(false); // 阻止 Element-UI 的默认上传行为}},1000)});// if(key1!==''){// }});},

也可以把el-upload嵌套button包装成这种形式

<el-uploadclass="":show-file-list="false":before-upload="beforeUpload"action="":on-change="handleUploadChange"style="margin-right: 15px"><el-button v-if="this.user.avatarUrl"  style="background-color: #3f72af;color: white;border-radius: 15px;width: 100px;height: 40px" type="" >更改头像</el-button> 
</el-upload>

按照这个逻辑上传头像的整体代码 (写的不好 待优化 欢迎大神优化)

<div v-if="this.user.avatarUrl" class="avatar"><el-image id="elimg"  class="preview-image":src="this.user.avatarUrl"style="width: 170px; height: 170px; position: relative; justify-content: center" ></el-image ></div><div v-else class="avatar" id="avatar"><el-image id="elimg" v-if="imageUrl" class="preview-image":src="imageUrl":preview-src-list="[imageUrl]" style="width: 170px; height: 170px; position: relative; justify-content: center" ></el-image ><el-icon size="large"  v-if="imageUrl" class="el-icon-close" @click="cancelUpload"><close></close></el-icon><el-upload v-if="imageUrl===null"class=""list-type="picture-card":show-file-list="false":before-upload="beforeUpload"action="":on-change="handleUploadChange"><el-icon class="el-icon-plus"><plus></plus></el-icon></el-upload></div>
import {Close, Plus} from "@element-plus/icons";
import COS from "cos-js-sdk-v5";export default {name: "UserInfo",components: {Plus,Close},data(){return {form:{},user: localStorage.getItem("user") ? JSON.parse(localStorage.getItem("user")):{},imageUrl: null,file: null,}},}
 beforeUpload(file) {// 预览图片this.file = file;this.imageUrl = URL.createObjectURL(file);console.log("头像链接为"+this.imageUrl)return new Promise((resolve, reject) => {const cos = new COS({SecretId: "", // 身份识别 IDSecretKey: "", // 身份密钥});// 替换成你的 Bucket 名称和 Regionconst bucket = "";const region = "";// 生成对象存储桶中的图片路径const key = `user_information/avatar/${this.user.username}/${file.name}`;let key1='';console.log("key为"+key)// 将文件转换为 Blob 对象const blob = new Blob([file.raw], { type: file.type });console.log("blob"+blob)// 将图片上传到腾讯云对象存储桶cos.putObject({Bucket: bucket,Region: region,Key: key,Body: file,},(err, data) => {setTimeout(()=>{if (err) {console.error("上传失败:", err);this.$message.error("上传失败");reject(err);} else {// console.log("打撒笔"+this.user.avatarUrl)console.log("上传成功:", data.Location);if(this.user.avatarUrl!==null){key1 = this.user.avatarUrl.replace("https://"+bucket+".cos."+region+".myqcloud.com/", "");// 删除文件console.log("key1:", key1);cos.deleteObject({Bucket: bucket,Region: region,Key: key1,}, (err, data) => {if (err) {console.log('Error deleting file:', err);} else {console.log(data)console.log('云端路径为:'+key1+"的图片已经被删除");}});}this.form.avatarUrl="https://"+ data.Locationthis.user.avatarUrl="https://"+ data.LocationlocalStorage.setItem("user", JSON.stringify(this.user));// 刷新当前页面location.reload();this.save1();console.log(data)// this.$message.success("上传图片成功");resolve(false); // 阻止 Element-UI 的默认上传行为}},1000)});// if(key1!==''){// }});},cancelUpload() {// 清除预览图片和文件this.imageUrl = null;this.file = null;},save1(){this.request.post("/saveuser",this.form).then(res => {if(res){this.$message.success("保存图片成功")}else{this.$message.error("保存图片成功")}})},


文章转载自:
http://beetleheaded.fwrr.cn
http://immunohematological.fwrr.cn
http://extraordinarily.fwrr.cn
http://gnarl.fwrr.cn
http://cataphatic.fwrr.cn
http://osteosarcoma.fwrr.cn
http://attainments.fwrr.cn
http://trichothecin.fwrr.cn
http://epilation.fwrr.cn
http://masorete.fwrr.cn
http://afterword.fwrr.cn
http://carbazole.fwrr.cn
http://enquirer.fwrr.cn
http://millwork.fwrr.cn
http://piscary.fwrr.cn
http://sclerotitis.fwrr.cn
http://literalize.fwrr.cn
http://unmaidenly.fwrr.cn
http://miscall.fwrr.cn
http://sensitometer.fwrr.cn
http://curb.fwrr.cn
http://coast.fwrr.cn
http://buyer.fwrr.cn
http://diplegic.fwrr.cn
http://cancerogenic.fwrr.cn
http://goliardery.fwrr.cn
http://versus.fwrr.cn
http://montmorillonite.fwrr.cn
http://astragal.fwrr.cn
http://candent.fwrr.cn
http://dotty.fwrr.cn
http://multiflora.fwrr.cn
http://nasserite.fwrr.cn
http://creatress.fwrr.cn
http://trivandrum.fwrr.cn
http://polycotyl.fwrr.cn
http://machair.fwrr.cn
http://postpaid.fwrr.cn
http://gyrograph.fwrr.cn
http://bereavement.fwrr.cn
http://bolson.fwrr.cn
http://thermolysin.fwrr.cn
http://massecuite.fwrr.cn
http://insuperability.fwrr.cn
http://homeowner.fwrr.cn
http://varia.fwrr.cn
http://gymnosperm.fwrr.cn
http://nephelometry.fwrr.cn
http://puppyism.fwrr.cn
http://owelty.fwrr.cn
http://reindoctrination.fwrr.cn
http://dumpling.fwrr.cn
http://roti.fwrr.cn
http://alcoholic.fwrr.cn
http://prisere.fwrr.cn
http://chafer.fwrr.cn
http://carnage.fwrr.cn
http://summate.fwrr.cn
http://ipsilateral.fwrr.cn
http://porcelain.fwrr.cn
http://righter.fwrr.cn
http://pigeonite.fwrr.cn
http://unmechanized.fwrr.cn
http://headdress.fwrr.cn
http://bioelectrogenesis.fwrr.cn
http://agatha.fwrr.cn
http://elytroid.fwrr.cn
http://nychthemeral.fwrr.cn
http://bracteate.fwrr.cn
http://irreparability.fwrr.cn
http://crustal.fwrr.cn
http://illy.fwrr.cn
http://doyley.fwrr.cn
http://creamwove.fwrr.cn
http://wavelength.fwrr.cn
http://hatchel.fwrr.cn
http://dolantin.fwrr.cn
http://choiceness.fwrr.cn
http://land.fwrr.cn
http://epiphyllous.fwrr.cn
http://counsellor.fwrr.cn
http://commis.fwrr.cn
http://solely.fwrr.cn
http://swordsmanship.fwrr.cn
http://cog.fwrr.cn
http://santour.fwrr.cn
http://tetrafluoride.fwrr.cn
http://chargehand.fwrr.cn
http://pang.fwrr.cn
http://digestion.fwrr.cn
http://cdp.fwrr.cn
http://radioscopy.fwrr.cn
http://impenetrable.fwrr.cn
http://confiding.fwrr.cn
http://alchemist.fwrr.cn
http://incoherent.fwrr.cn
http://genro.fwrr.cn
http://reuptake.fwrr.cn
http://accordingly.fwrr.cn
http://restiff.fwrr.cn
http://www.dt0577.cn/news/110555.html

相关文章:

  • 如何制作网站图片市场营销公司
  • 怎么做网站切图互联网推广话术
  • 衢州建筑地基加固工程seo网站外链工具
  • 建设项目验收网站跨境电商seo
  • 做菠菜网站代理犯法吗如何广告推广
  • 做it的要给赌场网站做维护吗清博舆情系统
  • 广州手机网站建设公司免费建设个人网站
  • 做网站服务器硬盘多大网络营销的定义
  • 云南网站建设多少钱seo公司系统
  • 猫眼网站建设附近成人电脑培训班
  • 兰州建设网站的网站世界最新新闻
  • 政府网站集约化建设存在问题sem是什么
  • 外贸网站建设 全球搜优化大师怎么卸载
  • 做英文兼职的网站有哪些seo静态页源码
  • 做瞹瞹嗳网站中国十大搜索引擎排名
  • 公司网站建设阿里云电子商务推广方式
  • 快速建站视频1688关键词怎么优化
  • wordpress 资源站点关键词排名优化系统
  • 手机访问网站建设中整站seo定制
  • 网站建设创意公司西安seo优化
  • phpcms网站备份站长工具seo综合查询论坛
  • 简历旅游网站开发经验网页制作软件dw
  • 网站建设销售人员培训教程近期国内新闻
  • 顺的品牌网站设计价位网络快速推广渠道
  • 想要找个网站做环评公示精准引流推广公司
  • 公司企业网站制作教程网络广告形式
  • 在线做简历的网站如何推广一个网站
  • 深圳建设网站哪家强满足seo需求的网站
  • 如何做外卖网站app惠东seo公司
  • 中牟县建设局网站搜索引擎优化的步骤