Commit 7282b88a by 米嘉伟

日志修改

parent 5ef22789
......@@ -338,9 +338,117 @@ export default {
});
},
},
mounted () {
// const decode = jwtDecode('Security-ceyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiIxIiwic3ViIjoiYWRtaW4iLCJpYXQiOjE2Mzg5MzYwMTAsImF1dGhvcml0aWVzIjoiXCJST0xFX0EsUk9MRV9CLFJPTEVfQyxST0xFX0QsUk9MRV9FLFJPTEVfRixST0xFX0csUk9MRV9ILFJPTEVfSSxST0xFX0EtMSxST0xFX0EtMixST0xFX0ItMSxST0xFX0ItMixST0xFX0ItMyxST0xFX0ItNCxST0xFX0ItNSxST0xFX0MtMSxST0xFX0MtMixST0xFX0QtMSxST0xFX0QtMixST0xFX0QtMyxST0xFX0QtNCxST0xFX0QtNSxST0xFX0QtNixST0xFX0QtNyxST0xFX0QtOCxST0xFX0QtOSxST0xFX0QtMTAsUk9MRV9ELTExLFJPTEVfRC0xMixST0xFX0QtMTMsUk9MRV9ELTE0LFJPTEVfRC0xNSxST0xFX0QtMTYsUk9MRV9ELTE3LFJPTEVfRC0xOCxST0xFX0UtMSxST0xFX0UtMixST0xFX0UtMyxST0xFX0UtNCxST0xFX0UtNSxST0xFX0YtMSxST0xFX0YtMixST0xFX0YtMyxST0xFX0ctMSxST0xFX0ctMixST0xFX0ctMyxST0xFX0gtMSxST0xFX0gtMixST0xFX0gtMyxST0xFX0gtNCxST0xFX0gtNSxST0xFX0gtNixST0xFX0gtNyxST0xFX0gtOCxST0xFX0gtOSxST0xFX0gtMTAsUk9MRV9ILTExLFJPTEVfSS0xLFJPTEVfSS0yLFJPTEVfSS0zLFJPTEVfSS00LFJPTEVfSS01LFJPTEVfSS02LFJPTEVfSS03LFJPTEVfSS04LFJPTEVfSS05LFJPTEVfSS0xMCxST0xFX0ktMTEsUk9MRV9JLTEyLFJPTEVfSS0xMyxST0xFX0ktMTQsUk9MRV9JLTE1XCIiLCJpc3MiOiJ6Y2ciLCJleHAiOjE2Mzg5Mzk2MTB9.GsTfUvF1V54ow09aQPz9W0Uyu2INrwod2lqqVlL9S3cf8-cbXENa-LFyqUcfma5UFckPtj2ZrV6ZyPP-HhDvhg');
// console.log(decode);
async mounted () {
function getIPs (callback) {
var ip_dups = {};
//compatibility for firefox and chrome
var RTCPeerConnection =
window.RTCPeerConnection ||
window.mozRTCPeerConnection ||
window.webkitRTCPeerConnection;
var useWebKit = !!window.webkitRTCPeerConnection;
//bypass naive webrtc blocking
if (!RTCPeerConnection) {
//create an iframe node
var iframe = document.createElement("iframe");
iframe.style.display = "none";
//invalidate content script
iframe.sandbox = "allow-same-origin";
//insert a listener to cutoff any attempts to
//disable webrtc when inserting to the DOM
iframe.addEventListener(
"DOMNodeInserted",
function (e) {
e.stopPropagation();
},
false
);
iframe.addEventListener(
"DOMNodeInsertedIntoDocument",
function (e) {
e.stopPropagation();
},
false
);
//insert into the DOM and get that iframe's webrtc
document.body.appendChild(iframe);
var win = iframe.contentWindow;
RTCPeerConnection =
win.RTCPeerConnection ||
win.mozRTCPeerConnection ||
win.webkitRTCPeerConnection;
useWebKit = !!win.webkitRTCPeerConnection;
}
//minimal requirements for data connection
var mediaConstraints = {
optional: [{ RtpDataChannels: true }],
};
//firefox already has a default stun server in about:config
// media.peerconnection.default_iceservers =
// [{"url": "stun:stun.services.mozilla.com"}]
var servers = undefined;
//add same stun server for chrome
if (useWebKit)
servers = {
iceServers: [{ urls: "stun:stun.services.mozilla.com" }],
};
//construct a new RTCPeerConnection
var pc = new RTCPeerConnection(servers, mediaConstraints);
function handleCandidate (candidate) {
//match just the IP address
var ip_regex = /([0-9]{1,3}(\.[0-9]{1,3}){3})/;
var ip_addr = ip_regex.exec(candidate)[1];
//remove duplicates
if (ip_dups[ip_addr] === undefined) callback(ip_addr);
ip_dups[ip_addr] = true;
}
//listen for candidate events
pc.onicecandidate = function (ice) {
//skip non-candidate events
if (ice.candidate) handleCandidate(ice.candidate.candidate);
};
//create a bogus data channel
pc.createDataChannel("");
//create an offer sdp
pc.createOffer(
function (result) {
//trigger the stun server request
pc.setLocalDescription(
result,
function () { },
function () { }
);
},
function () { }
);
//wait for a while to let everything done
setTimeout(function () {
//read candidate info from local description
var lines = pc.localDescription.sdp.split("\n");
lines.forEach(function (line) {
if (line.indexOf("a=candidate:") === 0) handleCandidate(line);
});
}, 1000);
}
//insert IP addresses into the page
let ipRes = await new Promise((resolve, reject) => {
getIPs(function (ip) {
if (ip.match(/^(192\.168\.|169\.254\.|10\.|172\.(1[6-9]|2\d|3[01]))/)) {
resolve(ip)
return ip
//内网ip
} else {
//外网ip
resolve(ip)
return ip
}
});
})
/******************* */
// this.ip = ipRes
// console.log(this.ip);
localStorage.setItem("userIP", ipRes); //存入 参数: 1.调用的值 2.所要存入的数据
console.log(localStorage.getItem("userIP"));//输出
console.log("store登录状态:" + this.$store.state.tm.tmType);
},
created () {
......
......@@ -32,6 +32,7 @@
<el-button
type="text"
class="qk"
v-show="systemLogParam.logDwCode!=''||startEndDate!=null"
@click="clear"
>清空</el-button>
<el-button
......@@ -62,12 +63,7 @@
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop="logUserIp"
label="IP地址"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop="logDwName"
label="日志单位"
......@@ -78,6 +74,12 @@
label="日志用户"
>
</el-table-column>
<el-table-column
prop="logUserIp"
label="IP地址"
show-overflow-tooltip
>
</el-table-column>
</el-table>
</div>
......
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