【vue脚手架配置代理+github用户搜索案例+vue项目中常用的发送Ajax请求的库+slot插槽】

vue脚手架配置代理+github用户搜索案例+vue项目中常用的发送Ajax请求的库+slot插槽

  • 1 vue脚手架配置代理
  • 2 github用户搜索案例
    • 2.1 静态列表
    • 2.2 列表展示
    • 2.3 完善案例
  • 3 vue项目中常用的发送Ajax请求的库
    • 3.1 xhr
    • 3.2 jQuery
    • 3.3 axios
    • 3.4 fetch
    • 3.5 vue-resource
  • 4 slot 插槽
    • 4.1 效果
    • 4.2 理解

1 vue脚手架配置代理

  • 下载axios
    在这里插入图片描述
  • 引用axios:import axios from 'axios'
  • 解决跨域方法:
    1> cors:http://t.csdnimg.cn/VdMIT
    在这里插入图片描述
    2> jsonp:用的少,只能解决get请求的跨域问题
    3> 配置一个代理服务器
    在这里插入图片描述
  • 配置一个代理服务器方式一:
    开启8080代理服务器方式:nginx(较复杂,需借助后端知识) 、vue-cli(重点)。
    1> 第一步:先通过cmd打开两台服务器
    在这里插入图片描述
    打开结果如下图所示:
    在这里插入图片描述
    如忘记打开,终端将会出现GET http://localhost:8081/students 500 (Internal Server Error)错误。
    2> 第二步:在vue.config.js文件里面,加入此语句
    在这里插入图片描述
    3> 第三步:更改App.vue文件中的端口号
    在这里插入图片描述
    4> 第四步:点击按钮后,请求结果如下
    在这里插入图片描述
工作方式:若按照上述配置代理,当请求了前端不存在的资源时,那么该请求会转发给服务器 (优先匹配前端资源)
优点:配置简单,请求资源时直接发给前端(8080)即可。
缺点:1.不能配置多个代理
     2.不能灵活控制走不走代理
  • 配置一个代理服务器方式二:
    1> 第一步:依旧先通过cmd打开两台服务器
    2> 第二步:在vue.config.js文件里面,加入此语句
    在这里插入图片描述
    changeOrigin设置为true时,服务器收到的请求头中的host为:localhost:5000 changeOrigin设置为false时,服务器收到的请求头中的host为:localhost:8080 changeOrigin默认值为true
    3> 第三步:更新App.vue文件中的内容
    在这里插入图片描述
    4> 第四步:点击按钮后,请求结果如下
    在这里插入图片描述
优点:可以配置多个代理,且可以灵活的控制请求是否走代理。
缺点:配置略微繁琐,请求资源时必须加前缀。

2 github用户搜索案例

在这里插入图片描述

2.1 静态列表

  • 目录展示:
    在这里插入图片描述
  • App.vue:
    在这里插入图片描述
  • Search.vue:
    在这里插入图片描述
  • List.vue:
    在这里插入图片描述
  • index.html:
    在这里插入图片描述

2.2 列表展示

  • List组件和Search组件为兄弟组件,可使用全局事件总线、消息订阅与发布、把数据交给最外侧App等方式实现数据传递。
  • main.js:
    在这里插入图片描述
  • Search.vue:
<template>
    <section class="jumbotron">
        <h3 class="jumbotron-heading">Search Github Users</h3>
        <div>
            <input type="text" placeholder="enter the name you search" v-model="keyWord"/>&nbsp;
            <button @click="searchUsers">Search</button>
        </div>
    </section>
</template>

<script>
    // 引入axios
    import axios from 'axios'

    export default {
        name:'Search',
        data() {
            return {
                keyWord:''
            }
        },
        methods: {
            searchUsers() {
                // 模板字符串
                axios.get(`https://api.github.com/search/users?q=${this.keyWord}`).then(
                    response => {
                        console.log('请求成功了');
                        this.$bus.$emit('getUsers',response.data.items)
                    },
                    error => {
                        console.log('请求失败了',error.message);
                    }
                )
            }
        }
    }
</script>
  • List.vue:
<template>
    <div class="row">
        <div class="card" v-for="user in users" :key="user.login">
            <a :href="user.html_url" target="_blank">
                <img :src="user.avatar_url" style='width: 100px'/>
            </a>
            <p class="card-text">{{user.login}}</p>
        </div>
        
    </div>
</template>

<script>
    export default {
        name:'List',
        data() {
            return {
                users:[]
            }
        },
        // 利用全局事件总线
        mounted() {
            this.$bus.$on('getUsers',(users)=>{
                console.log('我是List组件,收到了数据:',users);
                this.users = users
            })
        }
    }
</script>

<style>
    .album {
        min-height: 50rem; /* Can be removed; just added for demo purposes */
        padding-top: 3rem;
        padding-bottom: 3rem;
        background-color: #f7f7f7;
    }   
    .card {
        float: left;
        width: 33.333%;
        padding: .75rem;
        margin-bottom: 2rem;
        border: 1px solid #efefef;
        text-align: center;
    }   
    .card > img {
        margin-bottom: .75rem;
        border-radius: 100px;
    }   
    .card-text {
        font-size: 85%;
    }
</style>
  • 效果展示(点击头像跳转到用户github主页):
    在这里插入图片描述

2.3 完善案例

  • 以上展示了请求成功时的呈现(users),还需对其它三种展示进行完善。
  • 1> 添加一个欢迎词(welcome)
  • 2> 当内容未加载出来时添加一个加载中(loading)
  • 3> 添加一个请求失败时的呈现(error)
  • List.vue:
<template>
    <div class="row">
        <!-- 展示用户列表 -->
        <div v-show="info.users.length" class="card" v-for="user in info.users" :key="user.login">
            <a :href="user.html_url" target="_blank">
                <img :src="user.avatar_url" style='width: 100px'/>
            </a>
            <p class="card-text">{{user.login}}</p>
        </div>
        <!-- 展示欢迎词 -->
        <h1 v-show="info.isFirst">欢迎使用!</h1>
        <!-- 展示加载中 -->
        <h1 v-show="info.isLoading">加载中....</h1>
        <!-- 展示错误信息 -->
        <h1 v-show="info.errMsg">{{info.errMsg}}</h1>
    </div>
</template>

<script>
    export default {
        name:'List',
        data() {
            return {
                info:{
                    isFirst:true, // 是否为初次展示
                    isLoading:false, // 是否处于加载中
                    errMsg:'', // 存储错误信息
                    users:[]
                }
            }
        },
        // 利用全局事件总线
        mounted() {
            // this.$bus.$on('updateListData',(isFirst,isLoading,errMsg,users)=>{
            this.$bus.$on('updateListData',(dataObj)=>{
                // console.log('我是List组件,收到了数据:',users);
                /* this.isFirst = isFirst
                this.isLoading = isLoading
                this.errMsg = errMsg
                this.users = users */
                // this.info = dataObj // 此写法没错 但由于isFirst后续不再变化没有书写 会弄丢isFirst数据
                // 因此通过字面量的形式去合并对象
                this.info = {...this.info,...dataObj}
            })
        }
    }
</script>

<style>
    .album {
        min-height: 50rem; /* Can be removed; just added for demo purposes */
        padding-top: 3rem;
        padding-bottom: 3rem;
        background-color: #f7f7f7;
    }   
    .card {
        float: left;
        width: 33.333%;
        padding: .75rem;
        margin-bottom: 2rem;
        border: 1px solid #efefef;
        text-align: center;
    }   
    .card > img {
        margin-bottom: .75rem;
        border-radius: 100px;
    }   
    .card-text {
        font-size: 85%;
    }
</style>
  • Search.vue:
<template>
    <section class="jumbotron">
        <h3 class="jumbotron-heading">Search Github Users</h3>
        <div>
            <input type="text" placeholder="enter the name you search" v-model="keyWord"/>&nbsp;
            <button @click="searchUsers">Search</button>
        </div>
    </section>
</template>

<script>
    // 引入axios
    import axios from 'axios'

    export default {
        name:'Search',
        data() {
            return {
                keyWord:''
            }
        },
        methods: {
            searchUsers() {
                // 请求前先更新List的数据
                this.$bus.$emit('updateListData',{isFirst:false,isLoading:true,errMsg:'',users:[]}) 
                // 发送请求
                // 模板字符串
                axios.get(`https://api.github.com/search/users?q=${this.keyWord}`).then(
                    response => {
                        console.log('请求成功了');
                        // this.$bus.$emit('getUsers',response.data.items)
                        // 请求成功后更新List的数据
                        // 因为isFirst后续不再发生变化 故可删掉
                        this.$bus.$emit('updateListData',{isLoading:false,errMsg:'',users:response.data.items})
                    },
                    error => {
                        console.log('请求失败了',error.message);
                        // 请求失败后更新List的数据
                        this.$bus.$emit('updateListData',{isLoading:false,errMsg:error.message,users:[]})
                    }
                )
            }
        }
    }
</script>
  • 效果展示:
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

3 vue项目中常用的发送Ajax请求的库

3.1 xhr

3.2 jQuery

3.3 axios

  • 通用的 Ajax 请求库, 官方推荐,使用广泛。

3.4 fetch

3.5 vue-resource

  • vue插件库, vue1.x 使用广泛,官方已不维护。
  • 安装:npm i vue-resource
  • 引入与使用:
    在这里插入图片描述
  • github用户搜索案例的Search.vue组件需改为:
    在这里插入图片描述

4 slot 插槽

4.1 效果

在这里插入图片描述
App.vue:

<template>
  <div class="container">
    <Category title="美食" :listData="foods"/>
    <Category title="游戏" :listData="games"/>
    <Category title="电影" :listData="films"/>
  </div>
</template>

<script>
  import Category from './components/Category.vue'
  
  export default {
    name:'App',
    components:{Category},
    data() {
      return {
        foods:['火锅','烧烤','小龙虾','牛排'],
        games:['红色警戒','穿越火线','劲舞团','超级玛丽'],
        films:['《教父》','《拆弹专家》','《你好,李焕英》','《米奇妙妙屋》']
      }
    }
  }
</script>

<style lang="css">
  .container {
    display: flex;
    justify-content: space-around;
  }
</style>

Category.vue:

<template>
    <div class="category">
        <h3>{{title}}分类</h3>
        <ul>
            <li v-for="(item,index) in listData" :key="index">{{item}}</li>
        </ul>
    </div>
</template>

<script>
    export default {
        name:'Category',
        props:['listData','title']
    }
</script>

<style>
    .category {
        background-color: skyblue;
        width: 200px;
        height: 300px;
    }
    h3 {
        text-align: center;
        background-color: orange;
    }
</style>

在这里插入图片描述
App.vue:

<template>
  <div class="container">
    <Category title="美食">
      <img src="https://s3.ax1x.com/2021/01/16/srJlq0.jpg" alt="">
    </Category>

    <Category title="游戏">
      <ul>
        <li v-for="(g,index) in games" :key="index">{{g}}</li>
      </ul>
    </Category>

    <Category title="电影">
      <video controls src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"></video>
    </Category>
  </div>
</template>

<script>
  import Category from './components/Category.vue'
  
  export default {
    name:'App',
    components:{Category},
    data() {
      return {
        foods:['火锅','烧烤','小龙虾','牛排'],
        games:['红色警戒','穿越火线','劲舞团','超级玛丽'],
        films:['《教父》','《拆弹专家》','《你好,李焕英》','《米奇妙妙屋》']
      }
    },
  }
</script>

<style scoped>
  .container {
    display: flex;
    justify-content: space-around;
  }
  img {
    width: 100%;
  }
  video {
    width: 100%;
  }
</style>

Category.vue:

<template>
    <div class="category">
        <h3>{{title}}分类</h3>
        <!-- 定义一个插槽(挖个坑,等着组件的使用者进行填充) -->
        <slot>我是一些默认值,当使用者没有传递具体结构时,我会出现</slot>
        
    </div>
</template>

<script>
    export default {
        name:'Category',
        props:['title']
    }
</script>

<style>
    .category {
        background-color: skyblue;
        width: 200px;
        height: 300px;
    }
    h3 {
        text-align: center;
        background-color: orange;
    }
</style>

在这里插入图片描述
App.vue:

<template>
  <div class="container">
    <Category title="美食">
      <img slot="center" src="https://s3.ax1x.com/2021/01/16/srJlq0.jpg" alt="">
      <a slot="footer" href="https://home.meishichina.com/recipe.html">更多美食</a>
    </Category>

    <Category title="游戏">
      <ul slot="center">
        <li v-for="(g,index) in games" :key="index">{{g}}</li>
      </ul>
      <div class="foot" slot="footer">
        <a href="https://www.baidu.com/">单机游戏</a>
        <a href="https://www.baidu.com/">网络游戏</a>
      </div>
    </Category>

    <Category title="电影">
      <video slot="center" controls src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"></video>
      <!-- 写法一 -->
      <!-- <template slot="footer"> -->
      <!-- 写法二 -->
      <template v-slot:footer>
        <div class="foot">
          <a href="https://www.baidu.com/">经典</a>
          <a href="https://www.baidu.com/">热门</a>
          <a href="https://www.baidu.com/">推荐</a>
        </div>
        <h4>欢迎前来观影!</h4>
      </template>
    </Category>
  </div>
</template>

<script>
  import Category from './components/Category.vue'
  
  export default {
    name:'App',
    components:{Category},
    data() {
      return {
        foods:['火锅','烧烤','小龙虾','牛排'],
        games:['红色警戒','穿越火线','劲舞团','超级玛丽'],
        films:['《教父》','《拆弹专家》','《你好,李焕英》','《米奇妙妙屋》']
      }
    },
  }
</script>

<style scoped>
  .container,.foot {
    display: flex;
    justify-content: space-around;
  }
  img {
    width: 100%;
  }
  video {
    width: 100%;
  }
  h4 {
    text-align: center;
  }
  a {
    display: block;
    text-align: center;
  }
</style>

Category.vue:

<template>
    <div class="category">
        <h3>{{title}}分类</h3>
        <!-- 定义一个插槽(挖个坑,等着组件的使用者进行填充) -->
        <slot name="center">我是一些默认值,当使用者没有传递具体结构时,我会出现1</slot>
        <slot name="footer">我是一些默认值,当使用者没有传递具体结构时,我会出现2</slot>
    </div>
</template>

<script>
    export default {
        name:'Category',
        props:['title']
    }
</script>

<style>
    .category {
        background-color: skyblue;
        width: 200px;
        height: 300px;
    }
    h3 {
        text-align: center;
        background-color: orange;
    }
</style>

在这里插入图片描述
App.vue:

<template>
  <div class="container">
    <Category title="游戏">
      <template scope="atguigu">
        <ul>
          <li v-for="(g,index) in atguigu.games" :key="index">{{g}}</li>
        </ul>
      </template>
    </Category>
      
    <Category title="游戏">
      <!-- <template scope="atguigu">
        <ol>
          <li v-for="(g,index) in atguigu.games" :key="index">{{g}}</li>
        </ol>
      </template> -->
      <!-- 解构赋值写法 -->
      <template scope="{games}">
        <ol>
          <li v-for="(g,index) in games" :key="index">{{g}}</li>
        </ol>
      </template>
    </Category>

    <Category title="游戏">
      <!-- <template scope="atguigu"> -->
      <template slot-scope="{games}">
        <h4 v-for="(g,index) in games" :key="index">{{g}}</h4>
      </template>
    </Category>
  </div>
</template>

<script>
  import Category from './components/Category.vue'
  
  export default {
    name:'App',
    components:{Category},
    
  }
</script>

<style scoped>
  .container,.foot {
    display: flex;
    justify-content: space-around;
  }
  img {
    width: 100%;
  }
  video {
    width: 100%;
  }
  h4 {
    text-align: center;
  }
  a {
    display: block;
    text-align: center;
  }
</style>

Category.vue:

<template>
    <div class="category">
        <h3>{{title}}分类</h3>
        <slot :games="games">我是默认的一些内容</slot>
    </div>
</template>

<script>
    export default {
        name:'Category',
        props:['title'],
        data() {
            return {
                games:['红色警戒','穿越火线','劲舞团','超级玛丽'],
            }
        },
    }
</script>

<style>
    .category {
        background-color: skyblue;
        width: 200px;
        height: 300px;
    }
    h3 {
        text-align: center;
        background-color: orange;
    }
</style>

4.2 理解

  • 父组件向子组件传递带数据的标签,当一个组件有不确定的结构时, 就需要使用slot 技术,注意:插槽内容是在父组件中编译后,再传递给子组件的。
  • 作用:让父组件可以向子组件指定位置插入html结构,也是一种组件间通信的方式,适用于父组件 ——> 子组件
  • 分类:默认插槽、具名插槽、作用域插槽
  • 使用方式:
    1> 默认插槽:
    在这里插入图片描述
    2> 具名插槽:
    在这里插入图片描述
    3> 作用域插槽:数据在组件的自身,但根据数据生成的结构需要组件的使用者来决定。(games数据在Category组件中,但使用数据所遍历出来的结构由App组件决定)
    在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/199586.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

windows11 phpstudy_pro php8.2 安装redis扩展

环境&#xff1a;windows11 phpstudy_pro php8.2.9 一、命令查看是否安装redis扩展 在对应网站中通过打开&#xff0c;&#xff0c;选择对应的PHP版本&#xff0c;用命令 php -m 查看自己的php 有没有redis扩展 上面如果有&#xff0c;说明已经安装了,如果没有安装&#xff1…

Python加百度语音API实现文字转语音功能

目录 一、引言 二、百度语音API介绍 三、Python实现文字转语音功能 1、安装相关库和工具 2、准备待合成的文字信息 3、调用百度语音API进行合成 四、实验结果与讨论 五、优化与改进 六、结论 一、引言 随着人工智能技术的不断发展&#xff0c;语音合成技术也越来越成…

VT-MSPA1-12-1X/V0直动式比例压力阀放大器

适用于控制不带电位移反馈的比例压力阀、比例流量阀、比例方向阀的控制;差动输入;1个脉冲输出端口;函数发生器;带斜坡时间可调的斜坡生器&#xff08;可上升和下降斜坡&#xff09;; 可调电流调节器;电源带错极保护;LED 电磁铁动作显示;&#xff08;LED 的亮度与流过电磁铁的电…

Python 分解IP段获取所有IP(子网掩码)

需求 192.168.1.0/24,192.168.2.1-192.168.2.254,192.168.3.3 IP段格式已 "," 分割&#xff0c;获取所有IP 注意 1. 判断 IP 是否合规 2. 去除多余的字符&#xff0c;例如空格、换行符 3. 去重 代码 import re import ipaddressdef isIP(ip):p re.compile(^((…

网络运维与网络安全 学习笔记2023.11.28

网络运维与网络安全 学习笔记 第二十九天 今日目标 OSPF汇总之域间路由、OSPF汇总之外部路由、OSPF链路认证 OSPF安全认证之区域认证、OSPF虚链路 OSPF汇总指域间路由 项目背景 企业内网运行多区域的OSPF网络&#xff0c;在R1 上存在多个不稳定的链路 R1上的不稳定链路&a…

4.Spring源码解析-loadBeanDefinitions(XmlBeanDefinitionReader)

第一个点进去 发现是空 肯定走的第二个逻辑了 这里在这里已经给属性设置了值&#xff0c;所以肯定不是空能拿到。 1.ClassPathXmlApplicationContext 总结&#xff1a;该loadBeanDefinitions是XmlBeanDefinitionReader设置xml文件在哪。

Linux 磁盘挂载

一、查看挂载点 df -h 二、查看磁盘信息 fdisk -l 下面红色的这一块就是未分区的磁盘 三、 进行磁盘分区 fdisk /dev/sdb /dev/sdb &#xff1a;是上面fdisk -l查询出来未分区的磁盘地址 根据提示输入m获取命令 四、执行命令&#xff0c;创建一个分区 1、新建分区&#…

代码随想录算法训练营 ---第四十九天

前言&#xff1a; 今天是买卖股票的最佳时机系列&#xff0c;本系列之前在学习贪心思想时做过一些。 第一题&#xff1a; 简介&#xff1a; 本题在读题时我们要注意到几个细节 1.本题股票买卖只有一次。2.我们要在最低点买股票&#xff0c;在最高点卖股票。 我的思路&#…

不小心删除了短信,如何在 Android 上恢复已删除的短信

不小心删除了文字消息在 Android 手机上使用可能会是一种令人痛苦的体验。这些消息可能包含有价值的信息、珍贵的回忆或重要的细节。幸运的是&#xff0c;您可以探索多种方法来恢复这些丢失的消息。在本文中&#xff0c;我们将深入研究可用于检索已删除短信的选项&#xff0c;并…

同质化严重,创新突破难,德佑湿厕纸道阻且长

撰稿|行星 来源|贝多财经 随着大众卫生健康意识的日益加深&#xff0c;作为日常生活必需品的纸类产品也逐步向着精细化、多元化的趋势发展&#xff0c;厨房用纸、婴儿用纸等面向各类特定场景和人群的新品类如雨后春笋般涌出&#xff0c;为市场带来了更多的可能性。 在传统卫…

linux(2)之buildroot使用手册

Linux(2)之buildroot配置toolchain Author&#xff1a;Onceday Date&#xff1a;2023年11月27日 漫漫长路&#xff0c;才刚刚开始… 参考文档&#xff1a; Buildroot - Making Embedded Linux Easy 文章目录 Linux(2)之buildroot配置toolchain1. 构建配置1.1 配置config生成…

探索Python内置类属性__repr__:展示对象的魅力与实用性

概要 在Python中&#xff0c;每个对象都有一个内置的__repr__属性&#xff0c;它提供了对象的字符串表示形式。这个特殊的属性在调试、日志记录和交互式会话等场景中非常有用。本文将详细介绍__repr__属性的使用教程&#xff0c;包括定义、常见应用场景和注意事项&#xff0c;…

深入剖析 Django 与 Flask 的选择之谜

概要 在现代 Web 开发的世界里&#xff0c;Python 作为一门极具灵活性和易用性的编程语言&#xff0c;催生了多个强大的 Web 框架&#xff0c;其中 Django 和 Flask 是最受欢迎的两个。但对于开发者来说&#xff0c;选择哪一个始终是一个令人费解的难题。本文将详细地对比这两…

c++|类与对象(中)

目录 一、类的6个默认成员函数 二、构造函数 2.1概念 2.2七大特性 三、析构函数 3.1概念 3.2特性 四、拷贝构造函数 4.1概念 4.2特性 五、赋值运算符重载 5.1运算符重载 5.2赋值运算符重载 5.3前置和后置重载 六、const成员函数 七、取地址及const取地址操作符重…

如何在Python中操作Redis数据库

目录 一、安装redis-py库 二、连接Redis数据库 三、执行操作 1、设置和获取键值对 2、删除键值对 3、获取列表数据 四、处理数据 1、使用哈希表&#xff08;Hash&#xff09;处理关联数据 2、使用列表&#xff08;List&#xff09;处理有序数据 3、使用集合&#xff…

GoLong的学习之路,进阶,RabbitMQ (消息队列)

快有一周没有写博客了。前面几天正在做项目。正好&#xff0c;项目中需要MQ&#xff08;消息队列&#xff09;&#xff0c;这里我就补充一下我对mq的理解。其实在学习java中的时候&#xff0c;自己也仿照RabbitMQ自己实现了一个单机的mq&#xff0c;但是mq其中一个特点也就是&a…

面试题:MySQL自增主键为什么不是连续的?

文章目录 前言一、自增值存储说明二、自增值修改机制三、 自增值修改时机四、 导致自增值不连续的原因4.1 唯一键冲突4.2 事务回滚4.3 批量写库操作 前言 提出这个问题&#xff0c;是因为在工作中发现 mysql 中的 user 表的 id 默认是自增的&#xff0c;但是数据库存储的结果却…

RFC4493——AES-CMAC

文章目录 Abstract1 Introduction2 Specification of AES-CMAC2.1 Basic Definitions2.2 Overview2.3 Subkey Generation Algorithm2.4 MAC Generation Algorithm2.5 MAC Verification Algorithm 3 Security Considerations4 Test Vectors5 测试代码5.1 C语言版本5.2 Python语言…

逻辑漏洞 暴力破解(DVWA靶场)与验证码安全 (pikachu靶场) 全网最详解包含代码审计

逻辑漏洞 暴力破解(DVWA靶场)与验证码安全 (pikachu靶场) 全网最详解包含代码审计 0x01 前言 在当今互联网的广袤世界中&#xff0c;各式交互平台层出不穷。每一个交互平台几乎都要求用户注册账号&#xff0c;而这些账号则成为我们在数字世界中的身份象征。账号的安全性变得至…

Unity中Shader的BRDF解析(四)

文章目录 前言一、BRDF 中的 IBL二、解析一下其中的参数1、光照衰减系数 &#xff1a;surfaceReduction2、GI镜面反射在不同角度下的强弱 &#xff1a;gi.specular * FresnelLerp (specColor, grazingTerm, nv);在BRDF中&#xff0c;IBL&#xff08;Image Based Light&#xff…