Merge branch 'dev-3.8' of git.mesalab.cn:nezha/nezha-fronted into dev-3.9

This commit is contained in:
zyh
2024-01-24 17:05:30 +08:00
3 changed files with 3 additions and 5 deletions

View File

@@ -113,7 +113,6 @@ import { mapActions } from 'vuex'
import guide from '@/components/common/popBox/guide'
import intro from '@/components/common/intro'
import imageUrl from '@/assets/img/system-sound-settings.gif'
import audioUrl from '@/assets/audio/new_alert_message.mp3'
export default {
name: 'Header',
components: {
@@ -198,7 +197,7 @@ export default {
...mapActions(['logoutSuccess']),
// 测试是否能自动播放 若不能 点击开关时弹窗
testAutoplay () {
const audio = new Audio(audioUrl)
const audio = new Audio('/static/audio/new_alert_message.mp3')
audio.muted = true
audio.play().then(() => {
console.log('autoplay')

View File

@@ -3,7 +3,6 @@ import moment from 'moment-timezone'
import { get } from '../http'
import store from '../store'
import router from '../router'
import audioUrl from '@/assets/audio/new_alert_message.mp3'
Date.prototype.setStart = function () {
this.setHours(0)
this.setMinutes(0)
@@ -391,7 +390,7 @@ export default new Vue({
}
if (response.code == 200) {
if (!this.audio) {
this.audio = new Audio(audioUrl)
this.audio = new Audio('/static/audio/new_alert_message.mp3')
}
if (response.data.list && response.data.list.length) {
this.lastId = response.data.list.reduce(function (max, obj) {
@@ -434,7 +433,7 @@ export default new Vue({
}, 10 * index)
})
let playCount = 0
const audioLoop = store.state.nzDefaultConfig.audioLoop || 3
const audioLoop = store.state.nzDefaultConfig.audioLoop || 1
const maxPlayCount = parseInt(audioLoop) // 设置希望播放的次数
if (maxPlayCount) {
this.audio.play()