const urlTobase64 = (imgPath) => {
    var imgBase64 = uni.getFileSystemManager().readFileSync(imgPath, "base64"),
    base64Url = `data:image/png;base64,${imgBase64}`;
  /*   console.log(
    "data:image/png;base64," + imgBase64,
    "图片转换成功+++++++++++++++++++++++++++++"
  ); */
 
  return base64Url;
};

const getUrlParams = (url) => {
	let paramsObj = new Object();
	if (url.indexOf("?") != -1) {
		let str = url.split("?")[1];
		let strs = str.split("&");
		for (let i = 0; i < strs.length; i++) {
			paramsObj[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
 
		}
	}
	return paramsObj;
};
 
export default {
  urlTobase64,
  getUrlParams
};