Skip to content

Commit

Permalink
fix: 【应用编排】语音输入检测没有录音权限时弹出提示
Browse files Browse the repository at this point in the history
  • Loading branch information
wangdan-fit2cloud committed Sep 18, 2024
1 parent 53fb5ec commit cb13c9d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
Binary file added ui/src/assets/tipIMG.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 16 additions & 1 deletion ui/src/components/ai-chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ import 'recorder-core/src/engine/mp3-engine'
import { MsgWarning } from '@/utils/message'
import DynamicsForm from '@/components/dynamics-form/index.vue'
import type { FormField } from '@/components/dynamics-form/type'
import { MsgAlert } from '@/utils/message'
defineOptions({ name: 'AiChat' })
const route = useRoute()
Expand Down Expand Up @@ -845,7 +846,21 @@ const startRecording = async () => {
}
)
} catch (error) {
console.error('无法获取音频权限:', error)
// console.error('无法获取音频权限:', error)
MsgAlert(
`提示`,
`<p>该功能需要使用麦克风,浏览器禁止不安全页面录音,解决方案如下:<br/>
1、可开启 https 解决;<br/>
2、若无 https 配置则需要修改浏览器安全配置,Chrome 设置如下:<br/>
(1) 地址栏输入chrome://flags/#unsafely-treat-insecure-origin-as-secure;<br/>
(2) 将 http 站点配置在文本框中,例如: http://127.0.0.1:8080。</p>
<img src="${new URL(`../../assets/tipIMG.jpg`, import.meta.url).href}" width="750"/>`,
{
confirmButtonText: '我知道了',
dangerouslyUseHTMLString: true,
customClass: 'record-tip-confirm'
}
)
}
}
Expand Down
7 changes: 5 additions & 2 deletions ui/src/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -734,12 +734,15 @@ h5 {
}
}


.edit-avatar {
position: relative;
.edit-mask {
position: absolute;
left: 0;
background: rgba(0, 0, 0, 0.4);
}
}
}

.record-tip-confirm {
max-width: 800px !important;
}
2 changes: 1 addition & 1 deletion ui/src/views/application/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ import { ref, onMounted, reactive } from 'vue'
import applicationApi from '@/api/application'
import CreateApplicationDialog from './component/CreateApplicationDialog.vue'
import CopyApplicationDialog from './component/CopyApplicationDialog.vue'
import { MsgSuccess, MsgConfirm } from '@/utils/message'
import { MsgSuccess, MsgConfirm, MsgAlert } from '@/utils/message'
import { isAppIcon } from '@/utils/application'
import { useRouter } from 'vue-router'
import { isWorkFlow } from '@/utils/application'
Expand Down

0 comments on commit cb13c9d

Please sign in to comment.