wangting
2024-04-08 5848ccc253f59e32742cf7de16b13c5860f25824
路由
已修改1个文件
16 ■■■■■ 文件已修改
Source/ProjectWeb/src/store/modules/user.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/store/modules/user.js
@@ -36,12 +36,26 @@
  items.forEach(item => {
    item.pathValue = item.path;
    item.path = '/' + item.code;
    item.query = {}; // 初始化 item.query
    item.query = queryStringToObject(item.pathValue)
    console.log('item', item);
    if (item.children && item.children.length > 0) {
      updateCode(item.children);
    }
  });
}
function queryStringToObject(queryString) {
  const index = queryString.indexOf('?');
  if (index !== -1) {
    queryString = queryString.substring(index + 1);
  }
  const params = new URLSearchParams(queryString);
  const obj = {};
  for (const [key, value] of params.entries()) {
    obj[key] = value;
  }
  return obj;
}
const user = {