| | |
| | | import moment from 'moment' |
| | | |
| | | const service = window.GLOB.service ? (/\/$/.test(window.GLOB.service) ? window.GLOB.service : window.GLOB.service + '/') : '' |
| | | |
| | | export default class Utils { |
| | | /** |
| | | * @description 生成32位uuid string + 时间 |
| | |
| | | let reg = new RegExp('(^|\\s)' + item.key + '(\\s|$)', 'ig') |
| | | value = value.replace(reg, item.value) |
| | | }) |
| | | value = value.replace(/%/ig, 'mpercent') |
| | | value = value.replace(/(^\s|\s$)/ig, '') |
| | | value = window.btoa(window.encodeURIComponent(value)) |
| | | let index = Math.floor(Math.random() * value.length) |
| | |
| | | if (!url) return '' |
| | | let baseurl = '' |
| | | if (process.env.NODE_ENV === 'production') { |
| | | baseurl = document.location.origin + '/' |
| | | baseurl = document.location.origin + '/' + service |
| | | } else { |
| | | baseurl = 'http://qingqiumarket.cn/MKWMS/' |
| | | baseurl = 'http://qingqiumarket.cn/' + service |
| | | } |
| | | let realurl = url.match(/^http/) || url.match(/^\/\//) ? url : baseurl + url |
| | | return realurl |