Commit 945cba1d by 潘建波

安全红线问题修改

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