add 带模板导入、人员信息(部分完成)

This commit is contained in:
赵霄
2023-09-04 16:09:35 +08:00
parent 83a55d9d29
commit 3ec511e114
9 changed files with 561 additions and 110 deletions
+20
View File
@@ -602,3 +602,23 @@ export function evil (fn) {
const Fn = Function // 一个变量指向Function,防止有些前端编译工具报错
return new Fn('return ' + fn)()
}
/**
* 将url的参数拆分成对象
* @param url
* @returns {{id: *, url}}
*/
export function urlToParams (url) {
const commonUrl = window._CONFIG.staticDomainURL
// url截取参数的部分
const paramsStr = url.slice(url.indexOf('?') + 1)
const paramsObj = {
url,
id: url.slice(url.indexOf(commonUrl) + commonUrl.length + 1, url.indexOf('?'))
}
paramsStr.split('&').forEach(item => {
const arr = item.split('=')
paramsObj[arr[0]] = arr[1]
})
return paramsObj
}