Commit 7e4c8097 by swl

契税补贴电子签名

parent 17fc1a5b
No preview for this file type
No preview for this file type
No preview for this file type
const domain = {
// dev: "http://192.168.3.87:8881", // 姚镇接口
// dev: "http://192.168.100.16:8881", // 姚镇接口
// dev: "http://81.69.231.72:8881", // 姚镇接口
// dev: "http://81.69.231.72:8881", // 测试接口
dev: "https://exam.smart-zj.cn:9100/smartExam/", // /新正式接口
......
......@@ -8,79 +8,79 @@ import CryptoJS from "crypto-js";
* @return {*}
*/
export function debounce(func, wait, immediate) {
let timeout, args, context, timestamp, result
let timeout, args, context, timestamp, result;
const later = function () {
// 据上一次触发时间间隔
const last = +new Date() - timestamp
const last = +new Date() - timestamp;
// 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
if (last < wait && last > 0) {
timeout = setTimeout(later, wait - last)
timeout = setTimeout(later, wait - last);
} else {
timeout = null
timeout = null;
// 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
if (!immediate) {
result = func.apply(context, args)
if (!timeout) context = args = null
result = func.apply(context, args);
if (!timeout) context = args = null;
}
}
}
};
return function (...args) {
context = this
timestamp = +new Date()
const callNow = immediate && !timeout
context = this;
timestamp = +new Date();
const callNow = immediate && !timeout;
// 如果延时不存在,重新设定延时
if (!timeout) timeout = setTimeout(later, wait)
if (!timeout) timeout = setTimeout(later, wait);
if (callNow) {
result = func.apply(context, args)
context = args = null
result = func.apply(context, args);
context = args = null;
}
return result
}
return result;
};
}
/**
* 设置浏览器头部标题
*/
export const setTitle = (title) => {
title = title ? `${title}` : '网上考试管理后台'
window.document.title = title
}
title = title ? `${title}` : "网上考试管理后台";
window.document.title = title;
};
/**
* 选项与数字的枚举
*/
export const enumeration = {
1: 'A',
2: 'B',
3: 'C',
4: 'D',
5: 'E',
6: 'F',
7: 'G',
8: 'H',
9: 'I',
10: 'J',
11: 'K',
12: 'L',
13: 'M',
14: 'N',
15: 'O',
16: 'P',
17: 'Q',
18: 'R',
19: 'S',
20: 'T',
21: 'U',
22: 'V',
23: 'W',
24: 'X',
25: 'Y',
26: 'Z'
}
1: "A",
2: "B",
3: "C",
4: "D",
5: "E",
6: "F",
7: "G",
8: "H",
9: "I",
10: "J",
11: "K",
12: "L",
13: "M",
14: "N",
15: "O",
16: "P",
17: "Q",
18: "R",
19: "S",
20: "T",
21: "U",
22: "V",
23: "W",
24: "X",
25: "Y",
26: "Z",
};
/**
* 上传文件
......@@ -132,76 +132,73 @@ export const enumeration = {
// }
export function getQueryString(name) {
console.log('获取到的name---', name);
const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
console.log("获取到的name---", name);
const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
const r = window.location.search.substr(1).match(reg);
console.log('r---', r);
console.log("r---", r);
if (r != null) {
return r[2];
}
return null;
}
export function fromDate(timestamp) {
const time = new Date(timestamp);
const yy = time.getFullYear().toString(); //年
let MM = time.getMonth() + 1; //月
MM = MM < 10 ? ('0' + MM) : MM;
MM = MM < 10 ? "0" + MM : MM;
let dd = time.getDate(); //日
dd = dd < 10 ? ('0' + dd) : dd;
return `${yy}-${MM}-${dd}`
dd = dd < 10 ? "0" + dd : dd;
return `${yy}-${MM}-${dd}`;
}
export function changeList(list) {
list.map((item) => {
if (item.name) {
item.name = setName(item.name)
item.name = setName(item.name);
}
if (item.contactUser) {
item.contactUser = setName(item.contactUser)
item.contactUser = setName(item.contactUser);
}
if (item.phone) {
item.phone = setTel(item.phone)
item.phone = setTel(item.phone);
}
if (item.contactMobile) {
item.contactMobile = setTel(item.contactMobile)
item.contactMobile = setTel(item.contactMobile);
}
if (item.mobile) {
item.mobile = setTel(item.mobile)
item.mobile = setTel(item.mobile);
}
if (item.idCard) {
item.idCard = setCertNo(item.idCard)
item.idCard = setCertNo(item.idCard);
}
return item
})
return list
return item;
});
return list;
}
export function setName(str) {
if (str) {
let str1 = str.substr(0, 1);
let num1 = str.substr(1).length;
let str2 = ''
let str2 = "";
for (let i = 0; i < num1; i++) {
str2 += ' *'
str2 += " *";
}
let str3 = str1 + str2;
return str3;
} else {
return '-'
return "-";
}
}
export function setTel(tel) {
if (tel && tel.length >= 11) {
var pat = /(\d{3})\d*(\d{4})/
let telFinal = tel.replace(pat, '$1****$2');
return telFinal
var pat = /(\d{3})\d*(\d{4})/;
let telFinal = tel.replace(pat, "$1****$2");
return telFinal;
} else {
return '-';
return "-";
}
}
......@@ -212,19 +209,24 @@ export function setCertNo(certNo) {
// let cert2 = cert1 + "****";
// return cert2;
// let cert1 = certNo.replace(/(\w{6})\w{2}(\w{6})\w{4}/, '$1**$2****');
let cert1 = certNo1.substring(0, 6) + '********' + certNo1.substring(14, certNo1.length);
let cert1 =
certNo1.substring(0, 6) +
"********" +
certNo1.substring(14, certNo1.length);
return cert1;
} else {
return '-';
return "-";
}
}
// 解密
export function decryptByDES(ciphertext, key) {
const keyHex = CryptoJS.enc.Utf8.parse(key);
const decrypted = CryptoJS.DES.decrypt({
const decrypted = CryptoJS.DES.decrypt(
{
ciphertext: CryptoJS.enc.Base64.parse(ciphertext),
},
keyHex, {
keyHex,
{
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7,
}
......@@ -240,4 +242,126 @@ export function encryptByDES(message, key) {
padding: CryptoJS.pad.Pkcs7,
});
return encrypted.toString(); // 加密出来为 hex格式密文
}
\ No newline at end of file
}
export const signState = [
{
state: "",
stateName: "全部",
type: "",
},
{
state: 0,
stateName: "待审核",
type: "warning",
},
// TODO:新增电子签名
{
state: 1,
stateName: "电子签名",
type: "warning",
},
{
state: 3,
stateName: "待复审",
type: "warning",
},
{
state: 2,
stateName: "待退税办理",
type: "warning",
},
{
state: 4,
stateName: "已驳回",
type: "danger",
},
{
state: 6,
stateName: "已完成",
type: "success",
},
];
export const stateList = [
{
state: "",
stateName: "全部",
type: "",
},
{
state: 0,
stateName: "待审核",
type: "warning",
},
{
state: 1,
stateName: "待复审",
type: "warning",
},
{
state: 2,
stateName: "待退税办理",
type: "warning",
},
{
state: 4,
stateName: "已驳回",
type: "danger",
},
{
state: 6,
stateName: "已完成",
type: "success",
},
];
export const signTag = {
0: {
type: "warning",
name: "待审核",
},
1: {
type: "warning",
name: "待签名认证",
},
3: {
type: "warning",
name: "待复审",
},
2: {
type: "warning",
name: "待退税办理",
},
4: {
type: "danger",
name: "已驳回",
},
6: {
type: "success",
name: "已完成",
},
};
export const noSignTag = {
0: {
type: "warning",
name: "待审核",
},
1: {
type: "warning",
name: "待复审",
},
2: {
type: "warning",
name: "待退税办理",
},
4: {
type: "danger",
name: "已驳回",
},
6: {
type: "success",
name: "已完成",
},
};
......@@ -6,7 +6,10 @@ import { TokenKey } from "@/utils/auth";
const config = {
// proxy: "https://exam.smart-zj.cn:9100/exam/", // 新线上地址
// proxy: "http://81.69.231.72:8881", // 测试地址
// proxy: "http://192.168.3.87:8881", //本地
// proxy: "http://192.168.100.16:8881", //本地//
proxy: "https://exam.smart-zj.cn:9100/smartExam", // 新正式接口zs
// proxy: "http://81.69.231.72:9089/", // 测试地址
// proxy1: "http://81.69.231.72:8881/admin-api", // 测试地址
......
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