Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
h5
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8ad315ee
authored
May 16, 2019
by
梁建民
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
js
parent
7e755385
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
src/main.js
view/index.html
view/js/app.76d47da3.js → view/js/app.279e8d70.js
src/main.js
View file @
8ad315ee
...
...
@@ -28,6 +28,7 @@ Object.keys(filters).forEach(key => Vue.filter(key, filters[key]));
Vue
.
use
(
directive
);
//设置请求头
var
csrf
=
Util
.
getCookie
(
'Yo4teW_csrf'
)
||
''
;
Vue
.
prototype
.
$http
=
axios
;
axios
.
defaults
.
headers
.
post
[
'Content-Type'
]
=
'application/x-www-form-urlencoded'
;
axios
.
defaults
.
withCredentials
=
true
;
...
...
@@ -35,10 +36,10 @@ axios.interceptors.request.use(function (config) {
if
(
config
.
method
==
'post'
)
{
if
(
config
.
data
)
{
if
(
config
.
data
.
indexOf
(
"&pf=2"
)
==
-
1
)
{
config
.
data
+=
"&pf="
+
window
.
lxpf
;
config
.
data
+=
"&pf="
+
window
.
lxpf
+
'&csrf='
+
csrf
;
}
}
else
{
config
.
data
=
"pf="
+
window
.
lxpf
config
.
data
=
"pf="
+
window
.
lxpf
+
'&csrf='
+
csrf
;
}
}
else
if
(
config
.
method
==
'get'
)
{
let
paramsArr
=
Object
.
keys
(
config
.
params
);
...
...
@@ -46,12 +47,14 @@ axios.interceptors.request.use(function (config) {
if
(
paramsArr
.
indexOf
(
'pf'
)
==
-
1
)
{
config
.
params
=
{
pf
:
window
.
lxpf
,
csrf
:
csrf
,
...
config
.
params
}
}
}
else
{
config
.
params
=
{
pf
:
window
.
lxpf
pf
:
window
.
lxpf
,
csrf
:
csrf
}
}
}
...
...
view/index.html
View file @
8ad315ee
This diff is collapsed.
Click to expand it.
view/js/app.
76d47da3
.js
→
view/js/app.
279e8d70
.js
View file @
8ad315ee
This diff is collapsed.
Click to expand it.
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