| | |
| | | import md5 from 'md5' |
| | | import options from '@/store/options.js' |
| | | |
| | | const service = window.GLOB.service ? (/\/$/.test(window.GLOB.service) ? window.GLOB.service : window.GLOB.service + '/') : '' |
| | | |
| | | export default class Utils { |
| | | /** |
| | | * @description 生成32位uuid string + 时间 |
| | |
| | | |
| | | let baseurl = '' |
| | | if (process.env.NODE_ENV === 'production') { |
| | | baseurl = document.location.origin + '/' + service |
| | | baseurl = document.location.origin + '/' + window.GLOB.service |
| | | } else { |
| | | baseurl = 'http://qingqiumarket.cn/' + service |
| | | baseurl = window.GLOB.location + window.GLOB.service |
| | | } |
| | | // if (!/Content\/images\/upload\//.test(url)) { |
| | | // baseurl = baseurl + 'Content/images/upload/' |
| | |
| | | if (options.cloudServiceApi) { |
| | | baseurl = options.cloudServiceApi.replace(/webapi(.*)$/, '') |
| | | } else { |
| | | baseurl = document.location.origin + '/' + service |
| | | baseurl = document.location.origin + '/' + window.GLOB.service |
| | | } |
| | | |
| | | return url.match(/^http/) || url.match(/^\/\//) ? url : baseurl + url |