b站黑马的Vue快速入门案例代码——【axios+Vue2】悦听player(音乐播放器)

news2024/9/23 7:23:08

目录

本文中修改的原代码中的BUG:

修改方法:

本文案例代码仍有的BUG:(欢迎大家献计献策)

目标效果:

悦音player案例——效果展示视频:

更换的新接口/参数:

1.歌曲搜索接口:https://autumnfish.cn/cloudsearch

2.mv地址获取接口中:修改请求参数的mvid为mv

重点原理:

(1)Vue中 @play是绑定音频/视频播放事件

(2)Vue中 @pause是绑定音频/视频暂停事件 

(on)play事件——音频/视频(audio/video)开始播放时触发

(on)pause事件——音频/视频(audio/video)暂停播放时触发

(3)v-bind——设置元素的属性(比如:src,title,class) 

代码部分:

1.main.js(全是重点)

2.悦音player.html(部分重点,用{{}}渲染结构,传递参数,查看结构)

3.index.css(辅助作用)

4.vue.js(辅助作用)

安装Vue的方法 /获取vue.js文件的方法: 

5.axios.min.js(辅助作用)

(1)可以用axios在线网址【要连网】:

(2)也可以下载axios.min.js本地文件:


本文中修改的原代码中的BUG:

原代码的BUG:如果退出MV遮罩层之前,不暂停MV的播放。则退出MV之后,依然会有MV中的声音继续播放。

修改方法:

 在main.js中的methods中的隐藏MV部分:

//7.隐藏MV

    hide: function () {

      //先设置mvUrl为空,停止音乐播放

      this.mvUrl = "";

      this.isShow = false;//隐藏遮罩层

    }

本文案例代码仍有的BUG:(欢迎大家献计献策)

如果在不暂停音乐播放的情况下,点击MV的播放按钮,会出现MV视频中的音乐和mp3格式的音乐一起播放。

目标效果:

1.【搜索音乐】在右上角的搜索框里面输入想搜索的音乐的信息(e.g.歌曲名称/歌手姓名...),按Enter回车键,在下面页面的左边就会出现对应的音乐

2.【播放音乐+获取歌曲封面图+获取歌曲评论+歌曲播放/暂停】点击对应的音乐前面的播放图标,即可播放该音乐。播放该音乐时,黑胶圆圈开始滚动,播放不同歌曲,圆圈里面的图片也不同。右边会出现热门评论。

3.如果该音乐右边有MV播放图标,可用点击该图标,播放MV

4.播放MV的时候如果想要退出,点击MV页面边上的黑色区域,即可退出

e.g.1初始状态:

 e.g.2在初始状态基础上,搜索框输入:周杰伦

按Enter回车键:

e.g.3在e.g.2基础上,点《布拉格广场》这首歌前面的播放按钮:

点下面的播放条的||,即可暂停该音乐:

e.g.4在e.g.3基础上,点《布拉格广场》这首歌后面的MV播放按钮:

点MV边上的黑色区域:

即可退出MV:

悦音player案例——效果展示视频:

b站黑马Vue快速入门案例——悦听player

更换的新接口/参数:

1.歌曲搜索接口:https://autumnfish.cn/cloudsearch

之前的音乐搜索接口已经失效了 

2.mv地址获取接口中:修改请求参数的mvid为mv

之前的MV地址接口:

mv地址获取

    请求地址:https://autumnfish.cn/mv/url

    请求方法:get

    请求参数:id(mvidmv,为0表示没有mv)!!!需要修改此处mvid为mv

    响应内容:mv的地址

重点原理:

(1)Vue中 @play是绑定音频/视频播放事件

 (2)Vue中 @pause是绑定音频/视频暂停事件 

(on)play事件——音频/视频(audio/video)开始播放时触发

(on)pause事件——音频/视频(audio/video)暂停播放时触发

(3)v-bind——设置元素的属性(比如:src,title,class) 

语法   v-bind:属性名=表达式

简写【实际开发常用】   :属性名=表达式

e.g.用v-bind的简写,添加class类名active

【实际开发常用】【用对象的方式添加class类名】

  :class={active:isActive}【!!!有“”】

【active类名是否添加,取决于此时isActive是true还是false】

代码部分:

1.main.js(全是重点)

/*
  1:歌曲搜索接口[搜索音乐]
    之前的请求地址【已经失效了】:https://autumnfish.cn/search  
    最新请求地址:https://autumnfish.cn/cloudsearch 
    请求方法:get
    请求参数:keywords(查询关键字)
    响应内容:歌曲搜索结果
  2:歌曲url获取接口[播放音乐]
    请求地址:https://autumnfish.cn/song/url
    请求方法:get
    请求参数:id(歌曲id)
    响应内容:歌曲url地址
  3.歌曲详情获取[获取歌曲封面图]
    请求地址:https://autumnfish.cn/song/detail
    请求方法:get
    请求参数:ids(歌曲id)
    响应内容:歌曲详情(包括封面信息)
  4.热门评论获取
    请求地址:https://autumnfish.cn/comment/hot?type=0
    请求方法:get
    请求参数:id(歌曲id,地址中的type固定为0)
    响应内容:歌曲的热门评论
  5.mv地址获取
    请求地址:https://autumnfish.cn/mv/url
    请求方法:get
    请求参数:id(mv,为0表示没有mv)
    响应内容:mv的地址
*/
var app = new Vue({
  el: "#player",
  data: {
    //查询关键字
    query: "",
    //musicList数组,用于存放音乐信息
    musicList: [],
    //存放歌曲的url地址
    musicUrl: "",
    //存放歌曲封面图片的url地址
    musicCover: "",
    //hotComments数组,用于存放歌曲评论相关的数组
    hotComments: [],
    //动画播放状态(默认不播放false)
    isPlaying: false,
    //遮罩层的显示状态(默认不显示false)
    isShow: false,
    //mv地址
    mvUrl: ""
  },
  methods: {
    //1.搜索音乐
    searchMusic: function () {
      // 因为this会变,所以用that存储此时的this,此时的this指当前对象#player
      var that = this;
      axios.get("https://autumnfish.cn/cloudsearch?keywords=" + this.query)
        .then(
          //(1)请求成功
          function (response) {
            //将返回的音乐信息数组,赋值给musicList数组
            that.musicList = response.data.result.songs;
          },
          //(2)请求失败
          function (err) { })
    },
    //2.播放音乐
    playMusic: function (musicId) {//形参musicId接收 @click="playMusic(item.id)"传过来的item.id
      // console.log(musicId);
      // 因为this会变,所以用that存储此时的this,此时的this指当前对象#player
      var that = this;
      axios.get("https://autumnfish.cn/song/url?id=" + musicId)
        .then(
          //(1)请求成功
          function (response) {
            //将response.data.data[0].url获得的音乐的url,赋值给musicUrl
            that.musicUrl = response.data.data[0].url;
          },
          //(2)请求失败
          function (err) { })
      //3.获取歌曲封面图
      axios.get("https://autumnfish.cn/song/detail?ids=" + musicId)
        .then(
          //(1)请求成功
          function (response) {
            // 将response.data.songs[0].al.picUrl获得的音乐封面图片的url,赋值给musicCover
            that.musicCover = response.data.songs[0].al.picUrl;
          },
          //(2)请求失败
          function (err) { })
      //4.获取歌曲评论
      axios.get("https://autumnfish.cn/comment/hot?type=0&id=" + musicId)
        .then(
          //(1)请求成功
          function (response) {
            // 将response.data.hotComments获得的歌曲评论相关的数组,赋值给hotComments数组
            that.hotComments = response.data.hotComments;
          },
          //(2)请求失败
          function (err) { })
    },
    //5.歌曲播放时的动画
    //(1)歌曲播放
    play: function () {
      this.isPlaying = true;
    },
    //(2)歌曲暂停
    pause: function () {
      this.isPlaying = false;
    },
    //6.播放mv
    playMV: function (vid) {//形参vid接收 @click="playMV(item.mv)"中的每个mv对应的id item.mv
      // 因为this会变,所以用that存储此时的this,此时的this指当前对象#player
      var that = this;
      axios.get("https://autumnfish.cn/mv/url?id=" + vid)
        .then(
          //(1)请求成功
          function (response) {
            // console.log(vid);
            that.isShow = true;//显示遮罩层
            //将返回的每个mv对应的url,赋值给mvUrl
            that.mvUrl = response.data.data.url;
          },
          //(2)请求失败
          function (err) { })
    },
    //7.隐藏MV
    hide: function () {
      //先设置mvUrl为空,停止音乐播放
      this.mvUrl = "";
      this.isShow = false;//隐藏遮罩层
    }
  }
})

2.悦音player.html(部分重点,用{{}}渲染结构,传递参数,查看结构)

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  <title>悦听player</title>
  <!-- 样式 -->
  <link rel="stylesheet" href="./css/index.css">
</head>

<body>
  <div class="wrap">
    <!-- 播放器主体区域 -->
    <div class="play_wrap" id="player">
      <div class="search_bar">
        <img src="images/player_title.png" alt="" />
        <!-- 搜索歌曲 -->
        <!-- v-model="query"将搜索文本框和query数据双向绑定 -->
        <!-- @keyup.enter="searchMusic"当键盘Enter回车键弹起,调用searchMusic事件 -->
        <input type="text" autocomplete="off" v-model="query" @keyup.enter="searchMusic" />
      </div>
      <div class="center_con">
        <!-- 搜索歌曲列表 -->
        <div class='song_wrapper'>
          <ul class="song_list">
            <!-- v-for="item in musicList"指遍历 音乐信息列表musicList数组里的每一个数据item -->
            <li v-for="item in musicList">
              <!-- @click="playMusic(item.id)"指 点击播放按钮,调用playMusic方法,并传递每个音乐信息item的id -->
              <a href="javascript:;" @click="playMusic(item.id)"></a>
              <!-- {{item.name}}中是 音乐信息中的音乐名称 -->
              <b>{{item.name}}</b>
              <!-- mv播放按键 -->
              <!-- v-if="item.mv!=0"指 当音乐信息列表musicList数组里的每一个数据item中,mv!=0时,mv播放按键显示  -->
              <!-- @click="playMV(item.mv)"指 当点击mv播放按键时,调用playMV方法,并传入每个mv对应的id item.mv -->
              <span v-if="item.mv!=0" @click="playMV(item.mv)"><i></i></span>
            </li>
          </ul>
          <img src="images/line.png" class="switch_btn" alt="">
        </div>
        <!-- 歌曲黑胶部分容器 -->
        <!-- :class="{playing:isPlaying}"指 用v-bind的简写,给黑胶部分容器div加类名playing -->
        <!-- 且类名playing是否添加,取决于isPlaying的值是true还是false-->
        <div class="player_con" :class="{playing:isPlaying}">
          <img src="images/player_bar.png" class="play_bar" />
          <!-- 黑胶碟片 -->
          <img src="images/disc.png" class="disc autoRotate" />
          <!-- 歌曲的封面图片 -->
          <!-- :src="musicCover"指 给装音乐封面图的img标签添加src属性,调用musicCover中的音乐封面图的url -->
          <img :src="musicCover" class="cover autoRotate" />
        </div>
        <!-- 评论容器 -->
        <div class="comment_wrapper">
          <h5 class='title'>热门留言</h5>
          <div class='comment_list'>
            <!-- v-for="item in hotComments"指 遍历存放存放歌曲评论相关的数组hotComments中的每一项item -->
            <dl v-for="item in hotComments">
              <!-- 用户头像 -->
              <!-- :src="item.user.avatarUrl"指 给给装用户头像图的img标签添加src属性,调用音乐信息列表musicList数组里的每一个数据item中用户头像的url -->
              <dt><img :src="item.user.avatarUrl" alt=""></dt>
              <!-- 用户昵称 -->
              <!-- {{item.user.nickname}}中是 用户昵称 -->
              <dd class="name">{{item.user.nickname}}</dd>
              <!-- 用户评论的内容 -->
              <!-- {{item.content}}中是 用户评论的内容 -->
              <dd class="detail">{{item.content}}</dd>
            </dl>
          </div>
          <img src="images/line.png" class="right_line">
        </div>
      </div>
      <div class="audio_con">
        <!-- :src='MusicUrl'指 给播放音乐的audio标签添加src属性,调用musicUrl中的音乐的url -->
        <!-- @play="play"指 给播放音乐的audio标签,绑定play播放事件,调用play方法  -->
        <!-- @pause="pause"指 给播放音乐的audio标签,绑定pause暂停事件,调用pause方法 -->
        <audio ref='audio' :src='musicUrl' @play="play" @pause="pause" controls autoplay loop class="myaudio"></audio>
      </div>
      <!-- MV -->
      <!-- v-show="isShow"指 该遮罩层的显示/隐藏,取决于isShow的值是true/false -->
      <!-- isShow的值是true,则显示遮罩层;isShow的值是false,则隐藏遮罩层 -->
      <div class="video_con" v-show="isShow" style="display: none;">
        <!-- :src="mvUrl"指 给video标签设置src属性,且对应的src属性值是mvUrl里的值 -->
        <video :src="mvUrl" controls="controls"></video>
        <!-- mv遮罩层 -->
        <!-- @click="hide"指 点击mv遮罩层,调用hide方法 -->
        <div class="mask" @click="hide"></div>
      </div>
    </div>
  </div>
  <!-- 开发环境版本,包含了有帮助的命令行警告 -->
  <script src="../vue.js"></script>
  <!-- 官网提供的 axios 在线地址 -->
  <script src="../axios.min.js"></script>
  <!-- 自己的js文件 -->
  <script src="./js/main.js"></script>
</body>

</html>

3.index.css(辅助作用)

body,
ul,
dl,
dd {
  margin: 0px;
  padding: 0px;
}

.wrap {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: url("../images/bg.jpg") no-repeat;
  background-size: 100% 100%;
}

.play_wrap {
  width: 800px;
  height: 544px;
  position: fixed;
  left: 50%;
  top: 50%;
  margin-left: -400px;
  margin-top: -272px;
  /* background-color: #f9f9f9; */
}

.search_bar {
  height: 60px;
  background-color: #1eacda;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 11;
}

.search_bar img {
  margin-left: 23px;
}

.search_bar input {
  margin-right: 23px;
  width: 296px;
  height: 34px;
  border-radius: 17px;
  border: 0px;
  background: url("../images/zoom.png") 265px center no-repeat
    rgba(255, 255, 255, 0.45);
  text-indent: 15px;
  outline: none;
}

.center_con {
  height: 435px;
  background-color: rgba(255, 255, 255, 0.5);
  display: flex;
  position: relative;
}

.song_wrapper {
  width: 200px;
  height: 435px;
  box-sizing: border-box;
  padding: 10px;
  list-style: none;
  position: absolute;
  left: 0px;
  top: 0px;
  z-index: 1;
}

.song_stretch {
  width: 600px;
}

.song_list {
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
}
.song_list::-webkit-scrollbar {
  display: none;
}

.song_list li {
  font-size: 12px;
  color: #333;
  height: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 580px;
  padding-left: 10px;
}

.song_list li:nth-child(odd) {
  background-color: rgba(240, 240, 240, 0.3);
}

.song_list li a {
  display: block;
  width: 17px;
  height: 17px;
  background-image: url("../images/play.png");
  background-size: 100%;
  margin-right: 5px;
  box-sizing: border-box;
}

.song_list li b {
  font-weight: normal;
  width: 122px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song_stretch .song_list li b {
  width: 200px;
}

.song_stretch .song_list li em {
  width: 150px;
}

.song_list li span {
  width: 23px;
  height: 17px;
  margin-right: 50px;
}
.song_list li span i {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  background: url("../images/table.png") left -48px no-repeat;
}

.song_list li em,
.song_list li i {
  font-style: normal;
  width: 100px;
}

.player_con {
  width: 400px;
  height: 435px;
  position: absolute;
  left: 200px;
  top: 0px;
}

.player_con2 {
  width: 400px;
  height: 435px;
  position: absolute;
  left: 200px;
  top: 0px;
}

.player_con2 video {
  position: absolute;
  left: 20px;
  top: 30px;
  width: 355px;
  height: 265px;
}

.disc {
  position: absolute;
  left: 73px;
  top: 60px;
  z-index: 9;
}
.cover {
  position: absolute;
  left: 125px;
  top: 112px;
  width: 150px;
  height: 150px;
  border-radius: 75px;
  z-index: 8;
}
.comment_wrapper {
  width: 180px;
  height: 435px;
  list-style: none;
  position: absolute;
  left: 600px;
  top: 0px;
  padding: 25px 10px;
}
.comment_wrapper .title {
  position: absolute;
  top: 0;
  margin-top: 10px;
}
.comment_wrapper .comment_list {
  overflow: auto;
  height: 410px;
}
.comment_wrapper .comment_list::-webkit-scrollbar {
  display: none;
}
.comment_wrapper dl {
  padding-top: 10px;
  padding-left: 55px;
  position: relative;
  margin-bottom: 20px;
}

.comment_wrapper dt {
  position: absolute;
  left: 4px;
  top: 10px;
}

.comment_wrapper dt img {
  width: 40px;
  height: 40px;
  border-radius: 20px;
}

.comment_wrapper dd {
  font-size: 12px;
}

.comment_wrapper .name {
  font-weight: bold;
  color: #333;
  padding-top: 5px;
}

.comment_wrapper .detail {
  color: #666;
  margin-top: 5px;
  line-height: 18px;
}
.audio_con {
  height: 50px;
  background-color: #f1f3f4;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}
.myaudio {
  width: 800px;
  height: 40px;
  margin-top: 5px;
  outline: none;
  background-color: #f1f3f4;
}
/* 旋转的动画 */
@keyframes Rotate {
  from {
    transform: rotateZ(0);
  }
  to {
    transform: rotateZ(360deg);
  }
}
/* 旋转的类名 */
.autoRotate {
  animation-name: Rotate;
  animation-iteration-count: infinite;
  animation-play-state: paused;
  animation-timing-function: linear;
  animation-duration: 5s;
}
/* 是否正在播放 */
.player_con.playing .disc,
.player_con.playing .cover {
  animation-play-state: running;
}

.play_bar {
  position: absolute;
  left: 200px;
  top: -10px;
  z-index: 10;
  transform: rotate(-25deg);
  transform-origin: 12px 12px;
  transition: 1s;
}
/* 播放杆 转回去 */
.player_con.playing .play_bar {
  transform: rotate(0);
}
/* 搜索历史列表 */
.search_history {
  position: absolute;
  width: 296px;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.3);
  list-style: none;
  right: 23px;
  top: 50px;
  box-sizing: border-box;
  padding: 10px 20px;
  border-radius: 17px;
}
.search_history li {
  line-height: 24px;
  font-size: 12px;
  cursor: pointer;
}
.switch_btn {
  position: absolute;
  right: 0;
  top: 0;
  cursor: pointer;
}
.right_line {
  position: absolute;
  left: 0;
  top: 0;
}
.video_con video {
  position: fixed;
  width: 800px;
  height: 546px;
  left: 50%;
  top: 50%;
  margin-top: -273px;
  transform: translateX(-50%);
  z-index: 990;
}
.video_con .mask {
  position: fixed;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  z-index: 980;
  background-color: rgba(0, 0, 0, 0.8);
}
.video_con .shutoff {
  position: fixed;
  width: 40px;
  height: 40px;
  background: url("../images/shutoff.png") no-repeat;
  left: 50%;
  margin-left: 400px;
  margin-top: -273px;
  top: 50%;
  z-index: 995;
}

4.vue.js(辅助作用)

 因为该文件内容太多,请前往该网址(Vue官网)下载 

安装 — Vue.js

安装Vue的方法 /获取vue.js文件的方法: 

5.axios.min.js(辅助作用)

(1)可以用axios在线网址【要连网】

 <!-- 官网提供的 axios 在线地址 -->
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>

(2)也可以下载axios.min.js本地文件:

 去github下载本地文件 网址GitHub - axios/axios: Promise based HTTP client for the browser and node.js 

 解压axios-1.x文件夹:

此处使用里面的axios.min.js

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

实战讲解及分析Spring新建Bean的几种方式以及创建过程(图+文+源码)

1 缘起 作为一个应用开发人员而言&#xff0c;会使用某一个工具分为两个层次&#xff08;个人观点&#xff09;&#xff1a; 第一个层次&#xff0c;知道工具&#xff0c;会使用这个工具解决问题&#xff1b; 第二个层次&#xff0c;理解工具的实现原理。 关于Spring的学习&am…

Linux Centos7 磁盘的分区、挂载

1、前言 注&#xff1a;看不懂的同学可以直接跟着后面的步骤操作 一块新的磁盘放到电脑上&#xff0c;要经过分区-->给分区设置文件系统--->挂载才能用。 也就是说要想将磁盘挂载&#xff0c;必须完成给磁盘分区和给分区设置文件系统这两步。 分区的时候先分成主分区和扩…

【DBN分类】基于matlab深度置信网络DBN变压器故障诊断【含Matlab源码 2284期】

一、深度置信网络DBN变压器故障诊断简介 1 DBN模型 DBN是深度学习中最关键的一个多层网络架构&#xff0c;如图2所示&#xff0c;由多层RBM堆叠而成&#xff0c;前一层RBM的输出为后一层RBM的输入&#xff0c;最顶层采用Softmax分类器作为标签层&#xff0c;输出分类识别的结果…

AD-DA转换(PCF8591)

AD转换目录一、AD转换&#xff08;PCF8591&#xff09;①初始化函数②读取ADC值的函数二、DA转换&#xff08;PCF8591&#xff09;三、STC15系列单片机用户手册.pdf—第10章一、AD转换&#xff08;PCF8591&#xff09; 思路&#xff1a;&#xff08;66&#xff0c;两个地址0x90…

RNA-seq——上游分析练习2(数据下载+trim-galore+hisat2+samtools+featureCounts)

目录软件安装新建文件夹一、下载数据二、质控过滤1.数据质量检测2.数据质量控制3.对处理后的数据再次QC三、序列比对1.hisat2比对2.flagstat检查一下结果四、featureCounts定量写在前面——本文是转录组上游分析的实战练习。主要包含四个步骤&#xff1a; 数据下载&#xff08…

DockerCompose编排Redis6.2.6以及遇到的那些坑

场景 Docker中使用Dockerfile的方式部署SpringBootVue前后端分离的项目(若依前后端分离框架为例): Docker中使用Dockerfile的方式部署SpringBootVue前后端分离的项目(若依前后端分离框架为例)_霸道流氓气质的博客-CSDN博客_若依 dockerfile 在上面使用Dockerfile分别构建每个…

Heron‘s formula

In geometry, Heron’s formula (or Hero’s formula) gives the area A of a triangle in terms of the three side lengths a, b, c. If {\textstyle s{\tfrac {1}{2}}(abc)}{\textstyle s{\tfrac {1}{2}}(abc)} is the semiperimeter of the triangle, the area is,[1] {\d…

影视中学职场套路——《如懿传》中职场生存法则

目录 一、老板决定的事&#xff0c;赞成不赞成都要执行 二、居人之下&#xff0c;聪明劲儿别往外露 三、切忌大庭广众直接与上级冲突 四、取悦所有人&#xff0c;不如取悦最大的boss 五、再强的人&#xff0c;也需要团队作战 六、人善被人欺&#xff08;首先要自保&#…

第三十一章 linux-模块的加载过程一

第三十一章 linux-模块的加载过程一 文章目录第三十一章 linux-模块的加载过程一sys_init_modulestruct moduleload_module模块ELF静态的内存视图字符串表&#xff08;string Table)HDR视图的第一次改写find_sec函数ps:kernel symbol内核符号表&#xff0c;就是在内核的内部函数…

opencv图像去畸变

图像去畸变的思路 对于目标图像(无畸变图像)上的每个像素点&#xff0c;转换到normalize平面&#xff0c;再进行畸变变换&#xff0c;进行投影&#xff0c;得到这个像素点畸变后的位置&#xff0c;然后将这个位置的源图像&#xff08;畸变图像&#xff09;的像素值作为目标图像…

Visual Studio 2022安装与编译简单c语言以及C#语言(番外)

文章目录1 软件下载网站2 下载与安装3 创建并学习C语言4 创建并学习C#语言1 软件下载网站 Visual Studio官网 2 下载与安装 1、下载社区版即可。 2、下载得到安装文件&#xff0c;右键以管理员方式运行安装文件。 3、点击继续。 4、等待下载完成。 5、这里学习C选择使用…

SpringBoot文件上传同时,接收复杂参数

目录 环境信息 问题描述 错误分析 解决方法 简单参数 总结 环境信息 Spring Boot&#xff1a;2.0.8.RELEASE Spring Boot内置的tomcat&#xff1a;tomcat-embed-core 8.5.37 问题描述 收到文件上传的开发工作&#xff0c;要求能适配各种场景&#xff0c;并且各场景的请求…

C语言——操作符详解(上)

C语言——操作符详解&#xff08;上&#xff09; 操作符的分类 C语言中的操作符主要分为算术操作符、移位操作符、位操作符、赋值操作符、单目操作符、关系操作符、逻辑操作符、条件操作符、逗号表达式、下标引用、函数调用和结构成员。我将分成三篇文章为大家详细介绍以上所…

[附源码]Python计算机毕业设计Django网约车智能接单规划小程序

项目运行 环境配置&#xff1a; Pychram社区版 python3.7.7 Mysql5.7 HBuilderXlist pipNavicat11Djangonodejs。 项目技术&#xff1a; django python Vue 等等组成&#xff0c;B/S模式 pychram管理等等。 环境需要 1.运行环境&#xff1a;最好是python3.7.7&#xff0c;…

[附源码]Python计算机毕业设计华夏商场红酒管理系统Django(程序+LW)

该项目含有源码、文档、程序、数据库、配套开发软件、软件安装教程 项目运行 环境配置&#xff1a; Pychram社区版 python3.7.7 Mysql5.7 HBuilderXlist pipNavicat11Djangonodejs。 项目技术&#xff1a; django python Vue 等等组成&#xff0c;B/S模式 pychram管理等等…

AI绘画火爆,以昆仑万维AIGC为例,揭秘AI绘画背后的模型算法

AI绘画火爆&#xff0c;以昆仑万维AIGC为例&#xff0c;揭秘AI绘画背后的模型算法 一、前言 最近AI绘画让人工智能再次走进大众视野。在人工智能发展早起&#xff0c;一直认为人工智能能实现的功能非常有限。通常都是些死板的东西&#xff0c;像是下棋、问答之类的&#xff0…

mysql锁范围(一)表级锁变行级锁

文章目录行级锁1. 用两个连接connection登陆mysql2. 测试无索引情况1&#xff09;机器1开启事务&#xff0c;执行更新北京仓数据sql&#xff0c;不提交事务2&#xff09;机器2开启事务&#xff0c;先查询北京仓3&#xff09;机器2开始更新上海仓数据4&#xff09;机器1事务回滚…

【Spring Cloud】Nacos服务分级存储模型与负载均衡原理与实战

本期目录1. 服务分级模型介绍2. 服务分级模型的必要性3. 配置集群属性4. NacosRule负载均衡4.1 背景描述4.2 配置Nacos负载均衡策略4.3 根据权重负载均衡1. 服务分级模型介绍 为了提升整个系统的容灾性&#xff0c;Nacos 引入了地域 (Zone) 的概念&#xff0c;如上图中的北京、…

Reactor 和 Proactor 区别

Reactor 和 Proactor 区别 同步异步、阻塞非阻塞组合 同步 以read()函数为例&#xff0c;int n read(fd, buf. sz) 当采用同步的方式和阻塞io的方式时&#xff0c;buf就是从内核拷贝的数据&#xff0c;函数返回则可以马上知道 buf 中的数据。当采用同步的方式和非阻塞io的方式…

关于rabbitmq消息推送的小demo

目录 一.前言 1.1场景 1.2消息交换机三种形式 二.建设demo工程 2.1 依赖 2.2yml文件指定rabbitmq连接信息 2.3直连型消息链接 一.前言 1.1场景 在我们实际开发中到一个特定的时候是比如工作流到某个状态时, 我们会向某某单位发送消息, 这时就会用到我们的消息推送---ra…