Skip to content

Commit

Permalink
Merge pull request Yin-Hongwei#321 from Yin-Hongwei/revert-316-master
Browse files Browse the repository at this point in the history
回退
  • Loading branch information
Yin-Hongwei authored Jan 14, 2025
2 parents 950847a + c27ba39 commit 6d47655
Show file tree
Hide file tree
Showing 23 changed files with 87 additions and 107 deletions.
2 changes: 1 addition & 1 deletion music-client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>musicClient.ico">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
Expand Down
Binary file removed music-client/public/musicClient.ico
Binary file not shown.
10 changes: 5 additions & 5 deletions music-client/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ const HttpManager = {
// 返回歌单里指定歌单ID的歌曲
getListSongOfSongId: (songListId) => get(`listSong/detail?songListId=${songListId}`),

// =======================> 艺人 API 完成
// 返回所有艺人
// =======================> 歌手 API 完成
// 返回所有歌手
getAllSinger: () => get("singer"),
// 通过性别对艺人分类
// 通过性别对歌手分类
getSingerOfSex: (sex) => get(`singer/sex/detail?sex=${sex}`),

// =======================> 收藏 API 完成
Expand Down Expand Up @@ -74,9 +74,9 @@ const HttpManager = {
// =======================> 歌曲 API
// 返回指定歌曲ID的歌曲
getSongOfId: (id) => get(`song/detail?id=${id}`),
// 返回指定艺人ID的歌曲
// 返回指定歌手ID的歌曲
getSongOfSingerId: (id) => get(`song/singer/detail?singerId=${id}`),
// 返回指定艺人名的歌曲
// 返回指定歌手名的歌曲
getSongOfSingerName: (keywords) => get(`song/singerName/detail?name=${keywords}`),
// 下载音乐
downloadMusic: (url) => get(url, { responseType: "blob" }),
Expand Down
4 changes: 2 additions & 2 deletions music-client/src/components/SongList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="content">
<el-table highlight-current-row :data="dataList" @row-click="handleClick">
<el-table-column prop="songName" label="歌曲" />
<el-table-column prop="singerName" label="艺人" />
<el-table-column prop="singerName" label="歌手" />
<el-table-column prop="introduction" label="专辑" />
<el-table-column label="编辑" width="80" align="center">
<template #default="scope">
Expand All @@ -18,7 +18,7 @@
songName: scope.row.name,
})
">下载</el-dropdown-item>
<el-dropdown-item :icon="Delete" v-if="show" @click="deleteCollection({ id: scope.row.id })">取消收藏</el-dropdown-item>
<el-dropdown-item :icon="Delete" v-if="show" @click="deleteCollection({ id: scope.row.id })">删除</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
Expand Down
4 changes: 2 additions & 2 deletions music-client/src/components/layouts/YinPlayBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="info-box">
<!--歌曲图片-->
<div @click="goPlayerPage">
<el-image class="song-bar-img" fit="contain" :src="attachImageUrl(songPic)"/>
<el-image class="song-bar-img" fit="contain"/>
</div>
<!--播放开始结束时间-->
<div v-if="songId">
Expand Down Expand Up @@ -166,7 +166,7 @@ export default defineComponent({
"songId", // 音乐id
"songUrl", // 音乐地址
"songTitle", // 歌名
"singerName", // 艺人名
"singerName", // 歌手名
"songPic", // 歌曲图片
"curTime", // 当前音乐的播放位置
"duration", // 音乐时长
Expand Down
2 changes: 1 addition & 1 deletion music-client/src/enums/music-name.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const MUSICNAME = "Nan-Music";
export const MUSICNAME = "Yin-music";
2 changes: 1 addition & 1 deletion music-client/src/enums/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { RouterName } from "./router-name";
export const enum NavName {
Home = "首页",
SongSheet = "歌单",
Singer = "艺人",
Singer = "歌手",
Personal = "个人主页",
Setting = "设置",
SignIn = "登录",
Expand Down
8 changes: 4 additions & 4 deletions music-client/src/enums/singer.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
export const singerStyle = [
{
name: "全部艺人",
name: "全部歌手",
type: "-1",
},
{
name: "男艺人",
name: "男歌手",
type: "1",
},
{
name: "女艺人",
name: "女歌手",
type: "0",
},
{
name: "组合艺人",
name: "组合歌手",
type: "2",
},
];
2 changes: 1 addition & 1 deletion music-client/src/mixins/mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function () {
return str.split("-")[1];
}

// 获取艺人名
// 获取歌手名
function getSingerName(str) {
return str.split("-")[0];
}
Expand Down
2 changes: 1 addition & 1 deletion music-client/src/store/song.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
songTitle: "", // 歌名
songUrl: "", // 音乐 URL
songPic: `/img/songPic/tubiao.jpg`, // 歌曲图片
singerName: "", // 艺人名
singerName: "", // 歌手名
lyric: [], // 处理后的歌词数据

/** 音乐播放信息 */
Expand Down
102 changes: 42 additions & 60 deletions music-client/src/views/FPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
<el-form @submit.prevent="handleSubmit">
<el-form-item label="邮箱:" prop="email">
<el-input id="email" v-model="email" type="email" required />
<el-button @click="sendVerificationCode" :disabled="countdown > 0">
{{ countdown > 0 ? `重新发送(${countdown}s)` : '发送验证码' }}
</el-button>
<el-button @click="sendVerificationCode">发送验证码</el-button>
</el-form-item>
<el-form-item label="验证码:" prop="code">
<el-input id="code" v-model="code" type="text" required />
Expand Down Expand Up @@ -49,71 +47,55 @@ export default {
email: "",
code: "",
password: "",
confirmPassword: "",
countdown: 0,
confirmPassword: ""
};
},
methods: {
async sendVerificationCode() {
try {
const email = document.getElementById('email').value;
const { data: { message, success } } = await axios.get('http://localhost:8888/user/sendVerificationCode', { params: { email } });
console.log(message, success);
const email =document.getElementById('email').value;
const response = await axios.get('http://localhost:8888/user/sendVerificationCode',({params: {
email: email
}}));
console.log(response.data);
this.$message({
message,
type: success ? 'success' : 'error'
message: response.data,
type: 'success'
});
if (success) {
// 设置倒计时
this.countdown = 58;
const timer = setInterval(() => {
if (this.countdown > 0) {
this.countdown--;
} else {
clearInterval(timer);
}
}, 1000);
}
} catch (error) {
console.error('发送验证码异常', error);
this.$message({
message: '发送验证码异常',
type: 'error'
});
}
},
console.error('Error submitting email:');
this.$message({
message: 'response.data',
type: 'error'
});
}
},
async handleSubmit() {
try {
const email =document.getElementById('email').value;
const code=document.getElementById('code').value
const password=document.getElementById('password').value
const confirmPassword=document.getElementById('confirmPassword').value
const data = {
email: email,
code: code,
password: password,
confirmPassword: confirmPassword
};
const { data: { message, success } } = await axios.post('http://localhost:8888/user/resetPassword', data);
console.log(message, success);
this.$message({
message,
type: success ? 'success' : 'error'
});
if (success){
this.$router.back();
}
} catch (error) {
console.error('提交异常', error);
this.$message({
message: '提交异常',
type: 'error'
});
}
}
},
try {
const email =document.getElementById('email').value;
const code=document.getElementById('code').value
const password=document.getElementById('password').value
const confirmPassword=document.getElementById('confirmPassword').value
const data = {
email: email,
code: code,
password: password,
confirmPassword: confirmPassword
};
const response = await axios.post('http://localhost:8888/user/resetPassword', data);
console.log(response.data);
this.$message({
message: response.data,
type: 'success'
});
} catch (error) {
this.$message({
message: 'response.data',
type: 'error'
});
}
}
},
};
</script>
8 changes: 4 additions & 4 deletions music-client/src/views/Home.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<!--轮播图-->
<el-carousel v-if="swiperList.length" class="swiper-container" type="card" height="20vw" :interval="2300">
<el-carousel v-if="swiperList.length" class="swiper-container" type="card" height="20vw" :interval="4000">
<el-carousel-item v-for="(item, index) in swiperList" :key="index">
<img :src="HttpManager.attachImageUrl(item.pic)" />
</el-carousel-item>
</el-carousel>
<!--热门歌单-->
<play-list class="play-list-container" title="歌单" path="song-sheet-detail" :playList="songList"></play-list>
<!--热门艺人-->
<play-list class="play-list-container" title="艺人" path="singer-detail" :playList="singerList"></play-list>
<!--热门歌手-->
<play-list class="play-list-container" title="歌手" path="singer-detail" :playList="singerList"></play-list>
</template>

<script lang="ts" setup>
Expand All @@ -20,7 +20,7 @@ import { HttpManager } from "@/api";
import mixin from "@/mixins/mixin";
const songList = ref([]); // 歌单列表
const singerList = ref([]); // 艺人列表
const singerList = ref([]); // 歌手列表
const swiperList = ref([]);// 轮播图 每次都在进行查询
const { changeIndex } = mixin();
try {
Expand Down
4 changes: 2 additions & 2 deletions music-client/src/views/Lyric.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="song-container">
<el-image class="song-pic" fit="contain" :src="attachImageUrl(songPic)" />
<ul class="song-info">
<li>艺人:{{ singerName }}</li>
<li>歌手:{{ singerName }}</li>
<li>歌曲:{{ songTitle }}</li>
</ul>
</div>
Expand Down Expand Up @@ -49,7 +49,7 @@ export default defineComponent({
const currentPlayIndex = computed(() => store.getters.currentPlayIndex); // 当前歌曲在歌曲列表的位置
const curTime = computed(() => store.getters.curTime);
const songTitle = computed(() => store.getters.songTitle); // 歌名
const singerName = computed(() => store.getters.singerName); // 艺人名
const singerName = computed(() => store.getters.singerName); // 歌手名
const songPic = computed(() => store.getters.songPic); // 歌曲图片
watch(songId, () => {
lyricArr.value = parseLyric(currentPlayList.value[currentPlayIndex.value].lyric);
Expand Down
8 changes: 4 additions & 4 deletions music-client/src/views/singer/Singer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { singerStyle } from "@/enums";
import { HttpManager } from "@/api";
// data
const activeName = ref("全部艺人");
const activeName = ref("全部歌手");
const pageSize = ref(15); // 页数
const currentPage = ref(1); // 当前页
const allPlayList = ref([]);
Expand All @@ -32,7 +32,7 @@ const data = computed(() => {
return allPlayList.value.slice((currentPage.value - 1) * pageSize.value, currentPage.value * pageSize.value);
});
// 获取所有艺人
// 获取所有歌手
async function getAllSinger() {
const result = (await HttpManager.getAllSinger()) as ResponseBody;
currentPage.value = 1;
Expand All @@ -49,14 +49,14 @@ function handleCurrentChange(val) {
function handleChangeView(item) {
activeName.value = item.name;
allPlayList.value = [];
if (item.name === "全部艺人") {
if (item.name === "全部歌手") {
getAllSinger();
} else {
getSingerSex(item.type);
}
}
// 通过性别对艺人分类
// 通过性别对歌手分类
async function getSingerSex(sex) {
const result = (await HttpManager.getSingerOfSex(sex)) as ResponseBody;
currentPage.value = 1;
Expand Down
8 changes: 3 additions & 5 deletions music-client/src/views/song-sheet/SongSheetDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ export default defineComponent({
}
async function getUserRank(userId, songListId) {
const result = (await HttpManager.getUserRank(userId, songListId)) as ResponseBody;
if (result.data.data){
nowScore.value = result.data.data / 2;
disabledRank.value = true;
assistText.value = "已评价";
}
nowScore.value = result.data / 2;
disabledRank.value = true;
assistText.value = "已评价";
}
// 提交评分
async function pushValue() {
Expand Down
2 changes: 1 addition & 1 deletion music-manage/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>musicManage.ico">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
Expand Down
Binary file removed music-manage/public/musicManage.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion music-manage/src/components/layouts/YinHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="header-right">
<div class="header-user-con">
<div class="user-avator">
<img style="width: 100%;height: 40px;" :src="attachImageUrl(userPic)" />
<img :src="attachImageUrl(userPic)" />
</div>
<el-dropdown class="user-name" trigger="click" @command="handleCommand">
<span class="el-dropdown-link">
Expand Down
2 changes: 1 addition & 1 deletion music-manage/src/enums/music-name.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const MUSICNAME = 'Nan-Music 后台管理'
export const MUSICNAME = 'Yin-music 后台管理'
10 changes: 5 additions & 5 deletions music-manage/src/mixins/mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ export default function () {
}

function beforeImgUpload(file) {
const ltCode = 5;
const isLt5M = file.size / 1024 / 1024 < ltCode;
const ltCode = 2;
const isLt2M = file.size / 1024 / 1024 < ltCode;
const isExistFileType = uploadTypes.value.includes(file.type.replace(/image\//, ""));

if (!isExistFileType) {
(proxy as any).$message.error(`图片只支持 ${uploadTypes.value.join("、")} 格式!`);
}
if (!isLt5M) {
if (!isLt2M) {
(proxy as any).$message.error(`上传头像图片大小不能超过 ${ltCode}MB!`);
}

return isExistFileType && isLt5M;
return isExistFileType && isLt2M;
}

function beforeSongUpload(file) {
Expand Down
Loading

0 comments on commit 6d47655

Please sign in to comment.