Commit 945cba1d by 潘建波

安全红线问题修改

1 parent bda5e198
......@@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache" content="no-cache"/>
<meta http-equiv="Expires" content="0" />
<link rel="icon" href="<%= BASE_URL %>favicon.png">
<link rel="stylesheet" href="<%= BASE_URL %>zTree_v3/css/zTreeStyle/zTreeStyle.css"></link>
......
......@@ -4,7 +4,7 @@ import axios from "axios";
switch (process.env.NODE_ENV) {
case "development":
// baseUrl = "http://192.168.9.234:20080"; // 测试环境url
baseUrl = window.config.https?"https://192.168.9.245:20070":"http://192.168.9.233:20080"; // 测试环境url
baseUrl = window.config.https?"https://192.168.9.245:20070":"http://192.168.9.245:20080"; // 测试环境url
// baseUrl = "http://192.168.9.82:8080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086";
// baseUrl = 'http://vion-panda.51vip.biz:52510';
......
......@@ -6,6 +6,9 @@ export default {
login(params, id) {
return api.post(urls.login, params);
},
logout(userid, params) {
return api.get(urls.logout(userid), params);
},
getMenus(params, id) {
return api.get(urls.menus, params);
},
......
import baseUrl from "../baseUrl";
export default {
login: baseUrl + "/api/v1/auth/users/login",
logout(userid){
return `${baseUrl}/api/v1/auth/users/${userid}/loginout`
},
algocombs: baseUrl + "/api/v1/devconf_fx/algo_combs",
storeconfs: baseUrl + "/api/v1/devconf_fx/store_confs",
cates: baseUrl + "/api/v1/codes/traffic/cates",
......
......@@ -8,7 +8,7 @@
:class="{
'el-icon-s-fold': isopen,
'el-icon-s-unfold': !isopen,
'menu-switch': true
'menu-switch': true,
}"
@click="openmenu"
></span>
......@@ -19,18 +19,18 @@
<i class="el-icon-arrow-down el-icon-menu"></i>主题切换
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="light">白色主题</el-dropdown-item>
<el-dropdown-item command="dark">深色主题</el-dropdown-item>
<el-dropdown-item command="light">白色主题</el-dropdown-item>
<el-dropdown-item command="dark">深色主题</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<span class="uname-box">{{uname}}</span>
<span class="uname-box">{{ uname }}</span>
<img @click="resetpass" src="../../assets/img/home/user.png" alt="" />
<span class="exit" @click="logout()"
>退出<i class="el-icon-arrow-down"></i
></span>
</div>
</el-header>
<el-container style="min-height:calc(100vh - 64px);">
<el-container style="min-height: calc(100vh - 64px)">
<menus @setTopBar="setTopBar" ref="leftmenu" v-show="isfull"></menus>
<el-main>
<div class="nav" id="topnav" v-show="isfull">
......@@ -67,9 +67,9 @@ export default {
conHeight: 0,
menuwidth: "300px",
isfull: true,
headertitle:"",
headertitle: "",
topbarArr: [],
uname:''
uname: "",
};
},
methods: {
......@@ -135,48 +135,55 @@ export default {
}
this.curdate = `${Y}/${M}/${D} ${h}:${m}:${s} ${wtext}`;
},
handleCommand(command){
window.document.documentElement.setAttribute('data-theme',command);
localStorage.setItem("fxtheme",command)
handleCommand(command) {
window.document.documentElement.setAttribute("data-theme", command);
localStorage.setItem("fxtheme", command);
},
ddlogout(){
ddlogout() {
let params = {
"access_token":localStorage.getItem("access_token")
}
this.$api.login.ddlogout(params).then(res=> {
console.log("dingding",res)
})
access_token: localStorage.getItem("access_token"),
};
this.$api.login.ddlogout(params).then((res) => {
console.log("dingding", res);
});
},
logout() {
localStorage.removeItem("menu");
localStorage.removeItem("curmenu");
this.$store.commit(types.ATOKEN, "");
this.$logs.oplogs('','serv_login',`登出了平台`);
if(window.config.isdd) {
this.ddlogout()
}
localStorage.removeItem("atoken");
this.$router.push("/login").catch(err => {
err;
let uid = sessionStorage.getItem("user_unid");
this.$api.login.logout(uid).then((res) => {
this.$store.commit(types.ATOKEN, "");
this.$logs.oplogs("", "serv_login", `登出了平台`);
localStorage.removeItem("atoken");
this.$router.push("/login").catch((err) => {
err;
});
});
// location.reload();
if (window.config.isdd) {
this.ddlogout();
localStorage.removeItem("atoken");
this.$router.push("/login").catch((err) => {
err;
});
}
// location.reload();
},
resetpass() {
this.$router.push("/resetpass").catch(err => {
this.$router.push("/resetpass").catch((err) => {
err;
});
}
},
},
created() {
this.headertitle = window.config.hadertitle;
this.uname = localStorage.getItem('uname');
this.$api.device.getDev().then(m => {
this.uname = localStorage.getItem("uname");
this.$api.device.getDev().then((m) => {
if (m.length < 1) {
this.$message({
message: "未发现运维服务,请联系相关人员",
type: "error"
type: "error",
});
this.setDevunid("9cb6e39adc5176b81879f6c22f1d963");
return;
......@@ -185,17 +192,17 @@ export default {
});
},
components: {
menus
menus,
},
mounted() {
let theme = localStorage.getItem("fxtheme") || 'light';
window.document.documentElement.setAttribute('data-theme',theme);
let theme = localStorage.getItem("fxtheme") || "light";
window.document.documentElement.setAttribute("data-theme", theme);
console.log(this.permission_routers);
this.conHeight = window.innerHeight - 65;
console.log(this.conHeight);
//监听退出全屏事件
var that = this;
document.onkeydown = function(event) {
document.onkeydown = function (event) {
var e = event || window.event || arguments.callee.caller.arguments[0];
if (e && e.keyCode == 122) {
......@@ -210,7 +217,7 @@ export default {
};
let app = document.getElementById("app");
app.addEventListener("mousemove", () => {
if(window.mousetimer) {
if (window.mousetimer) {
clearTimeout(window.mousetimer);
}
window.mousetimer = setTimeout(() => {
......@@ -218,7 +225,7 @@ export default {
window.mousetimer = null;
this.$message({
message: "由于您长时间未操作,将退出平台!",
type: "warning"
type: "warning",
});
this.logout();
}, 600000);
......@@ -255,10 +262,10 @@ export default {
//建立ws连接
let uid = localStorage.getItem("user_unid");
let clientid = localStorage.getItem("client_unid");
this.$api.device.getGlobalWs(uid, clientid).then(data => {
if(window.config.https) {
let url = data.ws_url.replace("ws://","wss://")
this.globalWs = new WebSocket(url.replace("20080","20070"));
this.$api.device.getGlobalWs(uid, clientid).then((data) => {
if (window.config.https) {
let url = data.ws_url.replace("ws://", "wss://");
this.globalWs = new WebSocket(url.replace("20080", "20070"));
} else {
let url = data.ws_url;
this.globalWs = new WebSocket(url);
......@@ -267,12 +274,12 @@ export default {
localStorage.setItem("cennect_unid", ary[ary.length - 1]);
//监听成功
this.globalWs.onopen = function() {
this.globalWs.onopen = function () {
console.log("全局推送服务连接成功");
};
//监听断开
this.globalWs.onclose = function() {
this.globalWs.onclose = function () {
console.log("全局推送服务连接断开");
};
......@@ -281,7 +288,7 @@ export default {
//保持连接
var $this = this;
setInterval(function() {
setInterval(function () {
var send_mesage =
'{"type":"request","id":"' +
new Date().getTime() +
......@@ -293,50 +300,56 @@ export default {
$this.globalWs.send(send_mesage);
}, 20000);
});
}
},
};
</script>
<style lang="stylus" scoped>
.menu-switch{
color #fff
font-size 25px;
margin-left 25px;
margin-top:20px;
.menu-switch {
color: #fff;
font-size: 25px;
margin-left: 25px;
margin-top: 20px;
}
.headRight img {
cursor pointer
cursor: pointer;
}
.zt-box{
margin-right 80px
.zt-box {
margin-right: 80px;
}
.zt-btn{
.zt-btn {
// vertical-align middle
color #fff
font-size 14px
height 50px
line-height 50px
i{
font-size 16px
padding-right 10px
padding-top 6px
color: #fff;
font-size: 14px;
height: 50px;
line-height: 50px;
i {
font-size: 16px;
padding-right: 10px;
padding-top: 6px;
vertical-align: text-bottom;
}
}
.logotitle{
.logotitle {
overflow: hidden;
font-size: 20px;
color #ffffff
display inline-block
line-height 65px
font-weight 600
letter-spacing 2px
float left
color: #ffffff;
display: inline-block;
line-height: 65px;
font-weight: 600;
letter-spacing: 2px;
float: left;
}
.timerbox{
padding-right 30px
.timerbox {
padding-right: 30px;
}
.uname-box{
padding-right :10px
.uname-box {
padding-right: 10px;
}
</style>
......@@ -145,8 +145,8 @@ export default {
if (!res.ecode) {
this.loginMount(res, "user");
} else {
debugger;
if (res.ecode == "1000") {
sessionStorage.setItem("user_unid", res.user_unid);
this.$router.push("/resetpass")
} else {
this.$message({
......
......@@ -99,9 +99,13 @@ export default {
if (valid) {
let user_unid = sessionStorage.getItem("user_unid");
this.$api.ops.resetPwd(data, user_unid).then(res => {
if(!res.ecode){
if(res.ecode == 200){
this.$logs.oplogs(res, "serv_login", `修改密码`);
this.$router.push("/login");
this.$message({
type: "success",
message: res.enote
});
} else {
this.$message({
type: "error",
......
......@@ -3,7 +3,7 @@
<div class="content">
<div style="padding:8px 20px;">
<span style="float: right;">
<el-button type="info" @click="addRole">添加新角色</el-button>
<el-button type="info" v-if="uname=='admin'" @click="addRole">添加新角色</el-button>
</span>
<div style="clear: both;"></div>
</div>
......@@ -39,7 +39,8 @@
align="center"
width="300"
prop="operation"
label="操作">
label="操作"
v-if="uname=='admin'">
<template slot-scope="scope">
<el-tooltip content="编辑角色" placement="bottom" effect="light" :visible-arrow=false>
<span class="icon-fanxing-xiugai editIcon" @click="editUser(scope.$index, scope.row)"></span>
......@@ -165,6 +166,7 @@
addVisible:false,
editVisible:false,
roleList:[],
uname:"",
userId:sessionStorage.getItem('user_unid'),
rules: {
role_name: [
......@@ -182,6 +184,7 @@
mounted(){
this.getTableList();
this.getMenuList();
this.uname = localStorage.getItem('uname');
},
methods:{
treeChange(data,node){
......
......@@ -3,7 +3,7 @@
<div class="content">
<div style="padding:8px 20px;">
<span style="float: right;">
<el-button type="info" @click="addUser">添加新用户</el-button>
<el-button type="info" v-if="uname=='admin'" @click="addUser">添加新用户</el-button>
</span>
<div style="clear: both;"></div>
</div>
......@@ -43,6 +43,7 @@
width="300"
prop="operation"
label="操作"
v-if="uname=='admin'"
>
<template slot-scope="scope">
<el-tooltip
......@@ -56,8 +57,8 @@
@click="editUser(scope.$index, scope.row)"
></span>
</el-tooltip>
<span class="tableSpanBorder" v-if="uname=='admin'"></span>
<el-tooltip content="重置密码" placement="bottom" effect="light" :visible-arrow=false v-if="uname=='admin'">
<span class="tableSpanBorder"></span>
<el-tooltip content="重置密码" placement="bottom" effect="light" :visible-arrow=false >
<span class="el-icon-refresh-right reseticon" @click="reset(scope.$index, scope.row)"></span>
</el-tooltip>
<span class="tableSpanBorder"></span>
......@@ -229,6 +230,7 @@ export default {
editForm: {
role_unid: ""
},
isadmin:true,
editRoleUnid: "",
editUnid: "",
tableData: [],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!