Skip to content

fix: #90 optimize getParameterByName's return#91

Merged
mumiao merged 1 commit intomasterfrom
fix_90
Oct 20, 2023
Merged

fix: #90 optimize getParameterByName's return#91
mumiao merged 1 commit intomasterfrom
fix_90

Conversation

@liuxy0551
Copy link
Copy Markdown
Collaborator

@LuckyFBB
Copy link
Copy Markdown
Contributor

+1

Comment thread src/utils.ts
return decodeURIComponent(results[2].replace(/\+/g, ' '));

const paramValue = decodeURIComponent(results[2].replace(/\+/g, ' '));
if (paramValue === 'null') {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

其实就是把string类型的null和undefined,转换为null和undefined,方便在调用接口传参做过滤么

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

是的,省得子产品自己处理了,如果直接返回字符串,子产品的判空会不生效的

@Cythia828
Copy link
Copy Markdown

+1

@mumiao mumiao merged commit 1158b6b into master Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants