Commit adb233f3 by 潘建波

暂时去除登录星云效果

1 parent db60e2e7
No preview for this file type
......@@ -6,36 +6,36 @@
<script>
export default {
data() {
return {
}
return {};
},
created(){
let menus = JSON.parse(localStorage.getItem('menu'))
if(menus) {
this.$store.dispatch('GetMenuRole',menus).then(res => {})
created() {
let menus = JSON.parse(localStorage.getItem("menu"));
if (menus) {
this.$store.dispatch("GetMenuRole", menus).then(res => {});
}
let token = localStorage.getItem("atoken");
if (!token) {
this.$router.push("/login");
}
},
mounted(){
window.videoEquitTableHeight = document.body.clientHeight - 142 + 'px';
window.opsTableHeight = document.body.clientHeight - 260 + 'px';
if(document.body.clientWidth>1366){
window.oneSearchTableHeight = document.body.clientHeight - 250 + 'px';
window.twoSearchTableHeight = document.body.clientHeight - 280 + 'px';
}else {
window.oneSearchTableHeight = document.body.clientHeight - 280 + 'px';
window.twoSearchTableHeight = document.body.clientHeight - 315 + 'px';
mounted() {
window.videoEquitTableHeight = document.body.clientHeight - 142 + "px";
window.opsTableHeight = document.body.clientHeight - 260 + "px";
if (document.body.clientWidth > 1366) {
window.oneSearchTableHeight = document.body.clientHeight - 250 + "px";
window.twoSearchTableHeight = document.body.clientHeight - 280 + "px";
} else {
window.oneSearchTableHeight = document.body.clientHeight - 280 + "px";
window.twoSearchTableHeight = document.body.clientHeight - 315 + "px";
}
}
}
};
</script>
<style lang="scss">
#app {
height: 100%;
font-family:MicrosoftYaHeiUI;
font-family: MicrosoftYaHeiUI;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
......
import axios from 'axios'
import store from '../store/index.js'
import axios from "axios";
import store from "../store/index.js";
import router from "../router/index";
// 创建 axios 实例
let service = axios.create({
// headers: {'Content-Type': 'application/json'},
timeout: 60000
})
});
// 添加请求拦截器
service.interceptors.request.use(
(config) => {
if (store.state.users.atoken) { // 判断是否存在token,如果存在的话,则每个http header都加上token
config.headers.authorization = store.state.users.atoken;
config => {
let token = localStorage.getItem("atoken");
if (token) {
// 判断是否存在token,如果存在的话,则每个http header都加上token
config.headers.authorization = token;
} else {
router.push("/login");
}
if (config.method == 'get') {
if (config.method == "get") {
config.params = {
_t: Date.parse(new Date()) / 1000,
...config.params
};
}
}
return config
return config;
},
(error) => {
error => {
// 请求错误处理
return Promise.reject(error)
return Promise.reject(error);
}
)
);
// 添加响应拦截器
service.interceptors.response.use(
(response) => {
let { data } = response
return data
response => {
let { data } = response;
return data;
},
(error) => {
console.log(error)
return Promise.reject(error)
error => {
console.log(error);
return Promise.reject(error);
}
)
);
/**
* 创建统一封装过的 axios 实例
* @return {AxiosInstance}
*/
export default function() {
return service
return service;
}
......@@ -18,10 +18,10 @@ Vue.prototype.$echarts = echarts;
Vue.prototype.$moment = moment;
Vue.prototype.$buildCode = buildCode;
Vue.prototype.oParse = new XML.ObjTree();
Vue.prototype.axios=axios;
Vue.prototype.axios = axios;
import VueParticles from 'vue-particles'
Vue.use(VueParticles)
// import VueParticles from "vue-particles";
// Vue.use(VueParticles);
Vue.use(api);
Vue.use(ElementUI, { size: "small", zIndex: 3000 });
......
......@@ -35,6 +35,7 @@
</template>
<script>
import types from "../../store/types.js";
// import HelloWorld from "@/components/HelloWorld.vue";
import menus from "./menu";
export default {
......@@ -110,11 +111,10 @@ export default {
this.curdate = `${Y}/${M}/${D} ${h}:${m}:${s} ${wtext}`;
},
logout() {
localStorage.removeItem("atkoen");
localStorage.removeItem("menu");
localStorage.removeItem("curmenu");
this.$store.commit(types.ATOKEN, "");
localStorage.removeItem("atkoen");
localStorage.removeItem("atoken");
this.$router.push("/login");
}
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!