| | |
| | | * 加密处理 |
| | | */ |
| | | export const encryption = (params) => { |
| | | let { data, type, param, key } = params; |
| | | let { |
| | | data, |
| | | type, |
| | | param, |
| | | key |
| | | } = params; |
| | | let result = JSON.parse(JSON.stringify(data)); |
| | | if (type == "Base64") { |
| | | param.forEach((ele) => { |
| | |
| | | const dualScreenTop = |
| | | window.screenTop !== undefined ? window.screenTop : screen.top; |
| | | |
| | | const width = window.innerWidth |
| | | ? window.innerWidth |
| | | : document.documentElement.clientWidth |
| | | ? document.documentElement.clientWidth |
| | | : screen.width; |
| | | const height = window.innerHeight |
| | | ? window.innerHeight |
| | | : document.documentElement.clientHeight |
| | | ? document.documentElement.clientHeight |
| | | : screen.height; |
| | | const width = window.innerWidth ? |
| | | window.innerWidth : |
| | | document.documentElement.clientWidth ? |
| | | document.documentElement.clientWidth : |
| | | screen.width; |
| | | const height = window.innerHeight ? |
| | | window.innerHeight : |
| | | document.documentElement.clientHeight ? |
| | | document.documentElement.clientHeight : |
| | | screen.height; |
| | | |
| | | const left = width / 2 - w / 2 + dualScreenLeft; |
| | | const top = height / 2 - h / 2 + dualScreenTop; |
| | |
| | | link.click(); |
| | | } else if (typeof window.navigator.msSaveBlob !== "undefined") { |
| | | // IE |
| | | var blob = new Blob([data], { type: "application/force-download" }); |
| | | var blob = new Blob([data], { |
| | | type: "application/force-download" |
| | | }); |
| | | window.navigator.msSaveBlob(blob, filename); |
| | | } else { |
| | | // Firefox |