Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
vite-integral
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4fa516c1
authored
Aug 17, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
http修改
1 parent
9704a903
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
src/utils/http.ts
src/utils/http.ts
View file @
4fa516c
...
...
@@ -3,23 +3,20 @@ import { Toast } from 'vant';
import
router
from
'../router'
import
qs
from
'qs'
import
{
createSign
}
from
'./util'
const
sign
=
{
v
:
'1.0.0'
,
format
:
'json'
,
source
:
'vite-integral'
,
appKey
:
'48e5e13229b82c1b4e6e8c96151f0637'
}
const
secret
=
'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const
response
=
{
data_key
:
'data'
,
message_key
:
'message'
,
code_key
:
'code'
,
code_success_value
:
'0'
,
errId_logout_value
:
'10039'
,
logout_function
:
'reLogin'
,
code_message_map
:
{}
const
options
:
any
=
localStorage
.
getItem
(
'config'
)
interface
Config
{
response
:
object
,
request
:
{
baseURL
:
string
},
secret
:
string
,
sign
:
object
,
vconsole
:
boolean
}
// const { response = {}, request = {}, headers = {}, alert, sign, signWay = 'sha1', secret } = options
const
config
:
Config
=
JSON
.
parse
(
options
)
const
{
response
,
request
,
sign
,
secret
}
=
config
axios
.
defaults
.
baseURL
=
request
.
baseURL
// 配置新建一个axios 实例
const
service
:
AxiosInstance
=
axios
.
create
({
timeout
:
50000
,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment