摘要: /** * object转化成url拼接样式 * @param obj 需要转化的参数 */ const objToUrl = obj => { let arr = []; for(let i in obj){ if (obj.hasOwnProperty(i)) { arr.push(encode 阅读全文
posted @ 2020-12-31 11:05 拈花醉 阅读(610) 评论(0) 推荐(0) 编辑
摘要: export const getParamsToString = (obj) => { let str = ''; for (const key in obj) { str += `${key}=${obj[key]}&`; } return str.substr(0, str.length - 1 阅读全文
posted @ 2020-12-31 11:02 拈花醉 阅读(1274) 评论(0) 推荐(0) 编辑
摘要: // get请求 export const get = ({ url, params = {}, headers = {}, title = '加载中' }) => new Promise((resolve, reject) => { loading.open(title); axios.get(u 阅读全文
posted @ 2020-12-31 10:57 拈花醉 阅读(1000) 评论(0) 推荐(0) 编辑
摘要: // 校验身份证 export const checkNumber = (number) => { const reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; return reg.test(number); }; // 根据身份证,获取 出生年月 阅读全文
posted @ 2020-12-31 10:50 拈花醉 阅读(516) 评论(0) 推荐(0) 编辑
摘要: export const formatTime = (time) => { if (!time) { return ''; } const y = time.substr(0, 4); const m = time.substr(4, 2); const d = time.substr(6, 2); 阅读全文
posted @ 2020-12-31 10:47 拈花醉 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 引用: <script type="text/javascript" src="/public/js/cryptoJs/core-min.js"></script> <script type="text/javascript" src="/public/js/cryptoJs/enc-base64- 阅读全文
posted @ 2020-12-31 10:30 拈花醉 阅读(5288) 评论(0) 推荐(0) 编辑