404.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <script>
  7. if (window.location.pathname.indexOf('/docs/react/') !== -1) {
  8. console.log('redirect2');
  9. window.location.href =
  10. window.location.pathname.replace('/docs/react/', '/start/') + window.location.hash;
  11. } else {
  12. const classMap = {
  13. grid: 'basic',
  14. icons: 'basic',
  15. layout: 'basic',
  16. typography: 'basic',
  17. autoComplete: 'input',
  18. button: 'input',
  19. cascader: 'input',
  20. checkbox: 'input',
  21. datePicker: 'input',
  22. form: 'input',
  23. input: 'input',
  24. inputNumber: 'input',
  25. radio: 'input',
  26. rating: 'input',
  27. select: 'input',
  28. slider: 'input',
  29. switch: 'input',
  30. timePicker: 'input',
  31. transfer: 'input',
  32. treeSelect: 'input',
  33. upload: 'input',
  34. anchor: 'navigation',
  35. backtop: 'navigation',
  36. breadcrumb: 'navigation',
  37. navigation: 'navigation',
  38. pagination: 'navigation',
  39. steps: 'navigation',
  40. tabs: 'navigation',
  41. tree: 'navigation',
  42. avatar: 'show',
  43. badge: 'show',
  44. calendar: 'show',
  45. collapse: 'show',
  46. collapsible: 'show',
  47. descriptions: 'show',
  48. dropdown: 'show',
  49. empty: 'show',
  50. list: 'show',
  51. modal: 'show',
  52. overflowList: 'show',
  53. popover: 'show',
  54. scrollList: 'show',
  55. sideSheet: 'show',
  56. table: 'show',
  57. tag: 'show',
  58. timeline: 'show',
  59. tooltip: 'show',
  60. banner: 'feedback',
  61. notification: 'feedback',
  62. popconfirm: 'feedback',
  63. progress: 'feedback',
  64. skeleton: 'feedback',
  65. spin: 'feedback',
  66. toast: 'feedback',
  67. configProvider: 'other',
  68. locale: 'other',
  69. };
  70. if (window.location.pathname.indexOf('/components/') !== -1) {
  71. let component = window.location.pathname.match(/\/components\/(\w+)\/?/)[1];
  72. let newComponent = component;
  73. //兼容之前bisheng文档站 markdown 路由和组件名大小写不一致的写法
  74. if (component === 'timePicker') {
  75. newComponent = 'timepicker';
  76. }
  77. if (component === 'treeSelect') {
  78. newComponent = 'treeselect';
  79. }
  80. if (component === 'backtop') {
  81. newComponent = 'backTop';
  82. }
  83. if (component === 'overflowList') {
  84. newComponent = 'overflowlist';
  85. }
  86. if (component === 'treeSelect') {
  87. newComponent = 'treeselect';
  88. }
  89. console.log(
  90. window.location.pathname.replace(
  91. `/components/${component}`,
  92. `/${classMap[newComponent]}/${newComponent}/`
  93. ) + window.location.hash
  94. );
  95. window.location.href =
  96. window.location.pathname.replace(
  97. `/components/${component}`,
  98. `/${classMap[newComponent]}/${newComponent}/`
  99. ) + window.location.hash;
  100. } else {
  101. console.log('back to / ', window.location.href);
  102. window.location.href = '/';
  103. }
  104. }
  105. </script>
  106. <title>404</title>
  107. </head>
  108. <body>
  109. 404 not found
  110. </body>
  111. </html>