feat:chrome插件提交
This commit is contained in:
parent
7d04719990
commit
b804ee8520
@ -33,6 +33,7 @@ axios.interceptors.request.use(
|
||||
axios.interceptors.response.use(
|
||||
res => {
|
||||
if (res.data.code === -1) {
|
||||
localStorage.removeItem('token');
|
||||
window.vueInstance.$router.replace('/public/login');
|
||||
} else if (res.data.code === 1) {
|
||||
return res.data.data;
|
||||
|
@ -10,7 +10,9 @@
|
||||
<el-button slot="append" icon="el-icon-search"></el-button>
|
||||
</el-input>
|
||||
<div class="searchResult">
|
||||
<div class="item" v-for="item in searchList" :key="item.bookmarkId"><a target="_blank" :href="item.url">{{item.name}}</a></div>
|
||||
<div class="item" v-for="item in searchList" :key="item.bookmarkId">
|
||||
<a target="_blank" :href="item.url">{{ item.name }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -22,14 +24,14 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
personInfo: {},
|
||||
searchContent: "",
|
||||
searchContent: '',
|
||||
searchList: [],
|
||||
timeOut: null
|
||||
timeOut: null,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
searchContent(newVal, oldVal) {
|
||||
if (newVal.trim() != oldVal) {
|
||||
if (newVal.trim() !== oldVal) {
|
||||
if (this.timeOut != null) {
|
||||
clearTimeout(this.timeOut);
|
||||
}
|
||||
@ -39,7 +41,7 @@ export default {
|
||||
this.timeOut = null;
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
window.token = localStorage.getItem('token');
|
||||
@ -47,11 +49,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async init() {
|
||||
let personInfo = await axios.get("/user/currentUserInfo");
|
||||
let personInfo = await axios.get('/user/currentUserInfo');
|
||||
window.personInfo = personInfo;
|
||||
this.personInfo = personInfo;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user