Commit 3064ea15 authored by 吴冠's avatar 吴冠

处理报错

parent 6c12c66f
<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>
......@@ -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>
......@@ -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() {
......
......@@ -10,3 +10,4 @@
},
"exclude": ["node_modules", ".nuxt", "dist"]
}
......@@ -43,6 +43,10 @@ export default {
plugins: [
'@/plugins/element-ui',
'@/assets/css/common.css',
{
src: '~/plugins/go-top',
ssr: false
}
],
/*
......
......@@ -79,13 +79,13 @@
<script>
import {getLoopPic} from '@/common/list.js'
import {getSecond,getCategoryList,getListSite,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 message = {}
message.cateId = 124
const {data,id} = await getListSite(message)
let me = {}
me.cateId = 124
const {data,id} = await getListSite(me)
this.dynamic1 = data
},
async getListSite1(){
let message = {}
message.cateId = 125
const {data} = await getListSite1(message)
let mes = {}
mes.cateId = 125
const {data} = await getListSite1(mes)
this.dynamic2 = data
},
async getListSite2(){
let message = {}
message.cateId = 123
const {data} = await getListSite2(message)
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")
},
},
......
......@@ -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;
},
......
import Vue from 'vue'
import GoTop from '../components/GoTop'
Vue.component('GoTop', GoTop)
\ No newline at end of file
......@@ -42,12 +42,6 @@ service.interceptors.request.use(config => {
Promise.reject(error)
// if(config.params && config.params['websiteIndexTokenAuth']){
// }
})
// respone拦截器
......@@ -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(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment