Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
traceSourceMb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yanyanhong
traceSourceMb
Commits
34a03c69
Commit
34a03c69
authored
Jun 01, 2020
by
yyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码调整
parent
cc8b88d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
+14
-8
index.ts
src/components/index.ts
+7
-4
main.ts
src/main.ts
+2
-1
http.ts
src/utils/http.ts
+5
-3
No files found.
src/components/index.ts
View file @
34a03c69
import
Vue
from
'vue'
;
import
{
importAll
}
from
'@/utils/utils'
;
import
{
importAll
}
from
'@/utils/utils'
;
const
components
=
importAll
(
require
.
context
(
'./'
,
true
,
/
\.
vue$/
));
const
components
=
importAll
(
require
.
context
(
'./'
,
true
,
/
\.
vue$/
));
Object
.
keys
(
components
).
forEach
(
key
=>
{
export
default
{
Vue
.
component
(
key
,
components
[
key
]);
install
(
Vue
:
any
)
{
});
Object
.
keys
(
components
).
forEach
(
key
=>
{
Vue
.
component
(
key
,
components
[
key
]);
});
},
};
src/main.ts
View file @
34a03c69
...
@@ -5,7 +5,8 @@ import store from './store';
...
@@ -5,7 +5,8 @@ import store from './store';
import
api
from
'./api'
;
import
api
from
'./api'
;
Vue
.
prototype
.
$api
=
api
;
Vue
.
prototype
.
$api
=
api
;
import
'@/components'
;
import
components
from
'@/components'
;
Vue
.
use
(
components
);
import
'@/filter'
;
import
'@/filter'
;
import
VueClipboard
from
'vue-clipboard2'
;
import
VueClipboard
from
'vue-clipboard2'
;
...
...
src/utils/http.ts
View file @
34a03c69
...
@@ -101,9 +101,11 @@ instance.interceptors.request.use(
...
@@ -101,9 +101,11 @@ instance.interceptors.request.use(
config
.
cancelToken
=
new
CancelToken
((
c
)
=>
{
config
.
cancelToken
=
new
CancelToken
((
c
)
=>
{
removePendingAjax
(
config
,
c
);
removePendingAjax
(
config
,
c
);
});
});
let
userInfo
=
localStorage
.
getItem
(
'userInfo'
);
let
userInfo
:
any
=
localStorage
.
getItem
(
'userInfo'
);
userInfo
=
userInfo
?
JSON
.
parse
(
userInfo
)
:
{};
if
(
userInfo
)
{
config
.
headers
.
Authorization
=
(
userInfo
as
any
).
token
||
''
;
userInfo
=
JSON
.
parse
(
userInfo
);
config
.
headers
.
Authorization
=
userInfo
?.
token
;
}
return
config
;
return
config
;
},
},
(
error
:
any
)
=>
Promise
.
reject
(
error
));
(
error
:
any
)
=>
Promise
.
reject
(
error
));
...
...
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