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