当前位置:网站首页>uni-app进阶之认证【day12】
uni-app进阶之认证【day12】
2022-07-31 05:10:00 【黎燃(主号)】
uni-app进阶之认证
通信方通过使用证书进行身份验证。
Ca(证书颁发机构)是客户端和服务器都可以信任的第三方组织。服务器的操作员向CA申请公钥。CA确定申请人身份后,将对应用的公钥进行数字签名,分发签名的公钥,并将公钥放入公钥证书后绑定在一起。在HTTPS通信期间,服务器将向客户端发送证书。客户端获得公钥后,首先使用数字签名进行验证。如果验证通过,则可以开始通信。
过滤器如下:
Vue.filter("formatDate",(data)=>{
const nDate=new Date(data);
const year = nDate.getFullYear();
const month = nDate.getMonth()+1;
const day = nDate.getDay();
return year +'-'+ month +'-'+ day
})
完整性保护
SSL为完整性保护提供消息摘要功能。HTTP还提供MD5消息摘要功能,但不安全。例如,如果消息内容被篡改,同时重新计算MD5值,则通信接收方不知道该篡改。
HTTPS的消息摘要功能是安全的,因为它结合了加密和身份验证。想象一下,在加密的消息被篡改后,很难重新计算消息摘要,因为无法轻松获取明文。
"privacy": {
"prompt": "template",
"template": {
"title": "服务协议和隐私政策",
"message": " 请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href="">《服务协议》</a>和<a href="">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept": "我知道了",
"buttonRefuse": "暂不同意"
}
}
脚本数据中定义的JS变量可以在组件中使用,但组件属性中的用法与内容区域中的用法不同。
<component-name property1="value" property2="value">
content
</component-name>
如果长列表中的每个项目都不会单独更新,那么我们就不需要将每个项目都变成一个组件。我们可以直接循环长列表以显示项目。
// index.vue 循环加载长列表
<template>
<view>
<view class="thumb" v-for="item in testdata">
<ThumbItem :item='item'></ThumbItem>
</view>
</view>
</template>
<script>
Import ThumbItem from "components/thumbitem/thumbitem.vue"
export default {
components: {
ThumbItem
},
data() {
return {
testdata: ["评价1","评价2","评价3","评价4","评价5"]
}
}
}
</script>
<style>
.thumb{
text-align: center;
margin-top: 20px;
}
</style>
组件在页面初始化期间会占用更多内存,遍历节点的速度会更慢。渲染时,每个组件都会触发通信,过多的组件会阻止通信。所以我们应该使用刀刃上的好刀。如果我们在任何情况下都使用它,就会适得其反。深节点的嵌套是相同的。开发时应注意避免深节点嵌套。
在实际的项目开发中,长列表通常经过逻辑层处理后返回。数据是可变的。如果长列表中的数据需要显示在页面上,我们将在数据中定义长列表。如果变量不需要显示在视图中,我们会尝试在数据之外设置变量。
边栏推荐
- pytorch中的一维、二维、三维卷积操作
- 基于web3.0使用钱包Metamask的三方登陆
- 快速掌握并发编程 --- 基础篇
- a different object with the same identifier value was already associated with the session
- 剑指offer基础版 ----- 第28天
- 面试官:生成订单30分钟未支付,则自动取消,该怎么实现?
- Kubernetes加入集群的TOKEN值过期
- 踏上编程之路,你必须要干的几件事
- 1D, 2D, 3D convolution operations in pytorch
- Interview Redis High Reliability | Master-Slave Mode, Sentinel Mode, Cluster Cluster Mode
猜你喜欢

Sword Point Offer Special Assault Edition ---- Day 1

剑指offer专项突击版 --- 第 3 天

docker安装postgresSQL和设置自定义数据目录

Interview Redis High Reliability | Master-Slave Mode, Sentinel Mode, Cluster Cluster Mode

关于小白安装nodejs遇到的问题(npm WARN config global `--global`, `--local` are deprecated. Use `--location=glob)

限流的原理

C语言文件读、写、定位函数

剑指offer基础版 --- 第22天

Refinement of the four major collection frameworks: Summary of List core knowledge

Interviewer: If the order is not paid within 30 minutes, it will be automatically canceled. How to do this?
随机推荐
Minio upload file ssl certificate is not trusted
Sword Point Offer Special Assault Edition ---- Day 1
datagrip带参sql查询
三子棋讲解(C语言)
实验8 DNS解析
TOGAF之架构标准规范(一)
The TOKEN value of Kubernetes joining the cluster expires
Data set partitioning and cross-validation
The interviewer asked me how to divide the database and the table?Fortunately, I summed up a set of eight-part essays
数据集划分以及交叉验证法
Element concatenation operations in numpy and pytorch: stack, concatenat, cat
Swordsman Offer Special Assault Edition --- Day 3
Redis first meeting
[Introduction to MySQL 8 to Mastery] Basics - silent installation of MySQL on Linux system, cross-version upgrade
The interviewer asked me TCP three handshake and four wave, I really
MySQL8.0.26安装配置教程(windows 64位)
数据库上机实验3 连接查询和分组查询
110 MySQL interview questions and answers (continuously updated)
踏上编程之路,你必须要干的几件事
【MySQL8入门到精通】基础篇- Linux系统静默安装MySQL,跨版本升级