codercup / unibest

unibest - 最好用的 uniapp 开发框架。unibest 是由 uniapp + Vue3 + Ts + Vite4 + UnoCss + UniUI 驱动的跨端快速启动模板,使用 VS Code 开发,具有代码提示、自动格式化、统一配置、代码片段等功能,同时内置了大量平时开发常用的基本组件,开箱即用,让你编写 uniapp 拥有 best 体验。
https://codercup.github.io/unibest-docs/
MIT License
1.29k stars 172 forks source link

@/utils/index 代码中建议 #102

Closed ckbabby closed 3 weeks ago

ckbabby commented 4 weeks ago

Bug report(问题描述)

export const getUrlObj = (url: string) => { const [path, queryStr] = url.split('?') console.log(path, queryStr)

const query: Record<string, string> = {} queryStr.split('&').forEach((item) => { const [key, value] = item.split('=') console.log(key, value) query[key] = ensureDecodeURIComponent(value) // 这里需要统一 decodeURIComponent 一下,可以兼容h5和微信y }) return { path, query } } 这里是否应该判断queryStr 是否为undefine 情况 please write your issue description here

Steps to reproduce(问题复现步骤)

Screenshot or Gif(截图或动态图)

minimal reproduction(最小可还原代码)

System Info

npx envinfo --system --npmPackages vue --binaries --browsers

执行上面命令,将结果贴下面

codercup commented 3 weeks ago

确实是,3q

codercup commented 3 weeks ago

已经处理。done