Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
web-site
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
张冬
web-site
Commits
3064ea15
Commit
3064ea15
authored
Sep 24, 2020
by
吴冠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理报错
parent
6c12c66f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
110 additions
and
45 deletions
+110
-45
GoTop.vue
components/GoTop.vue
+67
-0
header.vue
components/header.vue
+10
-7
homeinput.vue
components/homeinput.vue
+1
-1
jsconfig.json
jsconfig.json
+1
-0
nuxt.config.js
nuxt.config.js
+5
-1
index.vue
pages/index/index.vue
+15
-15
biding.vue
pages/index/notice/biding.vue
+1
-12
go-top.js
plugins/go-top.js
+6
-0
request.js
utils/request.js
+4
-9
No files found.
components/GoTop.vue
0 → 100644
View file @
3064ea15
<
template
>
<div
id=
"go-top"
v-if=
"isShow"
@
click=
"goTop"
class=
"iconfont icon-arrowsupline"
></div>
</
template
>
<
script
>
export
default
{
props
:
[
'step'
,
'scroll'
],
data
()
{
return
{
isShow
:
false
}
},
created
()
{
const
$this
=
this
window
.
onscroll
=
function
()
{
if
(
document
.
documentElement
.
scrollTop
+
document
.
body
.
scrollTop
>
$this
.
scroll
)
{
$this
.
isShow
=
true
}
else
{
$this
.
isShow
=
false
}
}
},
methods
:
{
goTop
()
{
const
$this
=
this
let
timer
=
setInterval
(
function
()
{
if
(
document
.
body
.
scrollTop
)
{
document
.
body
.
scrollTop
-=
$this
.
step
if
(
document
.
body
.
scrollTop
<=
0
)
{
document
.
body
.
scrollTop
=
0
clearInterval
(
timer
)
}
}
else
{
document
.
documentElement
.
scrollTop
-=
$this
.
step
if
(
document
.
documentElement
.
scrollTop
<=
0
)
{
document
.
documentElement
.
scrollTop
=
0
clearInterval
(
timer
)
}
}
},
23
)
}
}
}
</
script
>
<
style
scoped
>
#go-top
{
position
:
fixed
;
bottom
:
100px
;
right
:
50px
;
cursor
:
pointer
;
height
:
50px
;
width
:
50px
;
line-height
:
50px
;
text-align
:
center
;
border
:
2px
solid
#333
;
color
:
#333
;
font-size
:
20px
;
border-radius
:
5px
;
transition
:
all
.5s
;
}
#go-top
:hover
{
border-radius
:
50%
;
color
:
#fff
;
background
:
#333
;
}
</
style
>
components/header.vue
View file @
3064ea15
...
...
@@ -15,9 +15,9 @@
</div>
</div>
<div
class=
"flex-item t1 collection"
>
<div
@
click=
"addFavo"
>
收藏网站
</div>
<img
@
click=
"addFavo"
src=
"~/assets/head/collection.png"
alt=
"收藏"
>
<div
@
click=
"admin"
>
管理员入口
</div>
<div
@
click=
"addFavo"
class=
"t5"
>
收藏网站
</div>
<img
@
click=
"addFavo"
src=
"~/assets/head/collection.png"
alt=
"收藏"
class=
"t5"
>
<div
@
click=
"admin"
class=
"t5"
>
管理员入口
</div>
</div>
</div>
</div>
...
...
@@ -30,10 +30,10 @@
},
mounted
(){
let
tokenStr
=
sessionStorage
.
getItem
(
"token"
)
let
tokenStr
=
window
.
sessionStorage
.
getItem
(
"token"
)
if
(
tokenStr
){
this
.
showDefault
=
false
this
.
userName
=
sessionStorage
.
getItem
(
"companyName"
)
this
.
userName
=
window
.
sessionStorage
.
getItem
(
"companyName"
)
}
},
data
()
{
...
...
@@ -52,7 +52,7 @@
this
.
$router
.
push
(
"/login/admin"
)
},
jump
(){
let
token
=
sessionStorage
.
getItem
(
"token"
)
let
token
=
window
.
sessionStorage
.
getItem
(
"token"
)
if
(
token
){
/* window.location.href="http://192.168.200.201:8082/#/purchaser/Home" */
window
.
location
.
href
=
`http://192.168.200.201:8082/#/purchaser/Home?token=
${
token
}
`
...
...
@@ -60,7 +60,7 @@
/* window.location.href=`http://192.168.200.201:8082/#/purchaser/Home?token=${token}` */
},
getUserName
(){
return
sessionStorage
.
getItem
(
"companyName"
);
return
window
.
sessionStorage
.
getItem
(
"companyName"
);
}
},
...
...
@@ -115,4 +115,7 @@
.welcome
>
.login
{
color
:
#FF0000
;
}
.t5
{
cursor
:
pointer
}
</
style
>
components/homeinput.vue
View file @
3064ea15
...
...
@@ -22,7 +22,7 @@ import {getAllList} from '@/common/list.js'
methods
:{
async
toSearch
(){
this
.
$router
.
push
(
'notice/all'
)
sessionStorage
.
setItem
(
"content"
,
this
.
input
)
window
.
sessionStorage
.
setItem
(
"content"
,
this
.
input
)
}
},
data
()
{
...
...
jsconfig.json
View file @
3064ea15
...
...
@@ -10,3 +10,4 @@
},
"exclude"
:
[
"node_modules"
,
".nuxt"
,
"dist"
]
}
nuxt.config.js
View file @
3064ea15
...
...
@@ -43,7 +43,11 @@ export default {
plugins
:
[
'@/plugins/element-ui'
,
'@/assets/css/common.css'
,
{
src
:
'~/plugins/go-top'
,
ssr
:
false
}
],
/*
** Auto import components
...
...
pages/index/index.vue
View file @
3064ea15
...
...
@@ -79,13 +79,13 @@
<
script
>
import
{
getLoopPic
}
from
'@/common/list.js'
import
{
getSecond
,
get
CategoryList
,
get
ListSite
,
getListSite1
,
getListSite2
}
from
'@/common/list.js'
import
{
getSecond
,
getListSite
,
getListSite1
,
getListSite2
}
from
'@/common/list.js'
export
default
{
created
(){
this
.
getLoopPic
()
},
mounted
(){
this
.
getSecond
()
//文章列表
/* this.getCategoryList() */
this
.
getLoopPic
()
this
.
getListSite
()
this
.
getListSite1
()
this
.
getListSite2
()
...
...
@@ -109,21 +109,21 @@ import {getSecond,getCategoryList,getListSite,getListSite1,getListSite2} from '@
this.dynamicList = data
}, */
async
getListSite
(){
let
me
ssage
=
{}
me
ssage
.
cateId
=
124
const
{
data
,
id
}
=
await
getListSite
(
me
ssage
)
let
me
=
{}
me
.
cateId
=
124
const
{
data
,
id
}
=
await
getListSite
(
me
)
this
.
dynamic1
=
data
},
async
getListSite1
(){
let
mes
sage
=
{}
mes
sage
.
cateId
=
125
const
{
data
}
=
await
getListSite1
(
mes
sage
)
let
mes
=
{}
mes
.
cateId
=
125
const
{
data
}
=
await
getListSite1
(
mes
)
this
.
dynamic2
=
data
},
async
getListSite2
(){
let
mess
age
=
{}
mess
age
.
cateId
=
123
const
{
data
}
=
await
getListSite2
(
mess
age
)
let
mess
=
{}
mess
.
cateId
=
123
const
{
data
}
=
await
getListSite2
(
mess
)
this
.
dynamic3
=
data
},
//添加验证方法
...
...
@@ -131,7 +131,7 @@ import {getSecond,getCategoryList,getListSite,getListSite1,getListSite2} from '@
let
tokenStr
=
sessionStorage
.
getItem
(
'token'
)
if
(
tokenStr
){
this
.
showDefault
=
false
sessionStorage
.
setItem
(
"websiteenRequestTokenRequest"
,
10
)
/* window.sessionStorage.setItem("websiteenRequestTokenRequest",10) */
const
{
data
}
=
await
getSecond
()
sessionStorage
.
setItem
(
"companyName"
,
data
.
companyName
)
this
.
userName
=
sessionStorage
.
getItem
(
"companyName"
)
...
...
@@ -152,7 +152,7 @@ import {getSecond,getCategoryList,getListSite,getListSite1,getListSite2} from '@
},
//添加退出按钮 清空token
checkout
(){
sessionStorage
.
clear
()
window
.
sessionStorage
.
clear
()
this
.
$router
.
push
(
"/login/user"
)
},
},
...
...
pages/index/notice/biding.vue
View file @
3064ea15
...
...
@@ -199,18 +199,7 @@ export default {
this
.
industryoptions
=
res
;
},
async
getWinList
(
params
)
{
const
{
data
,
total
}
=
await
getWinList
(
params
);
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
(
data
[
i
].
auditStatus
===
0
)
{
data
[
i
].
auditStatus
=
"待审核"
;
}
if
(
data
[
i
].
auditStatus
===
1
)
{
data
[
i
].
auditStatus
=
"审核通过"
;
}
if
(
data
[
i
].
auditStatus
===
2
)
{
data
[
i
].
auditStatus
=
"未通过"
;
}
}
const
{
data
,
total
}
=
await
getWinList
(
params
)
this
.
total
=
total
;
this
.
priceList
=
data
;
},
...
...
plugins/go-top.js
0 → 100644
View file @
3064ea15
import
Vue
from
'vue'
import
GoTop
from
'../components/GoTop'
Vue
.
component
(
'GoTop'
,
GoTop
)
\ No newline at end of file
utils/request.js
View file @
3064ea15
...
...
@@ -40,12 +40,6 @@ service.interceptors.request.use(config => {
//如果不是首页token验证接口,则按照原逻辑处理
console
.
log
(
error
)
// for debug
Promise
.
reject
(
error
)
// if(config.params && config.params['websiteIndexTokenAuth']){
// }
})
...
...
@@ -88,7 +82,7 @@ service.interceptors.response.use(
// }
if
(
res
.
status
==
200
)
{
return
res
.
data
return
res
.
data
}
else
{
console
.
log
(
'接口错误'
)
}
...
...
@@ -97,9 +91,10 @@ service.interceptors.response.use(
console
.
log
(
error
)
//如果不在首页 不验证token信息
if
(
error
.
response
.
status
==
401
){
/* console.log(error+'++++++++++++++++++++++++')
console.log(error.response.status+'--------------------')
//获取首页token验证时传递的特殊参数值
const websiteenRequestTokenRequest = sessionStorage.getItem('websiteenRequestTokenRequest')
console
.
log
(
websiteenRequestTokenRequest
+
'--------------------------'
)
//判断值是不是存在,存在说明是首页token接口
if(websiteenRequestTokenRequest){
//如果是首页验证问题,则不处理任何逻辑,同时清除掉缓存token信息
...
...
@@ -107,7 +102,7 @@ service.interceptors.response.use(
sessionStorage.removeItem('websiteenRequestTokenRequest');
sessionStorage.removeItem('companyName');
return ;
}
}
*/
sessionStorage
.
removeItem
(
'token'
)
Message
.
error
(
"登录失效,请重新登录"
)
setTimeout
(
function
(){
...
...
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