| | |
| | | import appId from './appid.js' |
| | | |
| | | var ismock = 1// 虚拟数据 0不使用 1使用 |
| | | var istest = 0// 0线上 1本地 2测试环境 |
| | | var istest = 2// 0线上 1本地 2测试环境 |
| | | var isConsole = 1// 是否屏蔽console 0屏蔽 1开放 |
| | | var debug = isConsole |
| | | var isWxLoginType = 0 // 微信登录 0无 1静默微信登录snsapi_base 2手动微信登录snsapi_userinfo |
| | | var isTestView = 1 |
| | | var is_use_test_server = 1 // 是否部署在测试服务器 |
| | | var localOnline = istest ? 0 : 1 // 本地连线上 |
| | | |
| | | // 打包后的环境 |
| | | if (process.env && process.env.NODE_ENV !== 'development') { |
| | | istest = 0 |
| | | ismock = 0 |
| | | isTestView = 0 |
| | | localOnline = 0 |
| | | if (is_use_test_server) { |
| | | isTestView = 1 |
| | | } |
| | | } |
| | | |
| | | const pdomain = '/' // 线上 |
| | |
| | | const search = location.search |
| | | // 参数数组 |
| | | let querys = [] |
| | | if (search && search.indexOf('?')>-1) { |
| | | querys = search.split('?')[1].split('&').filter((str)=>{ |
| | | if (search && search.indexOf('?') > -1) { |
| | | querys = search.split('?')[1].split('&').filter((str) => { |
| | | const key = str.split('=')[0] |
| | | const value = str.split('=')[1] |
| | | return (key != 'code' && key != 'state') |
| | |
| | | |
| | | // 补充参数 |
| | | if (querys.length) { |
| | | indexUrl += '?'+querys.join('&') |
| | | indexUrl += '?' + querys.join('&') |
| | | } |
| | | |
| | | return long.replace('{{appid}}', appid).replace('{{scope}}', scope).replace('{{url}}', encodeURIComponent(indexUrl)) |
| | |
| | | console.log = () => {} |
| | | } |
| | | |
| | | var domain; |
| | | var domain |
| | | |
| | | if (istest == 0) domain = pdomain // 线上 |
| | | if (istest == 1) domain = tdomain // 本地 |
| | |
| | | export default { |
| | | ismock, |
| | | istest, |
| | | isTestView, |
| | | localOnline, |
| | | isWxLoginType, |
| | | isConsole, |
| | | debug, |