Commit 9c8647f7 by 莫晓莉

登录机制更改

parent 8adbea92
......@@ -41,7 +41,8 @@ export function newsFromBoard(data) {
// 文章详情
export function newsDetail(data) {
return request({
url: `websiteCluster/website/newsDetail`,
// url: `websiteCluster/website/newsDetail`,
url: `websiteCluster/web/newsDetail`,
data,
method: 'post'
})
......
......@@ -11,11 +11,7 @@ Vue.prototype.push = function push(location) {
};
const constantRouterMap = [
{
path: "/verifyLogin",
name: 'verifyLogin',
component: resolve => require(["@/views/verifyLogin"], resolve),
},
{
path: "/",
name: "home",
......@@ -181,12 +177,7 @@ const constantRouterMap = [
meta: { title: '详情', icon: '' },
component: resolve => require(["@/views/detail"], resolve),
},
{
path: "/manage",
name: 'manage',
meta: { title: '栏目', icon: '' },
component: resolve => require(["@/views/manage"], resolve),
},
// {
// path: "/homePage",
// name: 'homePage',
......@@ -194,7 +185,22 @@ const constantRouterMap = [
// component: resolve => require(["@/views/homePage"], resolve),
// },
],
}, ];
},
{
path: "/manage",
name: 'manage',
meta: { title: '栏目', icon: '' },
component: resolve => require(["@/views/manage"], resolve),
},
{
path: "/verifyLogin",
name: 'verifyLogin',
component: resolve => require(["@/views/verifyLogin"], resolve),
},
];
export default new Router({
mode: "hash",
......
......@@ -84,7 +84,7 @@
<div
style="text-align: center; font-size: 14px; margin-top: 15px"
>
您必须先的<span style="color: #d33237">登录</span>才能发表评论
您必须先的<span style="color: #d33237" @click="loginEvent">登录</span>才能发表评论
</div>
</el-row>
</div>
......@@ -247,6 +247,7 @@
</template>
<script>
import {newsDetail} from "@/api/homePage.js"
import { removeToken } from "@/utils/auth";
export default {
name: "show",
......@@ -327,6 +328,17 @@ export default {
console.log("111===", i);
this.activeItem = i;
},
loginEvent(){
removeToken();
// alert('11111',process.env.VUE_APP_LOGIN_API);
// removeToken();
// console.log('loginURL11111111111111==',loginURL );
// var loginURL  = process.env.VUE_APP_LOGIN_API;
console.log('loginURL222222222222==',process.env.VUE_APP_LOGIN_API);
// location.href = loginURL ;
location.href = process.env.VUE_APP_LOGIN_API
},
},
};
</script>
......
......@@ -12,12 +12,12 @@
<!--<div class="title-txt">会议管理模块</div>-->
</el-col>
<el-col :span="10">
<div class="center-txt">
<div class="center-txt" v-if="userInfo.id">
法院:{{ userInfo.courtCode }}&ensp;部门:{{ userInfo.dept?userInfo.dept.name:'' }}&ensp;姓名:{{ userInfo.nickName }}
</div>
</el-col>
<el-col :span="5" class="top-btn">
<div class="top-btn-item">
<!-- <div class="top-btn-item">
<img
:src="require('../assets/iconImg/01-首页/使用手册.png')"
alt=""
......@@ -30,8 +30,8 @@
alt=""
/>
<div class="top-btn-item-text">系统设置</div>
</div>
<div @click="loginOut" class="top-btn-item" >
</div> -->
<div @click="loginOut" class="top-btn-item" v-if="userInfo.id">
<img :src="require('../assets/iconImg/01-首页/退出.png')" alt="" />
<div class="top-btn-item-text">退出</div>
</div>
......@@ -67,7 +67,7 @@ import menuHead from "@/views/layout/menu";
import { mapGetters, mapMutations } from "vuex";
import { setUserInfo } from "@/utils/auth";
import { getInfo,logout } from "@/api/login";
import { removeToken } from "@/utils/auth";
import { removeToken,getToken } from "@/utils/auth";
export default {
components: {
// topHead,
......@@ -79,7 +79,10 @@ export default {
};
},
created() {
if(getToken()){
this.getUserInfo();
}
},
computed:{
...mapGetters(['user']),
......@@ -96,6 +99,7 @@ export default {
loginOut() {
logout().then((res) => {
removeToken();
// this.$router.push("/");
location.href = res.data;
});
},
......
<template>
<div>
<div class="nav">
<div class="nav-a">
<ul class="nav-a-ul">
<li class="nav-a-li" :class="classA == index ? 'active' : '' " @click="selected(index)" v-for="(item,index) in configNav">
<router-link :to='item.path' class="nav-a-text" @click="showToggle(index)">{{item.name}}</router-link>
<div v-if="item.subItems" class="submenu-container" >
<ul class="menu_ul" :class="{'active' :index===isShow}">
<li class="menu_li" v-for = "nav in item.subItems" :class="classB == nav ? 'active' : '' " @click="menuselected(nav)">
<router-link class="menu_ul_text" :to="nav.link" :class="{'active':nav.link == linkClick}" @click = "treeNavSwitch(nav)">{{nav.text}}</router-link>
</li>
</ul>
</div>
</li>
</ul>
</div>
</div>
</div>
</template>
<script>
export default {
data(){
return{
classA: 0,
classB: 0,
isShow: 0,
linkClick: "",
configNav: [
{
name: "首页",
path:'homePage',
},
{
name: "法院新闻",
path:'',
subItems:[
{ link:'/education',text: '教学管理系统'},
{ link:'/yingxiaozhaosheng',text: '营销招生系统' },
{ link:'',text: '视频直播系统' },
{ link:'',text: '个性化定制服务' }
]
},
{
name: "工作信息",
path:'/show',
},
{
name: "法院业务",
path:'/aboutour',
},
{
name: "干警作品",
path:'/aboutour',
},
{
name: "娱乐",
path:'/aboutour',
},
{
name: "全区法院",
path:'/aboutour',
},
{
name: "信息发布系统",
path:'/aboutour',
},
]
}
},
methods:{
selected(){},
menuselected(){},
}
}
</script>
<style lang="scss" scoped>
// 路由导航
// .el-menu--horizontal>.el-menu-item{
// background-color: rgb(58, 94, 131);
// color:#fff;
// }
// .el-menu--horizontal>.el-menu-item{
// border-bottom:none;
// background:rgb(58, 94, 131);
// }
// .el-menu--horizontal>.el-menu-item{
// background:rgb(22, 22, 22)!important;
// height:40px;
// line-height:40px;
// margin-right:10px;
// border-radius:5px 5px 0 0;
// font-size:12px;
// font-weight:bold;
// }
// .el-menu--horizontal>.el-menu-item.is-active{
// background-color: rgb(58, 94, 131)!important;
// }
// .el-menu.el-menu--horizontal{
// border-bottom:none;
// }
// .icon-size{
// font-size:15px;margin-right:5px;
// }
ul,li{
padding:0;
margin:0;
}
.nav {
width: 100%;
// min-width: 1300px;
height: auto;
margin: 0px auto;
// position: absolute;
// position: relative;
border-bottom: none;
line-height: 65px;
// padding:5px 0;
background: linear-gradient(to right, #1a3784 0%,#34bab2 100%);
box-sizing:border-box;
// box-sizing:border-box;
}
.nav-a {
cursor: pointer;
// float: left;
// margin-left: 50px;
letter-spacing: 4px;
position: relative;
text-align:center;
}
.nav-a-ul {
list-style: none;
line-height:50px;
}
.nav-a-li {
display: inline-block;
// margin-left: 30px;
// height: 60px;
margin:0 20px;
}
.nav-a-text {
font-size: 16px;
color: #fff;
// line-height: 58px;
font-weight:bold;
text-decoration: none;
}
.menu_ul{
list-style: none;
background: #fff;
border-radius: 3px;
z-index: 999;
// position: absolute;
// display:flex;
// flex-wrap: wrap;
// white-space:nowrap;
// display: none;
// margin-top:10px;
}
.submenu-container {
// width: 130px;
// top: 58px;
// left: 67px;
// left:0;
display: none;
margin-top:10px;
width: 100%;
position:absolute;
width:300px;
border:1px solid red;
border-radius:5px;
padding:15px;
}
.menu_li {
float:left;
height: 30px;
line-height: 30px;
padding:0 10px;
margin-bottom:10px;
border-right:1px solid #eee;
// padding-left: 12px;
}
.menu_ul_text {
font-size: 14px;
color: #666;
letter-spacing: 0;
line-height: 30px;
height:30px;
text-decoration: none;
padding-left: 6px;
}
.nav-a-li:hover{
// display:inline-block;
// border-bottom: 2px solid #fff !important;
border-bottom: 2px solid red !important;
box-sizing:border-box;
}
.nav-a-li.active {
// border-bottom: 2px solid #fff;
}
.nav-a-li:active {
border-bottom: 2px solid #fff;
}
// .nav-a-li:hover .menu_ul {
// display: block;
// }
.nav-a-li:hover .submenu-container {
display: block;
}
.menu_ul_text:hover {
color: #2589ff;
}
.menu_li.active .menu_ul_text{
color: #2589ff;
}
.search-container{
// position:relative;
width: 100%;
height: 500px;
background-image: url(../../assets/pic.jpg);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.index-div{
position:absolute;
width: 100%;
border-radius: 5px;
top:30%;
}
.indexConFind{
// position:absolute;
width: 60%;
height: 180px;
background-color: rgba(5, 23, 17, 0.21);
margin: 0 auto;
// top:20%;
border-radius: 5px;
}
.seach-input{
width:60%;
}
</style>
......@@ -16,8 +16,8 @@
</ul>
</div>
</div>:default-active="this.$router.path" @select="handleSelect"-->
<el-row >
<!--<el-col class="my-menu k-flex k-center k-align-center" :span="18" :offset="3">-->
<el-col class="my-menu k-flex-between-center" :span="18" :offset="3">
<el-menu
:default-active="activeIndex"
......@@ -64,9 +64,9 @@
</el-submenu>
<el-submenu index="/news">
<template slot="title">娱乐</template>
<!--<el-menu-item index="6-1">选项1</el-menu-item>
<el-menu-item index="6-1">选项1</el-menu-item>
<el-menu-item index="6-2">选项2</el-menu-item>
<el-menu-item index="6-3">选项3</el-menu-item>-->
<el-menu-item index="6-3">选项3</el-menu-item>
</el-submenu>
<el-submenu index="7">
<template slot="title">全区法院</template>
......@@ -74,24 +74,7 @@
<el-menu-item index="7-2">选项2</el-menu-item>
<el-menu-item index="7-3">选项3</el-menu-item>
</el-submenu>
<el-menu-item index="/manage" >信息发布系统</el-menu-item>
<!--<el-menu-item index="4">
<a href="https://www.ele.me" target="_blank">订单管理</a>
订单管理
</el-menu-item>-->
<!--<el-menu-item>
<div>
<div class="k-flex seach-input k-align-center">x
<el-input
placeholder="请输入内容"
v-model="input"
clearable>
<i @click="searchEvent" slot="suffix" class="el-input__icon el-icon-search"></i>
</el-input>
<el-button style="" type="warning" icon="el-icon-search">搜索</el-button>
</div>
</div>
</el-menu-item>-->
<el-menu-item @click="openManage" >信息发布系统</el-menu-item>
</el-menu>
<div class="k-flex seach-input k-align-center">
<el-input
......@@ -100,17 +83,8 @@
clearable>
<i @click="searchEvent" slot="suffix" class="el-input__icon el-icon-search"></i>
</el-input>
<!--<el-button style="" type="warning" icon="el-icon-search">搜索</el-button>-->
</div>
</el-col>
<!--<div class="k-flex seach-input k-align-center">
<el-input
placeholder="请输入内容"
v-model="input"
clearable>
</el-input>
<el-button type="warning" icon="el-icon-search">搜索</el-button>
</div>-->
</el-row>
......@@ -170,6 +144,9 @@ export default {
}
},
methods:{
openManage(){
window.open('/#/manage')
},
selected(){},
menuselected(){},
searchEvent(){
......@@ -185,11 +162,9 @@ export default {
<style lang="scss" scoped>
.my-menu{
// background: linear-gradient(to right, #1a3784 0%,#34bab2 100%);
background:#D33237;
border-radius:7px;
padding:0 15px;
}
::v-deep{
......@@ -206,10 +181,12 @@ export default {
.el-menu--horizontal>.el-submenu .el-submenu__title{
font-size:13px;
}
// ul{
// padding:0;
// margin:0;
// }
// ul{
// padding:0;
// margin:0;
// }
// .el-menu.el-menu--horizontal{
// display:flex;
// justify-content:center;
......@@ -237,62 +214,53 @@ export default {
// background: red;
// width: 100%;
// }
// .el-menu--horizontal .el-submenu {
// float: left;
// }
// .el-menu--horizontal .el-submenu {
// float: left;
// }
// .el-menu--horizontal{
// display:block !important;
// }
// .el-menu--horizontal .el-menu-item{
// float:left!important;
// }
// .el-submenu .el-menu-item{
// display:flex;
// float:left!important;
// }
}
// $childs: false;
//横向展示需要样式修改
.el-menu--horizontal .el-menu-item {
// float: left;
// float: if($childs, left, none);
// float: none;
height: 60px;
line-height: 60px;
margin: 0;
border-bottom: 2px solid transparent;
border-bottom-width: 2px;
border-bottom-style: solid;
border-bottom-color: transparent;
color: #909399;
// float: left;
// float: if($childs, left, none);
// float: none;
height: 60px;
line-height: 60px;
margin: 0;
border-bottom: 2px solid transparent;
border-bottom-width: 2px;
border-bottom-style: solid;
border-bottom-color: transparent;
color: #909399;
}
.el-menu--horizontal .el-submenu {
// float: left;
// float: none;
// float: if($childs, left, none);
}
.el-submenu__icon-arrow {
position: static;
vertical-align: middle;
margin-left: 8px;
margin-top: -3px;
color:#fff;
position: static;
vertical-align: middle;
margin-left: 8px;
margin-top: -3px;
color:#fff;
}
.el-menu--horizontal .el-submenu.is-active .el-submenu__title {
height: 60px;
line-height: 60px;
border-bottom: 2px solid #409EFF;
color: #303133;
height: 60px;
line-height: 60px;
border-bottom: 2px solid #409EFF;
color: #303133;
}
......
......@@ -19,7 +19,8 @@
<!--左边栏目开始-->
<el-col :span="5" class="border-zone">
<div class="list-container" style="">
<div class="list-title mb-10" @click="loginOut">选择栏目</div>
<!-- <a :href="process.env.VUE_APP_LOGIN_API">点击</a> -->
<div class="list-title mb-10" @click="loginEvent">选择栏目</div>
<!--<ul class="type-list">
<li><a href="#">最高法通报</a></li>
<li><a href="#">最高人民法院简报</a></li>
......@@ -1276,6 +1277,7 @@ export default {
}
},
created() {
console.log('登录路径==',process.env.VUE_APP_LOGIN_API);
this.getBoardTree();//获取左边栏目树
this.findCurrentDepts();//获取本院部门
this.getUserCourtLevel();//用户法院等级
......@@ -1313,6 +1315,10 @@ export default {
}else{
return this.deptListData;
}
},
VUE_APP_LOGIN_API(){
console.log('登录路径',process.env.VUE_APP_LOGIN_API);
return process.env.VUE_APP_LOGIN_API
}
},
// 模糊搜索所属部门end
......@@ -1676,20 +1682,25 @@ export default {
loginEvent(){
removeToken();
alert('11111',process.env.VUE_APP_LOGIN_API);
removeToken();
console.log('loginURL11111111111111==',loginURL );
var loginURL  = process.env.VUE_APP_LOGIN_API;
console.log('loginURL222222222222==',loginURL );
location.href = loginURL ;
// alert('11111',process.env.VUE_APP_LOGIN_API);
// removeToken();
// console.log('loginURL11111111111111==',loginURL );
// var loginURL  = process.env.VUE_APP_LOGIN_API;
// console.log('loginURL222222222222==',loginURL );
// location.href = loginURL ;
location.href = process.env.VUE_APP_LOGIN_API
},
loginOut() {
alert('11111',process.env.VUE_APP_LOGIN_API);
logout().then((res) => {
removeToken();
location.href = res.data;
});
// alert('11111',process.env.VUE_APP_LOGIN_API);
// logout().then((res) => {
// removeToken();
// location.href = res.data;
// });
// var loginURL  = process.env.VUE_APP_LOGIN_API;
// console.log('loginURL222222222222==',loginURL );
// location.href = loginURL ;
location.href = process.env.VUE_APP_LOGIN_API
},
// 管理列表--页面切换
pageChange(e) {
......
......@@ -4,7 +4,7 @@
<script>
import { setToken, setUserInfo } from "@/utils/auth";
import { getInfo } from "@/api/login";
// import { getInfo } from "@/api/login";
import { mapGetters, mapMutations } from "vuex";
import Cookie from "js-cookie";
export default {
......@@ -19,10 +19,10 @@ export default {
if (obj.Authorization) {
let token = "Bearer " + obj.Authorization;
getInfo().then((res) => {
setUserInfo(res);
this.SET_USER(res.user);
});
// getInfo().then((res) => {
// setUserInfo(res);
// this.SET_USER(res.user);
// });
// console.log(token);
setToken(token, false);
......
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