Commit 033af204 authored by IvyXia123's avatar IvyXia123

headers

parent 631e8927
...@@ -11,4 +11,4 @@ ...@@ -11,4 +11,4 @@
position: fixed; position: fixed;
background: #f4f4f4; background: #f4f4f4;
} }
/* html{font-size: 1px;} */</style><link href=static/css/app.d7ff704234c186886ba9e9e037596e8c.css rel=stylesheet></head><body><div id=app></div><script src=https://res.wx.qq.com/open/js/jweixin-1.3.2.js></script><script></script><script type=text/javascript src=static/js/manifest.6a8a8f81d41eede92744.js></script><script type=text/javascript src=static/js/vendor.0c1d6ebbba685002d59c.js></script><script type=text/javascript src=static/js/app.ff772b6baf7c71ec538b.js></script></body></html> /* html{font-size: 1px;} */</style><link href=static/css/app.d7ff704234c186886ba9e9e037596e8c.css rel=stylesheet></head><body><div id=app></div><script src=https://res.wx.qq.com/open/js/jweixin-1.3.2.js></script><script></script><script type=text/javascript src=static/js/manifest.6a8a8f81d41eede92744.js></script><script type=text/javascript src=static/js/vendor.0c1d6ebbba685002d59c.js></script><script type=text/javascript src=static/js/app.95bd88f0180626a74c40.js></script></body></html>
\ No newline at end of file \ No newline at end of file
This diff is collapsed.
This diff is collapsed.
...@@ -21,11 +21,12 @@ axios.interceptors.request.use( ...@@ -21,11 +21,12 @@ axios.interceptors.request.use(
// 设置参数格式 // 设置参数格式
if (!config.headers['Content-Type']) { if (!config.headers['Content-Type']) {
config.headers = { config.headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json'
}; };
} }
// 添加token到headers // 添加token到headers
if (token) { if (token) {
console.log(23232323)
config.headers.token = token config.headers.token = token
} }
// 鉴权参数设置 // 鉴权参数设置
...@@ -171,7 +172,8 @@ export function upload(url, json) { ...@@ -171,7 +172,8 @@ export function upload(url, json) {
export function fetch(url, params = {}) { export function fetch(url, params = {}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.get(url, { axios.get(url, {
params: params params: params,
headers: { token: token, platform: 'web' }
}) })
.then(response => { .then(response => {
// if(url == process.env.API_URL+'api/client/user/bind/chance'||url == process.env.API_URL+'api/client/me'){ // if(url == process.env.API_URL+'api/client/user/bind/chance'||url == process.env.API_URL+'api/client/me'){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment