Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
R
revised-version-h5
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
孟庆瑞
revised-version-h5
Commits
b7b07502
Commit
b7b07502
authored
Sep 12, 2024
by
mengqr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改框架token
parent
bff5f87c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
index.js
src/config/index.js
+1
-1
request.js
src/utils/request.js
+3
-3
No files found.
src/config/index.js
View file @
b7b07502
...
@@ -5,7 +5,7 @@ export default {
...
@@ -5,7 +5,7 @@ export default {
dev
:
'https://test6.douniu8.com/'
,
// 开发路径
dev
:
'https://test6.douniu8.com/'
,
// 开发路径
// dev: 'https://autumnfish.cn',
// dev: 'https://autumnfish.cn',
// dev: 'http://10.0.0.147:8301',
// dev: 'http://10.0.0.147:8301',
pro
:
'https://
autumnfish.cn
'
// 生产路径
pro
:
'https://
test6.douniu8.com/
'
// 生产路径
},
},
/****** request拦截器==>对请求参数做处理 ******/
/****** request拦截器==>对请求参数做处理 ******/
...
...
src/utils/request.js
View file @
b7b07502
...
@@ -22,15 +22,15 @@ service.interceptors.request.use(config => {
...
@@ -22,15 +22,15 @@ service.interceptors.request.use(config => {
//
let token='eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE3MjY2NTY2NjUsInN1YiI6IjQ4MjY2NiIsImlhdCI6MTcyNjA1MTg2NX0.obv2AOw311MIF_Wx9ese0IS4BhE3CY3hEy7NFi17VovEc24hpQw-i8_ZaftK6NKd_AY0Q0bfU62I-wEGGiNx_Q'
let
token
=
'eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE3MjY2NTY2NjUsInN1YiI6IjQ4MjY2NiIsImlhdCI6MTcyNjA1MTg2NX0.obv2AOw311MIF_Wx9ese0IS4BhE3CY3hEy7NFi17VovEc24hpQw-i8_ZaftK6NKd_AY0Q0bfU62I-wEGGiNx_Q'
let
token
=
localStorage
.
getItem
(
"getToken"
)
//
let token= localStorage.getItem("getToken")
// Bearer eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE3MjY2NTY2NjUsInN1YiI6IjQ4MjY2NiIsImlhdCI6MTcyNjA1MTg2NX0.obv2AOw311MIF_Wx9ese0IS4BhE3CY3hEy7NFi17VovEc24hpQw-i8_ZaftK6NKd_AY0Q0bfU62I-wEGGiNx_Q
// Bearer eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE3MjY2NTY2NjUsInN1YiI6IjQ4MjY2NiIsImlhdCI6MTcyNjA1MTg2NX0.obv2AOw311MIF_Wx9ese0IS4BhE3CY3hEy7NFi17VovEc24hpQw-i8_ZaftK6NKd_AY0Q0bfU62I-wEGGiNx_Q
config
.
headers
=
{
config
.
headers
=
{
'Content-Type'
:
'application/json'
,
//配置请求头
'Content-Type'
:
'application/json'
,
//配置请求头
'Authorization'
:
'Bearer'
+
token
'Authorization'
:
'Bearer
'
+
token
}
}
//如有需要:注意使用token的时候需要引入cookie方法或者用本地localStorage等方法,推荐js-cookie
//如有需要:注意使用token的时候需要引入cookie方法或者用本地localStorage等方法,推荐js-cookie
//const token = getCookie('名称');//这里取token之前,你肯定需要先拿到token,存一下
//const token = getCookie('名称');//这里取token之前,你肯定需要先拿到token,存一下
...
...
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