提交者
Gitee
!497 增加对空字符串参数的过滤
Merge pull request !497 from root/master
正在显示
1 个修改的文件
包含
4 行增加
和
4 行删除
| @@ -68,7 +68,7 @@ export function addDateRange(params, dateRange, propName) { | @@ -68,7 +68,7 @@ export function addDateRange(params, dateRange, propName) { | ||
| 68 | return search; | 68 | return search; |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | -// 回显数据字典 | 71 | +// 回显数据字典 |
| 72 | export function selectDictLabel(datas, value) { | 72 | export function selectDictLabel(datas, value) { |
| 73 | if (value === undefined) { | 73 | if (value === undefined) { |
| 74 | return ""; | 74 | return ""; |
| @@ -207,10 +207,10 @@ export function tansParams(params) { | @@ -207,10 +207,10 @@ export function tansParams(params) { | ||
| 207 | for (const propName of Object.keys(params)) { | 207 | for (const propName of Object.keys(params)) { |
| 208 | const value = params[propName]; | 208 | const value = params[propName]; |
| 209 | var part = encodeURIComponent(propName) + "="; | 209 | var part = encodeURIComponent(propName) + "="; |
| 210 | - if (value !== null && typeof (value) !== "undefined") { | 210 | + if (value !== null && value !== "" && typeof (value) !== "undefined") { |
| 211 | if (typeof value === 'object') { | 211 | if (typeof value === 'object') { |
| 212 | for (const key of Object.keys(value)) { | 212 | for (const key of Object.keys(value)) { |
| 213 | - if (value[key] !== null && typeof (value[key]) !== 'undefined') { | 213 | + if (value[key] !== null && value !== "" && typeof (value[key]) !== 'undefined') { |
| 214 | let params = propName + '[' + key + ']'; | 214 | let params = propName + '[' + key + ']'; |
| 215 | var subPart = encodeURIComponent(params) + "="; | 215 | var subPart = encodeURIComponent(params) + "="; |
| 216 | result += subPart + encodeURIComponent(value[key]) + "&"; | 216 | result += subPart + encodeURIComponent(value[key]) + "&"; |
| @@ -233,4 +233,4 @@ export async function blobValidate(data) { | @@ -233,4 +233,4 @@ export async function blobValidate(data) { | ||
| 233 | } catch (error) { | 233 | } catch (error) { |
| 234 | return true; | 234 | return true; |
| 235 | } | 235 | } |
| 236 | -} | ||
| 236 | +} |
-
请 注册 或 登录 后发表评论