Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testPull #316

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 %>favicon.ico">
<link rel="icon" href="<%= BASE_URL %>musicClient.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
Expand Down
Binary file added 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"/>
<el-image class="song-bar-img" fit="contain" :src="attachImageUrl(songPic)"/>
</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 = "Yin-music";
export const MUSICNAME = "Nan-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: 60 additions & 42 deletions music-client/src/views/FPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<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">发送验证码</el-button>
<el-button @click="sendVerificationCode" :disabled="countdown > 0">
{{ countdown > 0 ? `重新发送(${countdown}s)` : '发送验证码' }}
</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 @@ -47,55 +49,71 @@ export default {
email: "",
code: "",
password: "",
confirmPassword: ""
confirmPassword: "",
countdown: 0,
};
},
methods: {
async sendVerificationCode() {
try {
const email =document.getElementById('email').value;
const response = await axios.get('http://localhost:8888/user/sendVerificationCode',({params: {
email: email
}}));
console.log(response.data);
const email = document.getElementById('email').value;
const { data: { message, success } } = await axios.get('http://localhost:8888/user/sendVerificationCode', { params: { email } });

console.log(message, success);

this.$message({
message: response.data,
type: 'success'
message,
type: success ? 'success' : 'error'
});

if (success) {
// 设置倒计时
this.countdown = 58;
const timer = setInterval(() => {
if (this.countdown > 0) {
this.countdown--;
} else {
clearInterval(timer);
}
}, 1000);
}
} catch (error) {
console.error('Error submitting email:');
this.$message({
message: 'response.data',
type: 'error'
});
}
},
console.error('发送验证码异常', error);
this.$message({
message: '发送验证码异常',
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 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'
});
}
}

},
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'
});
}
}
},
};
</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="4000">
<el-carousel v-if="swiperList.length" class="swiper-container" type="card" height="20vw" :interval="2300">
<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: 5 additions & 3 deletions music-client/src/views/song-sheet/SongSheetDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ export default defineComponent({
}
async function getUserRank(userId, songListId) {
const result = (await HttpManager.getUserRank(userId, songListId)) as ResponseBody;
nowScore.value = result.data / 2;
disabledRank.value = true;
assistText.value = "已评价";
if (result.data.data){
nowScore.value = result.data.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 %>favicon.ico">
<link rel="icon" href="<%= BASE_URL %>musicManage.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
Expand Down
Binary file added 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 :src="attachImageUrl(userPic)" />
<img style="width: 100%;height: 40px;" :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 = 'Yin-music 后台管理'
export const MUSICNAME = 'Nan-Music 后台管理'
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public R resetPassword(@RequestBody ResetPasswordRequest passwordRequest){
String code = stringRedisTemplate.opsForValue().get("code");
if (user==null){
return R.fatal("用户不存在");
}else if (!code.equals(passwordRequest.getCode())){
}else if (code == null || !code.equals(passwordRequest.getCode())){
return R.fatal("验证码不存在或失效");
}
ConsumerRequest consumerRequest=new ConsumerRequest();
Expand All @@ -92,7 +92,7 @@ public R sendCode(@RequestParam String email){
String code = RandomUtils.code();
simpleOrderManager.sendCode(code,email);
//保存在redis中
stringRedisTemplate.opsForValue().set("code",code,5, TimeUnit.MINUTES);
stringRedisTemplate.opsForValue().set("code",code,1, TimeUnit.MINUTES);
return R.success("发送成功");
}

Expand Down
2 changes: 1 addition & 1 deletion music-server/src/main/resources/application-dev.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spring.datasource.url=jdbc:mysql://localhost:3306/tp_music?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
spring.datasource.url=jdbc:mysql://localhost:3306/tb_music?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
Expand Down
Loading