Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
smart-web-router
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
SVI
svi-templates
smart-web-router
Commits
bb311198
Commit
bb311198
authored
Apr 01, 2020
by
曾沂轮
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-addAnounceAndStyleLogin' into 'master'
Feat: 添加公告模块并调整登陆授权方式 See merge request
!4
parents
5b4d5a02
d4af0e59
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
14 deletions
+35
-14
config.js
template/config/config.js
+7
-1
package.json
template/package.json
+2
-2
config.js
template/src/api/config.js
+5
-11
businessConfig.js
template/src/router/routes/businessConfig.js
+5
-0
announce.vue
template/src/views/businessConfig/announce.vue
+16
-0
No files found.
template/config/config.js
View file @
bb311198
...
@@ -9,9 +9,15 @@ axios.defaults.withCredentials = true;
...
@@ -9,9 +9,15 @@ axios.defaults.withCredentials = true;
// 设置全局的请求次数,请求的间隙
// 设置全局的请求次数,请求的间隙
axios
.
defaults
.
retry
=
0
;
axios
.
defaults
.
retry
=
0
;
axios
.
defaults
.
retryDelay
=
1000
;
axios
.
defaults
.
retryDelay
=
1000
;
axios
.
defaults
.
headers
.
common
[
'auth-token'
]
=
window
.
localStorage
.
getItem
(
'south-samrtweb-token'
)
||
''
;
// 请求超时拦截,重新请求
// 请求超时拦截,重新请求
axios
.
interceptors
.
response
.
use
(
undefined
,
function
axiosRetryInterceptor
(
err
)
{
axios
.
interceptors
.
response
.
use
(
function
(
response
)
{
if
(
response
.
status
===
200
&&
response
.
data
.
data
&&
response
.
data
.
data
.
hasOwnProperty
(
'token'
))
{
window
.
localStorage
.
setItem
(
'south-samrtweb-token'
,
response
.
data
.
data
.
token
);
axios
.
defaults
.
headers
.
common
[
'auth-token'
]
=
window
.
localStorage
.
getItem
(
'south-samrtweb-token'
)
||
''
;
}
},
function
axiosRetryInterceptor
(
err
)
{
const
config
=
err
.
config
;
const
config
=
err
.
config
;
// If config does not exist or the retry option is not set, reject
// If config does not exist or the retry option is not set, reject
if
(
!
config
||
!
config
.
retry
)
return
Promise
.
reject
(
err
);
if
(
!
config
||
!
config
.
retry
)
return
Promise
.
reject
(
err
);
...
...
template/package.json
View file @
bb311198
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
},
},
"dependencies"
:
{
"dependencies"
:
{
"core-js"
:
"^2.6.5"
,
"core-js"
:
"^2.6.5"
,
"smart-charts"
:
"^1.0.0
-alpha
"
,
"smart-charts"
:
"^1.0.0"
,
"smart-web"
:
"^2.
2.4
"
,
"smart-web"
:
"^2.
3.0
"
,
"vue"
:
"^2.6.10"
,
"vue"
:
"^2.6.10"
,
"vue-progressbar"
:
"^0.7.5"
,
"vue-progressbar"
:
"^0.7.5"
,
"vue-router"
:
"^3.1.3"
,
"vue-router"
:
"^3.1.3"
,
...
...
template/src/api/config.js
View file @
bb311198
...
@@ -12,6 +12,7 @@ axios.defaults.retry = 1;
...
@@ -12,6 +12,7 @@ axios.defaults.retry = 1;
axios
.
defaults
.
retryDelay
=
1000
;
axios
.
defaults
.
retryDelay
=
1000
;
// 设置defaults.baseURL
// 设置defaults.baseURL
axios
.
defaults
.
baseURL
=
_config
.
baseUrl
;
axios
.
defaults
.
baseURL
=
_config
.
baseUrl
;
axios
.
defaults
.
headers
.
common
[
'auth-token'
]
=
window
.
localStorage
.
getItem
(
'south-samrtweb-token'
)
||
''
;
// 请求超时拦截,重新请求
// 请求超时拦截,重新请求
axios
.
interceptors
.
response
.
use
(
function
(
response
)
{
axios
.
interceptors
.
response
.
use
(
function
(
response
)
{
...
@@ -24,17 +25,10 @@ axios.interceptors.response.use(function(response) {
...
@@ -24,17 +25,10 @@ axios.interceptors.response.use(function(response) {
message
:
'请求服务好像出错了,'
+
status
message
:
'请求服务好像出错了,'
+
status
});
});
return
Promise
.
reject
(
response
);
return
Promise
.
reject
(
response
);
}
/* else if (data.status === 2) {
}
else
if
(
response
.
data
.
data
&&
response
.
data
.
data
.
hasOwnProperty
(
'token'
))
{
Message({
window
.
localStorage
.
setItem
(
'south-samrtweb-token'
,
response
.
data
.
data
.
token
);
type: 'error',
axios
.
defaults
.
headers
.
common
[
'auth-token'
]
=
window
.
localStorage
.
getItem
(
'south-samrtweb-token'
)
||
''
;
message: '请求服务后台处理出现了错误'
}
});
} else if (data.status === 1) {
Message({
type: 'warning',
message: '请求服务处理出现了异常,' + data.message
});
} */
return
Promise
.
resolve
(
response
);
return
Promise
.
resolve
(
response
);
},
function
axiosRetryInterceptor
(
err
)
{
},
function
axiosRetryInterceptor
(
err
)
{
...
...
template/src/router/routes/businessConfig.js
View file @
bb311198
...
@@ -3,5 +3,10 @@ export default [
...
@@ -3,5 +3,10 @@ export default [
path
:
'businessConfiguration'
,
path
:
'businessConfiguration'
,
name
:
'businessConfiguration'
,
name
:
'businessConfiguration'
,
component
:
()
=>
import
(
'@/views/businessConfig/businessConfiguration'
),
component
:
()
=>
import
(
'@/views/businessConfig/businessConfiguration'
),
},
{
path
:
'announce'
,
name
:
'announce'
,
component
:
()
=>
import
(
'@/views/businessConfig/announce'
)
}
}
];
];
template/src/views/businessConfig/announce.vue
0 → 100644
View file @
bb311198
<
template
>
<sw-announce></sw-announce>
</
template
>
<
script
>
import
SwAnnounce
from
'smart-web/packages/announce'
;
import
'smart-web/packages/styles/src/announce.scss'
;
export
default
{
name
:
'announce'
,
components
:
{
SwAnnounce
}
};
</
script
>
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