Skip to content

Commit

Permalink
fix: parsing some link
Browse files Browse the repository at this point in the history
  • Loading branch information
yenche123 committed Aug 28, 2023
1 parent c5c7ff8 commit 7f88920
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cloud-functions/src/parse-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ exports.main = async function (ctx: FunctionContext): Promise<ResType> {
* 判断是否为 .mp3 或 .m4a 结尾的链接
*/
function judgeIsCdnLink(link: string): boolean {
const reg = /^http(s)?:\/\/[^\s\/]{2,40}\/\S{2,240}\.(mp3|m4a)[\?=\w]*$/g
const reg = /^http(s)?:\/\/[\w\.-]*\w{1,32}\.\w{2,6}\/\S+.(mp3|m4a)[\?=\w]*$/g
//@ts-ignore
let matches = link.matchAll(reg)
for(let match of matches) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "podcast-together",
"version": "0.9.2",
"version": "0.9.3",
"description": "一个基于 vite + vue + vue-router + ts + laf 的全栈项目,让你跟好友一起实时在线听播客!",
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/views/create-page/create-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const canSubmit = computed(() => {
let val = inputValue.value
let v = val.trim()
if(v.length < 10) return false
const reg = /^http(s)?:\/\/[\w\.]*\w{1,32}\.\w{2,6}\S*$/g
const reg = /^http(s)?:\/\/[\w\.-]*\w{1,32}\.\w{2,6}\S*$/g
return reg.test(val)
})
Expand Down

1 comment on commit 7f88920

@vercel
Copy link

@vercel vercel bot commented on 7f88920 Aug 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.