Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rongtong-pc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
融通安全管理系统
rongtong-pc
Commits
8a9e2d81
Commit
8a9e2d81
authored
Jan 12, 2024
by
kaitly205422@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复参数传递问题
parent
1789f962
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
dist.zip
dist.zip
+0
-0
src/utils/request.js
src/utils/request.js
+6
-6
src/utils/ruoyi.js
src/utils/ruoyi.js
+4
-2
No files found.
dist.zip
View file @
8a9e2d81
No preview for this file type
src/utils/request.js
View file @
8a9e2d81
...
...
@@ -30,12 +30,12 @@ service.interceptors.request.use(config => {
config
.
headers
[
'
Authorization
'
]
=
'
Bearer
'
+
getToken
()
// 让每个请求携带自定义token 请根据实际情况自行修改
}
// // get请求映射params参数
//
if (config.method === 'get' && config.params) {
//
let url = config.url + '?' + tansParams(config.params);
//
url = url.slice(0, -1);
//
config.params = {};
//
config.url = url;
//
}
if
(
config
.
method
===
'
get
'
&&
config
.
params
)
{
let
url
=
config
.
url
+
'
?
'
+
tansParams
(
config
.
params
);
url
=
url
.
slice
(
0
,
-
1
);
config
.
params
=
{};
config
.
url
=
url
;
}
if
(
!
isRepeatSubmit
&&
(
config
.
method
===
'
post
'
||
config
.
method
===
'
put
'
))
{
const
requestObj
=
{
url
:
config
.
url
,
...
...
src/utils/ruoyi.js
View file @
8a9e2d81
...
...
@@ -88,7 +88,7 @@ export function selectDictLabel(datas, value) {
// 回显数据字典(字符串、数组)
export
function
selectDictLabels
(
datas
,
value
,
separator
)
{
if
(
value
===
undefined
||
value
.
length
===
0
)
{
if
(
value
===
undefined
||
value
.
length
===
0
)
{
return
""
;
}
if
(
Array
.
isArray
(
value
))
{
...
...
@@ -206,11 +206,13 @@ export function handleTree(data, id, parentId, children) {
* @param {*} params 参数
*/
export
function
tansParams
(
params
)
{
console
.
log
(
params
)
let
result
=
''
for
(
const
propName
of
Object
.
keys
(
params
))
{
const
value
=
params
[
propName
];
var
part
=
encodeURIComponent
(
propName
)
+
"
=
"
;
if
(
value
!==
null
&&
value
!==
""
&&
typeof
(
value
)
!==
"
undefined
"
)
{
// && value !== "" 有的接口需要默认传空值
if
(
value
!==
null
&&
typeof
(
value
)
!==
"
undefined
"
)
{
if
(
typeof
value
===
'
object
'
)
{
for
(
const
key
of
Object
.
keys
(
value
))
{
if
(
value
[
key
]
!==
null
&&
value
[
key
]
!==
""
&&
typeof
(
value
[
key
])
!==
'
undefined
'
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment