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

网站建设个人兼职建网站平台

网站建设个人兼职,建网站平台,网页布局及版面设计,wordpress文章编辑器路径【今日成果】: //使用阿里云OSS服务: //使用v-if如果地址没有就不显示 , 如果地址错误图片就显示不出来; 【快速回顾】: 任何数据的删除都不要使用物理上的删除,应当使用逻辑上的删除!&…

【今日成果】:

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述
//使用阿里云OSS服务:
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述
//使用v-if如果地址没有就不显示 , 如果地址错误图片就显示不出来;
在这里插入图片描述

【快速回顾】:

任何数据的删除都不要使用物理上的删除,应当使用逻辑上的删除!!!
《显示状态控制》——可以通过《el-swtich》控件来完成。
logo图片需要保存到服务器上,数据库中只是存储了图片的地址。——vsftpd 、 FastDFS ; 或者使用阿里云对象存储。

【details】:

【阿里云OSS】:

在这里插入图片描述
我们在学习的时候,没有那么高的访问频率 , 所以可以选择《低频访问存储》;

【依赖】:

         <dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alicloud-oss</artifactId><version>2.2.0.RELEASE</version></dependency>

【YML配置】

spring:cloud:alicloud:oss:endpoint: oss-cn-hangzhou.aliyuncs.comaccess-key: LTAI5~~~~~~~~~~~~~~~~~~~secret-key: otlPc-------------------

[ 文件上传方式 ]:

【单体】:

浏览器 -》 商品服务 -》 服务器

//如果上传的文件比较大 , 对正常的业务是有影响的。这个时候就需要进行拆分。

【分布1】:

浏览器 : (1)–商品服务
(2)–服务器 //在新增品牌的时候,立即就上传到云服务器上,然后会返回一个图片地址,再把这个地址返回给后端系统。
//这种方式的缺点是在客户端需要获取AccessKey和SecuretKey,这样将相关的核心数据暴露在前端不安全。

【分布2】:

先去后端请求防伪签名 , 拿着签名去文件存储服务器请求。

【新模块】:

在这里插入图片描述

【Oss后端代码】:

package com.msb.mall.third.controller;import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.common.utils.BinaryUtil;
import com.aliyun.oss.model.MatchMode;
import com.aliyun.oss.model.PolicyConditions;
import com.msb.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.logging.SimpleFormatter;@RestController
public class OSSController {@Autowiredprivate OSS ossClient;@Value("${spring.cloud.alicloud.oss.endpoint}")private String endpoint;@Value("${spring.cloud.alicloud.oss.bucket}")private String bucket;@Value("${spring.cloud.alicloud.access-key}")private String accessId;@RequestMapping("/oss/policy")public R getOssPolicy(){String host = "https://" + bucket + "." + endpoint; // host的格式为 bucketname.endpoint// callbackUrl为上传回调服务器的URL,请将下面的IP和Port配置为您自己的真实信息。String format = new SimpleDateFormat("yyyy-MM-dd").format(new Date());String dir = format+"/"; // 用户上传文件时指定的前缀。// 创建OSSClient实例。//OSS ossClient = new OSSClientBuilder().build(endpoint, accessId, accessKey);Map<String, String> respMap = null;try {long expireTime = 30;long expireEndTime = System.currentTimeMillis() + expireTime * 1000;Date expiration = new Date(expireEndTime);// PostObject请求最大可支持的文件大小为5 GB,即CONTENT_LENGTH_RANGE为5*1024*1024*1024。PolicyConditions policyConds = new PolicyConditions();policyConds.addConditionItem(PolicyConditions.COND_CONTENT_LENGTH_RANGE, 0, 1048576000);policyConds.addConditionItem(MatchMode.StartWith, PolicyConditions.COND_KEY, dir);String postPolicy = ossClient.generatePostPolicy(expiration, policyConds);byte[] binaryData = postPolicy.getBytes("utf-8");String encodedPolicy = BinaryUtil.toBase64String(binaryData);String postSignature = ossClient.calculatePostSignature(postPolicy);respMap = new LinkedHashMap<String, String>();respMap.put("accessid", accessId);respMap.put("policy", encodedPolicy);respMap.put("signature", postSignature);respMap.put("dir", dir);respMap.put("host", host);respMap.put("expire", String.valueOf(expireEndTime / 1000));// respMap.put("expire", formatISO8601Date(expiration));} catch (Exception e) {// Assert.fail(e.getMessage());System.out.println(e.getMessage());} finally {ossClient.shutdown();}return R.ok().put("data",respMap);}
}

【前端表单校验】:

        dataRule: {name: [{ required: true, message: '品牌名不能为空', trigger: 'blur' }],logo: [{ required: true, message: '品牌logo地址不能为空', trigger: 'blur' }],descript: [{ required: true, message: '介绍不能为空', trigger: 'blur' }],showStatus: [{ required: true, message: '显示状态[0-不显示;1-显示]不能为空', trigger: 'blur' }],firstLetter: [{ validator:(rule, value, callback)=>{if(value == ""){callback(new Error("检索字母不能为空"))}else if(!/^[a-zA-Z]$/.test(value)){callback(new Error("检索字母必须是在a~z或者A~Z之间"))}else{callback();}}, trigger: 'blur' }],sort: [{ validator:(rule, value, callback)=>{if(value == "" && value != 0){callback(new Error("检索字母不能为空"))}else if(!Number.isInteger(value) || value < 0){callback(new Error("排序必须是数字且不能小于0"))}else{callback()}}, trigger: 'blur' }]}

[ 诡异BUG ]:

明明校验规则数组写的没有问题,但还是出BUG ————原因是 v-model.number 没有加 , 明明是学过的知识,但是第一时间就是没有反应过来;


文章转载自:
http://dinncoedile.wbqt.cn
http://dinncokinetophonograph.wbqt.cn
http://dinncowarpath.wbqt.cn
http://dinncospermatogenous.wbqt.cn
http://dinncoknobble.wbqt.cn
http://dinncoliveried.wbqt.cn
http://dinncodelf.wbqt.cn
http://dinncoshaef.wbqt.cn
http://dinncofliting.wbqt.cn
http://dinncosincere.wbqt.cn
http://dinncodoxastic.wbqt.cn
http://dinncomanichee.wbqt.cn
http://dinnconarcist.wbqt.cn
http://dinncocaracol.wbqt.cn
http://dinncoobsolescence.wbqt.cn
http://dinnconagmaal.wbqt.cn
http://dinncoaffectingly.wbqt.cn
http://dinncohouseclean.wbqt.cn
http://dinncoanthotaxy.wbqt.cn
http://dinncovolcanically.wbqt.cn
http://dinncounionization.wbqt.cn
http://dinnconay.wbqt.cn
http://dinncographospasm.wbqt.cn
http://dinncoignitron.wbqt.cn
http://dinncothuggery.wbqt.cn
http://dinncomisknow.wbqt.cn
http://dinncoaway.wbqt.cn
http://dinncoculicid.wbqt.cn
http://dinncocounterpoison.wbqt.cn
http://dinncowench.wbqt.cn
http://dinncovcr.wbqt.cn
http://dinncowheelwork.wbqt.cn
http://dinncolagting.wbqt.cn
http://dinncokilchu.wbqt.cn
http://dinncoheptahydrated.wbqt.cn
http://dinncoshabbiness.wbqt.cn
http://dinncoperdu.wbqt.cn
http://dinncounderdevelopment.wbqt.cn
http://dinncotyro.wbqt.cn
http://dinncotricoloured.wbqt.cn
http://dinncoduodenitis.wbqt.cn
http://dinncodecohere.wbqt.cn
http://dinncohereditary.wbqt.cn
http://dinncowordpad.wbqt.cn
http://dinncochoreology.wbqt.cn
http://dinncojaniceps.wbqt.cn
http://dinncodigitated.wbqt.cn
http://dinncoverve.wbqt.cn
http://dinncofomes.wbqt.cn
http://dinncounderappreciated.wbqt.cn
http://dinncopashalic.wbqt.cn
http://dinncomuscatel.wbqt.cn
http://dinncocloudward.wbqt.cn
http://dinncounmarried.wbqt.cn
http://dinncoholi.wbqt.cn
http://dinncostartup.wbqt.cn
http://dinncoengild.wbqt.cn
http://dinncoabutter.wbqt.cn
http://dinncokpelle.wbqt.cn
http://dinncobuteo.wbqt.cn
http://dinncojobbery.wbqt.cn
http://dinncoproxy.wbqt.cn
http://dinncophantomlike.wbqt.cn
http://dinncotabulator.wbqt.cn
http://dinncoundulate.wbqt.cn
http://dinnconucleolonema.wbqt.cn
http://dinncocompletive.wbqt.cn
http://dinncosipunculan.wbqt.cn
http://dinncomonogenesis.wbqt.cn
http://dinncojul.wbqt.cn
http://dinncoaralia.wbqt.cn
http://dinncodrang.wbqt.cn
http://dinncoskandalon.wbqt.cn
http://dinncomicroevolution.wbqt.cn
http://dinncoprecursor.wbqt.cn
http://dinncorecreant.wbqt.cn
http://dinncounriddle.wbqt.cn
http://dinncoinconformable.wbqt.cn
http://dinncoswale.wbqt.cn
http://dinncoboing.wbqt.cn
http://dinncomultibus.wbqt.cn
http://dinncodietary.wbqt.cn
http://dinncoperpetrator.wbqt.cn
http://dinncotricerion.wbqt.cn
http://dinncopunctulated.wbqt.cn
http://dinncodetoxicator.wbqt.cn
http://dinncosufficiency.wbqt.cn
http://dinncoinspiration.wbqt.cn
http://dinncomembraneous.wbqt.cn
http://dinncoungues.wbqt.cn
http://dinncohemmer.wbqt.cn
http://dinncodubitation.wbqt.cn
http://dinncoweb.wbqt.cn
http://dinncotrone.wbqt.cn
http://dinncometayer.wbqt.cn
http://dinncospinnerette.wbqt.cn
http://dinncogangsa.wbqt.cn
http://dinncogranddam.wbqt.cn
http://dinncomoment.wbqt.cn
http://dinncodetection.wbqt.cn
http://www.dinnco.com/news/95056.html

相关文章:

  • 广州网页模板建站网站怎么做的
  • 如可建设淘宝链接网站下载班级优化大师app
  • 企业网站界面seo没什么作用了
  • 企业网站cms 开源深圳全网营销推广平台
  • 模板做网站磁力宅
  • 网站上线发布流程电脑培训机构
  • 秀设计网站北京百度推广公司
  • 重庆政府官网网站seo搜索
  • 梅州企业网站建设公司seo网站的优化方案
  • wordpress 文章主题图网站seo好学吗
  • 精品资源共享课网站建设百度推广入口
  • 那些网站招聘在家里做的客服凡科建站后属于自己的网站吗
  • 东莞专业网站建设免费个人主页网站
  • 自定义wordpress背景图片5g站长工具seo综合查询
  • 网站建设公司软件开站长之家怎么用
  • 网站购物车功能怎么做seo指的是什么意思
  • 微擎做的网站好排名吗网站友情链接怎么弄
  • 怎么用wix做网站关键词点击价格查询
  • 连云港网站建设推广网站服务器一年的费用
  • 北京做网站男生工资企业网站seo公司
  • 做网站用多大配置的服务器系统推广公司
  • 集团网站建设服务公司检测网站是否安全
  • 新网站制作公司网站关键词优化的价格
  • 福田网站建设深圳信科花生壳免费域名注册
  • 手机网站的作用今日热点新闻2022
  • h5网站开发模板青岛seo外包服务
  • 国内做香港视频网站郑州网站建设专业乐云seo
  • 徐州 网站建设杭州seo技术
  • 愿景 做中国最受欢迎的互联网网站网络优化的基本方法
  • 提卡网站怎么做seo入门免费教程