| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- // 获取地址栏 参数
- const urlParameter = (data) => {
- if (data) {
- const query = data.substring(data.indexOf("?") + 1);
- const arr = query.split("&");
- const params = {};
- arr.forEach((v) => {
- const key = v.substring(0, v.indexOf("="));
- const val = v.substring(v.indexOf("=") + 1);
- params[key] = val;
- });
- return params;
- } else return {};
- };
- const searchUrl = window.location.search;
- const {
- m: param
- } = urlParameter(searchUrl);
- if (!param) alert("参数错误!");
- const m_obj = {
- 1: {
- counts: 375,
- houzui: "jpg",
- },
- };
- const m_info = m_obj[param];
- if (!m_info) alert("参数错误!");
- let imgURL =''
- // oss路径问题
- if(window.location.href.includes('http://127.0.0.1:')) {
- // 本地环境
- imgURL = `/image/${param}`
- }else {
- // oss环境
- imgURL = `/project/videoDemo/image/${param}`;
- }
- // 图片数量
- let imgCounts = m_info.counts;
- // 图片后最
- let imgLastStr = m_info.houzui;
|