export const array2object = (list = [], k = 'id', v) => { const data = {} if (list) { for (const item of list) { data[item[k]] = v ? item[v] : item } } return data } export const getStuName = () => { if (location.hostname.indexOf('dev') > -1) { return 'http://mstudev.dayaedu.com' } else if (location.hostname.indexOf('online') > -1) { return 'https://mstuonline.dayaedu.com' } else if (location.hostname.indexOf('localhost') > -1) { return 'http://localhost:9001' } else { return 'https://mstutest.dayaedu.com' //'http://localhost:9001' // } }