diff --git a/web/.gitignore b/web/.gitignore new file mode 100644 index 000000000..9f8d0df3f --- /dev/null +++ b/web/.gitignore @@ -0,0 +1,13 @@ +/node_modules +/.env.local +/.umirc.local.ts +/config/config.local.ts +/src/.umi +/src/.umi-production +/src/.umi-test +/.umi +/.umi-production +/.umi-test +/dist +/.mfsu +.swc \ No newline at end of file diff --git a/web/src/.umi/.cache/babel-loader/003c0e25c79bb4c4486dd2780f6b4563.json.gz b/web/src/.umi/.cache/babel-loader/003c0e25c79bb4c4486dd2780f6b4563.json.gz deleted file mode 100644 index 012bee58d..000000000 Binary files a/web/src/.umi/.cache/babel-loader/003c0e25c79bb4c4486dd2780f6b4563.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/038b8c3e29b20d71d63a8677a6ae7bea.json.gz b/web/src/.umi/.cache/babel-loader/038b8c3e29b20d71d63a8677a6ae7bea.json.gz deleted file mode 100644 index 9b29faca1..000000000 Binary files a/web/src/.umi/.cache/babel-loader/038b8c3e29b20d71d63a8677a6ae7bea.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/04241d521fb332f49c5959f5bc279a96.json.gz b/web/src/.umi/.cache/babel-loader/04241d521fb332f49c5959f5bc279a96.json.gz deleted file mode 100644 index ad100ea75..000000000 Binary files a/web/src/.umi/.cache/babel-loader/04241d521fb332f49c5959f5bc279a96.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/0579f9fc04914c23164e57d53bd8205d.json.gz b/web/src/.umi/.cache/babel-loader/0579f9fc04914c23164e57d53bd8205d.json.gz deleted file mode 100644 index aa59405fd..000000000 Binary files a/web/src/.umi/.cache/babel-loader/0579f9fc04914c23164e57d53bd8205d.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/058c905cf65224c84d297202b84934e1.json.gz b/web/src/.umi/.cache/babel-loader/058c905cf65224c84d297202b84934e1.json.gz deleted file mode 100644 index b9f3814f9..000000000 Binary files a/web/src/.umi/.cache/babel-loader/058c905cf65224c84d297202b84934e1.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/05b16c9d1cf860ea5a0e25f76712e00e.json.gz b/web/src/.umi/.cache/babel-loader/05b16c9d1cf860ea5a0e25f76712e00e.json.gz deleted file mode 100644 index aa59405fd..000000000 Binary files a/web/src/.umi/.cache/babel-loader/05b16c9d1cf860ea5a0e25f76712e00e.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/07bc87f027e47a00f406021f6b318b79.json.gz b/web/src/.umi/.cache/babel-loader/07bc87f027e47a00f406021f6b318b79.json.gz deleted file mode 100644 index 5bcae6abf..000000000 Binary files a/web/src/.umi/.cache/babel-loader/07bc87f027e47a00f406021f6b318b79.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/099d0d8072591f57a351317a4e6e5c38.json.gz b/web/src/.umi/.cache/babel-loader/099d0d8072591f57a351317a4e6e5c38.json.gz deleted file mode 100644 index f4aba2c93..000000000 Binary files a/web/src/.umi/.cache/babel-loader/099d0d8072591f57a351317a4e6e5c38.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/0c21deee73d4f86d43cee3dfb6bf0de3.json.gz b/web/src/.umi/.cache/babel-loader/0c21deee73d4f86d43cee3dfb6bf0de3.json.gz deleted file mode 100644 index 435c45433..000000000 Binary files a/web/src/.umi/.cache/babel-loader/0c21deee73d4f86d43cee3dfb6bf0de3.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/1475ff4c78a8fa5a4129d0c2eae5a727.json.gz b/web/src/.umi/.cache/babel-loader/1475ff4c78a8fa5a4129d0c2eae5a727.json.gz deleted file mode 100644 index 7d48555a6..000000000 Binary files a/web/src/.umi/.cache/babel-loader/1475ff4c78a8fa5a4129d0c2eae5a727.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/1a8ff243436af69b14f5b9a70342dbfa.json.gz b/web/src/.umi/.cache/babel-loader/1a8ff243436af69b14f5b9a70342dbfa.json.gz deleted file mode 100644 index 91055ad26..000000000 Binary files a/web/src/.umi/.cache/babel-loader/1a8ff243436af69b14f5b9a70342dbfa.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/220efe5749cb3c74a33c8e1da443fa10.json.gz b/web/src/.umi/.cache/babel-loader/220efe5749cb3c74a33c8e1da443fa10.json.gz deleted file mode 100644 index 6104e2a0f..000000000 Binary files a/web/src/.umi/.cache/babel-loader/220efe5749cb3c74a33c8e1da443fa10.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/23f31a27f74d3b6f5dcdcd1e23bb537c.json.gz b/web/src/.umi/.cache/babel-loader/23f31a27f74d3b6f5dcdcd1e23bb537c.json.gz deleted file mode 100644 index 007cc8b20..000000000 Binary files a/web/src/.umi/.cache/babel-loader/23f31a27f74d3b6f5dcdcd1e23bb537c.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/2ffcefb6f20eaf25453df5c2649f5363.json.gz b/web/src/.umi/.cache/babel-loader/2ffcefb6f20eaf25453df5c2649f5363.json.gz deleted file mode 100644 index a157d9abe..000000000 Binary files a/web/src/.umi/.cache/babel-loader/2ffcefb6f20eaf25453df5c2649f5363.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/31d3bd5c235f864bd56ad05fab042fdb.json.gz b/web/src/.umi/.cache/babel-loader/31d3bd5c235f864bd56ad05fab042fdb.json.gz deleted file mode 100644 index 4b5056cc2..000000000 Binary files a/web/src/.umi/.cache/babel-loader/31d3bd5c235f864bd56ad05fab042fdb.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/362108d3d25a82fffc3d3de8e80bef7c.json.gz b/web/src/.umi/.cache/babel-loader/362108d3d25a82fffc3d3de8e80bef7c.json.gz deleted file mode 100644 index f8a52899b..000000000 Binary files a/web/src/.umi/.cache/babel-loader/362108d3d25a82fffc3d3de8e80bef7c.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/3d560144c7d1a46b70494c113d8c6103.json.gz b/web/src/.umi/.cache/babel-loader/3d560144c7d1a46b70494c113d8c6103.json.gz deleted file mode 100644 index f78321f02..000000000 Binary files a/web/src/.umi/.cache/babel-loader/3d560144c7d1a46b70494c113d8c6103.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/45e6baf2e9701aeac3acc5e213af0789.json.gz b/web/src/.umi/.cache/babel-loader/45e6baf2e9701aeac3acc5e213af0789.json.gz deleted file mode 100644 index ad8ee490c..000000000 Binary files a/web/src/.umi/.cache/babel-loader/45e6baf2e9701aeac3acc5e213af0789.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/5ad2c732c49275335966b47f6d04ded8.json.gz b/web/src/.umi/.cache/babel-loader/5ad2c732c49275335966b47f6d04ded8.json.gz deleted file mode 100644 index 8ec7f11c7..000000000 Binary files a/web/src/.umi/.cache/babel-loader/5ad2c732c49275335966b47f6d04ded8.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/77a297213e3ef2f4242d0cc63750d343.json.gz b/web/src/.umi/.cache/babel-loader/77a297213e3ef2f4242d0cc63750d343.json.gz deleted file mode 100644 index fd6598324..000000000 Binary files a/web/src/.umi/.cache/babel-loader/77a297213e3ef2f4242d0cc63750d343.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/78142fdefe4ff11dedc248b3d96ba3b5.json.gz b/web/src/.umi/.cache/babel-loader/78142fdefe4ff11dedc248b3d96ba3b5.json.gz deleted file mode 100644 index 7759c3365..000000000 Binary files a/web/src/.umi/.cache/babel-loader/78142fdefe4ff11dedc248b3d96ba3b5.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/7c83bdbb9281103d3161e71b524fdf56.json.gz b/web/src/.umi/.cache/babel-loader/7c83bdbb9281103d3161e71b524fdf56.json.gz deleted file mode 100644 index c45796f23..000000000 Binary files a/web/src/.umi/.cache/babel-loader/7c83bdbb9281103d3161e71b524fdf56.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/7d3d65585223f4f2da7439fe6b2dbc6c.json.gz b/web/src/.umi/.cache/babel-loader/7d3d65585223f4f2da7439fe6b2dbc6c.json.gz deleted file mode 100644 index dd25810f7..000000000 Binary files a/web/src/.umi/.cache/babel-loader/7d3d65585223f4f2da7439fe6b2dbc6c.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/7df521508a8125c4df718cf1ef29fd54.json.gz b/web/src/.umi/.cache/babel-loader/7df521508a8125c4df718cf1ef29fd54.json.gz deleted file mode 100644 index b484917ae..000000000 Binary files a/web/src/.umi/.cache/babel-loader/7df521508a8125c4df718cf1ef29fd54.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/8e885ad87900279508de02f78d4f0863.json.gz b/web/src/.umi/.cache/babel-loader/8e885ad87900279508de02f78d4f0863.json.gz deleted file mode 100644 index d0413c0bb..000000000 Binary files a/web/src/.umi/.cache/babel-loader/8e885ad87900279508de02f78d4f0863.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/90520024e875c367d08722691e4db02f.json.gz b/web/src/.umi/.cache/babel-loader/90520024e875c367d08722691e4db02f.json.gz deleted file mode 100644 index 00f1e8d58..000000000 Binary files a/web/src/.umi/.cache/babel-loader/90520024e875c367d08722691e4db02f.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/98099c04f551f72b57ee257483e57e76.json.gz b/web/src/.umi/.cache/babel-loader/98099c04f551f72b57ee257483e57e76.json.gz deleted file mode 100644 index cf62f7daf..000000000 Binary files a/web/src/.umi/.cache/babel-loader/98099c04f551f72b57ee257483e57e76.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/9cf4870acea47ee65854458f053cc1ac.json.gz b/web/src/.umi/.cache/babel-loader/9cf4870acea47ee65854458f053cc1ac.json.gz deleted file mode 100644 index 881d6508f..000000000 Binary files a/web/src/.umi/.cache/babel-loader/9cf4870acea47ee65854458f053cc1ac.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/a4cda9478c99dfb11cd56eb08706ec6b.json.gz b/web/src/.umi/.cache/babel-loader/a4cda9478c99dfb11cd56eb08706ec6b.json.gz deleted file mode 100644 index f3f18bb4f..000000000 Binary files a/web/src/.umi/.cache/babel-loader/a4cda9478c99dfb11cd56eb08706ec6b.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/a6474470b00d912e671bcd3c0099ecf0.json.gz b/web/src/.umi/.cache/babel-loader/a6474470b00d912e671bcd3c0099ecf0.json.gz deleted file mode 100644 index ef4ba3231..000000000 Binary files a/web/src/.umi/.cache/babel-loader/a6474470b00d912e671bcd3c0099ecf0.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/a6c8a682ae402c85991a5e2908c1900f.json.gz b/web/src/.umi/.cache/babel-loader/a6c8a682ae402c85991a5e2908c1900f.json.gz deleted file mode 100644 index 5b9aa70ec..000000000 Binary files a/web/src/.umi/.cache/babel-loader/a6c8a682ae402c85991a5e2908c1900f.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/a741f8ebcbb7e7b4f2076c656851276c.json.gz b/web/src/.umi/.cache/babel-loader/a741f8ebcbb7e7b4f2076c656851276c.json.gz deleted file mode 100644 index 06fd5b4c9..000000000 Binary files a/web/src/.umi/.cache/babel-loader/a741f8ebcbb7e7b4f2076c656851276c.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/a7734d64fa9c5c679f308d8524c23364.json.gz b/web/src/.umi/.cache/babel-loader/a7734d64fa9c5c679f308d8524c23364.json.gz deleted file mode 100644 index be3615afb..000000000 Binary files a/web/src/.umi/.cache/babel-loader/a7734d64fa9c5c679f308d8524c23364.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/a89e89f226e6b18e398f0e8bd664e8f8.json.gz b/web/src/.umi/.cache/babel-loader/a89e89f226e6b18e398f0e8bd664e8f8.json.gz deleted file mode 100644 index c2c5eaebb..000000000 Binary files a/web/src/.umi/.cache/babel-loader/a89e89f226e6b18e398f0e8bd664e8f8.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/a99c35a6be8d4313963107aeba245ad4.json.gz b/web/src/.umi/.cache/babel-loader/a99c35a6be8d4313963107aeba245ad4.json.gz deleted file mode 100644 index d878a167d..000000000 Binary files a/web/src/.umi/.cache/babel-loader/a99c35a6be8d4313963107aeba245ad4.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/ae3ef94461c0e4b4675093fe1349dde0.json.gz b/web/src/.umi/.cache/babel-loader/ae3ef94461c0e4b4675093fe1349dde0.json.gz deleted file mode 100644 index be3615afb..000000000 Binary files a/web/src/.umi/.cache/babel-loader/ae3ef94461c0e4b4675093fe1349dde0.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/b0f8bc82a669869baa872c727d62183e.json.gz b/web/src/.umi/.cache/babel-loader/b0f8bc82a669869baa872c727d62183e.json.gz deleted file mode 100644 index fc86f7d73..000000000 Binary files a/web/src/.umi/.cache/babel-loader/b0f8bc82a669869baa872c727d62183e.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/b48adbb2f78c69dfd191d75b91cebc3b.json.gz b/web/src/.umi/.cache/babel-loader/b48adbb2f78c69dfd191d75b91cebc3b.json.gz deleted file mode 100644 index fa9f14c8c..000000000 Binary files a/web/src/.umi/.cache/babel-loader/b48adbb2f78c69dfd191d75b91cebc3b.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/bd90443cc4c28c4159f0e204d489d62d.json.gz b/web/src/.umi/.cache/babel-loader/bd90443cc4c28c4159f0e204d489d62d.json.gz deleted file mode 100644 index 4ed0fd257..000000000 Binary files a/web/src/.umi/.cache/babel-loader/bd90443cc4c28c4159f0e204d489d62d.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/c4829036269fe0e26925d44b9aff785c.json.gz b/web/src/.umi/.cache/babel-loader/c4829036269fe0e26925d44b9aff785c.json.gz deleted file mode 100644 index 4b9cca5d5..000000000 Binary files a/web/src/.umi/.cache/babel-loader/c4829036269fe0e26925d44b9aff785c.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/c511f5c2fdf4b49b53c62ef7800d8c9e.json.gz b/web/src/.umi/.cache/babel-loader/c511f5c2fdf4b49b53c62ef7800d8c9e.json.gz deleted file mode 100644 index 98f036ff9..000000000 Binary files a/web/src/.umi/.cache/babel-loader/c511f5c2fdf4b49b53c62ef7800d8c9e.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/c6aa428735c502b5855657212488138b.json.gz b/web/src/.umi/.cache/babel-loader/c6aa428735c502b5855657212488138b.json.gz deleted file mode 100644 index 00f1e8d58..000000000 Binary files a/web/src/.umi/.cache/babel-loader/c6aa428735c502b5855657212488138b.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/cd5e449cf70030f78c9348d6561ed78d.json.gz b/web/src/.umi/.cache/babel-loader/cd5e449cf70030f78c9348d6561ed78d.json.gz deleted file mode 100644 index 0e64f130f..000000000 Binary files a/web/src/.umi/.cache/babel-loader/cd5e449cf70030f78c9348d6561ed78d.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/da4f778b154e9b5f29b9bdc8a4875333.json.gz b/web/src/.umi/.cache/babel-loader/da4f778b154e9b5f29b9bdc8a4875333.json.gz deleted file mode 100644 index 157005b66..000000000 Binary files a/web/src/.umi/.cache/babel-loader/da4f778b154e9b5f29b9bdc8a4875333.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/e0b04ce5851512768652793ad5efcc0c.json.gz b/web/src/.umi/.cache/babel-loader/e0b04ce5851512768652793ad5efcc0c.json.gz deleted file mode 100644 index 97da43c5d..000000000 Binary files a/web/src/.umi/.cache/babel-loader/e0b04ce5851512768652793ad5efcc0c.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/e182b384189acd0014a6739aa2875df5.json.gz b/web/src/.umi/.cache/babel-loader/e182b384189acd0014a6739aa2875df5.json.gz deleted file mode 100644 index c2c5eaebb..000000000 Binary files a/web/src/.umi/.cache/babel-loader/e182b384189acd0014a6739aa2875df5.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/e596e369795fd149af91a1dfa3771f41.json.gz b/web/src/.umi/.cache/babel-loader/e596e369795fd149af91a1dfa3771f41.json.gz deleted file mode 100644 index 0d18c71a4..000000000 Binary files a/web/src/.umi/.cache/babel-loader/e596e369795fd149af91a1dfa3771f41.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/e7591d348c820463bfa3df4964c28d3e.json.gz b/web/src/.umi/.cache/babel-loader/e7591d348c820463bfa3df4964c28d3e.json.gz deleted file mode 100644 index f88ab88da..000000000 Binary files a/web/src/.umi/.cache/babel-loader/e7591d348c820463bfa3df4964c28d3e.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/e84a6f4980264a7683ee09f75bb8ddd5.json.gz b/web/src/.umi/.cache/babel-loader/e84a6f4980264a7683ee09f75bb8ddd5.json.gz deleted file mode 100644 index 139b0f9b6..000000000 Binary files a/web/src/.umi/.cache/babel-loader/e84a6f4980264a7683ee09f75bb8ddd5.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/edec0e274d09f499adb117a56cac044c.json.gz b/web/src/.umi/.cache/babel-loader/edec0e274d09f499adb117a56cac044c.json.gz deleted file mode 100644 index fc86f7d73..000000000 Binary files a/web/src/.umi/.cache/babel-loader/edec0e274d09f499adb117a56cac044c.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/f15a18c6477c68827e1f58fd21be9ccd.json.gz b/web/src/.umi/.cache/babel-loader/f15a18c6477c68827e1f58fd21be9ccd.json.gz deleted file mode 100644 index 881d6508f..000000000 Binary files a/web/src/.umi/.cache/babel-loader/f15a18c6477c68827e1f58fd21be9ccd.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/fb0a3abc8300b6cd7ed08578c23692b4.json.gz b/web/src/.umi/.cache/babel-loader/fb0a3abc8300b6cd7ed08578c23692b4.json.gz deleted file mode 100644 index 9274c7000..000000000 Binary files a/web/src/.umi/.cache/babel-loader/fb0a3abc8300b6cd7ed08578c23692b4.json.gz and /dev/null differ diff --git a/web/src/.umi/.cache/babel-loader/ff91be5be4a6f4958c7ab00c797d4929.json.gz b/web/src/.umi/.cache/babel-loader/ff91be5be4a6f4958c7ab00c797d4929.json.gz deleted file mode 100644 index 85f53c96d..000000000 Binary files a/web/src/.umi/.cache/babel-loader/ff91be5be4a6f4958c7ab00c797d4929.json.gz and /dev/null differ diff --git a/web/src/.umi/core/history.ts b/web/src/.umi/core/history.ts deleted file mode 100644 index d002c6360..000000000 --- a/web/src/.umi/core/history.ts +++ /dev/null @@ -1,21 +0,0 @@ -// @ts-nocheck -import { createBrowserHistory, History } from '/root/ob-repository-synchronize/web/node_modules/umi/node_modules/@umijs/runtime'; - -let options = { - "basename": "/" -}; -if ((window).routerBase) { - options.basename = (window).routerBase; -} - -// remove initial history because of ssr -let history: History = process.env.__IS_SERVER ? null : createBrowserHistory(options); -export const createHistory = (hotReload = false) => { - if (!hotReload) { - history = createBrowserHistory(options); - } - - return history; -}; - -export { history }; diff --git a/web/src/.umi/core/plugin.ts b/web/src/.umi/core/plugin.ts deleted file mode 100644 index 87af436c7..000000000 --- a/web/src/.umi/core/plugin.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @ts-nocheck -import { Plugin } from '/root/ob-repository-synchronize/web/node_modules/umi/node_modules/@umijs/runtime'; - -const plugin = new Plugin({ - validKeys: ['modifyClientRenderOpts','patchRoutes','rootContainer','render','onRouteChange','__mfsu','getInitialState','initialStateConfig','request',], -}); - -export { plugin }; diff --git a/web/src/.umi/core/pluginConfig.d.ts b/web/src/.umi/core/pluginConfig.d.ts deleted file mode 100644 index 0241cff50..000000000 --- a/web/src/.umi/core/pluginConfig.d.ts +++ /dev/null @@ -1,303 +0,0 @@ -// Created by Umi Plugin - -export interface IConfigFromPlugins { -"404"?: boolean -routes?: { -/** - * Any valid URL path - */ -path?: string -/** - * A React component to render only when the location matches. - */ -component?: (string | (() => any)) -wrappers?: string[] -/** - * navigate to a new location - */ -redirect?: string -/** - * When true, the active class/style will only be applied if the location is matched exactly. - */ -exact?: boolean -routes?: any[] -[k: string]: any -}[] -history?: { -type?: ("browser" | "hash" | "memory") -options?: { - -} -} -polyfill?: { -imports?: string[] -} -alias?: { - -} -analyze?: { -analyzerMode?: ("server" | "static" | "disabled") -analyzerHost?: string -analyzerPort?: any -openAnalyzer?: boolean -generateStatsFile?: boolean -statsFilename?: string -logLevel?: ("info" | "warn" | "error" | "silent") -defaultSizes?: ("stat" | "parsed" | "gzip") -[k: string]: any -} -/** - * postcss autoprefixer, default flexbox: no-2009 - */ -autoprefixer?: { - -} -base?: string -chainWebpack?: (() => any) -chunks?: string[] -/** - * more css-loader options see https://webpack.js.org/loaders/css-loader/#options - */ -cssLoader?: { -url?: (boolean | (() => any)) -import?: (boolean | (() => any)) -modules?: (boolean | string | { - -}) -sourceMap?: boolean -importLoaders?: number -onlyLocals?: boolean -esModule?: boolean -localsConvention?: ("asIs" | "camelCase" | "camelCaseOnly" | "dashes" | "dashesOnly") -} -cssModulesTypescriptLoader?: { -mode?: ("emit" | "verify") -} -cssnano?: { - -} -copy?: any[] -define?: { - -} -devScripts?: { - -} -/** - * devServer configs - */ -devServer?: { -/** - * devServer port, default 8000 - */ -port?: number -host?: string -https?: ({ -key?: string -cert?: string -[k: string]: any -} | boolean) -headers?: { - -} -writeToDisk?: (boolean | (() => any)) -[k: string]: any -} -devtool?: string -/** - * Code splitting for performance optimization - */ -dynamicImport?: { -/** - * loading the component before loaded - */ -loading?: string -} -/** - * Code splitting for import statement syntax - */ -dynamicImportSyntax?: { - -} -exportStatic?: { -htmlSuffix?: boolean -dynamicRoot?: boolean -supportWin?: boolean -/** - * extra render paths only enable in ssr - */ -extraRoutePaths?: (() => any) -} -externals?: ({ - -} | string | (() => any)) -extraBabelIncludes?: any[] -extraBabelPlugins?: any[] -extraBabelPresets?: any[] -extraPostCSSPlugins?: any[] -/** - * fork-ts-checker-webpack-plugin options see https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#options - */ -forkTSChecker?: { -async?: boolean -typescript?: (boolean | { - -}) -eslint?: { - -} -issue?: { - -} -formatter?: (string | { - -}) -logger?: { - -} -[k: string]: any -} -fastRefresh?: { - -} -hash?: boolean -ignoreMomentLocale?: boolean -inlineLimit?: number -lessLoader?: { - -} -manifest?: { -fileName?: string -publicPath?: "" -basePath?: string -writeToFileEmit?: boolean -} -/** - * open mfsu feature - */ -mfsu?: { -development?: { -output?: string -} -production?: { -output?: string -} -mfName?: string -exportAllMembers?: { - -} -chunks?: string[] -ignoreNodeBuiltInModules?: boolean -} -mountElementId?: "" -mpa?: { - -} -nodeModulesTransform?: { -type?: ("all" | "none") -exclude?: string[] -} -outputPath?: "" -plugins?: string[] -postcssLoader?: { - -} -presets?: string[] -proxy?: { - -} -publicPath?: string -runtimePublicPath?: boolean -ssr?: { -/** - * force execing Page getInitialProps functions - */ -forceInitial?: boolean -/** - * remove window.g_initialProps in html - */ -removeWindowInitialProps?: boolean -/** - * disable serve-side render in umi dev mode. - */ -devServerRender?: boolean -mode?: ("stream" | "string") -/** - * static markup in static site - */ -staticMarkup?: boolean -} -singular?: boolean -styleLoader?: { - -} -targets?: { - -} -terserOptions?: { - -} -theme?: { - -} -runtimeHistory?: { - -} -webpack5?: { -lazyCompilation?: { -entries?: boolean -imports?: boolean -test?: any -} -} -workerLoader?: { - -} -favicon?: string -headScripts?: any[] -links?: any[] -metas?: any[] -scripts?: any[] -styles?: any[] -title?: string -mock?: { -exclude?: string[] -} -antd?: { -dark?: boolean -compact?: boolean -mobile?: boolean -disableBabelPluginImport?: boolean -config?: { - -} -} -dva?: { -disableModelsReExport?: boolean -/** - * lazy load dva model avoiding the import modules from umi undefined - */ -lazyLoad?: boolean -extraModels?: string[] -hmr?: boolean -immer?: (boolean | { - -}) -skipModelValidate?: boolean -} -locale?: { -default?: string -useLocalStorage?: boolean -baseNavigator?: boolean -title?: boolean -antd?: boolean -baseSeparator?: string -} -layout?: { - -} -request?: { -dataField?: "" -} -[k: string]: any -} diff --git a/web/src/.umi/core/pluginRegister.ts b/web/src/.umi/core/pluginRegister.ts deleted file mode 100644 index 71530ddaa..000000000 --- a/web/src/.umi/core/pluginRegister.ts +++ /dev/null @@ -1,20 +0,0 @@ -// @ts-nocheck -import { plugin } from './plugin'; -import * as Plugin_0 from '../../app.ts'; -import * as Plugin_1 from '../plugin-initial-state/runtime'; -import * as Plugin_2 from '../plugin-model/runtime'; - - plugin.register({ - apply: Plugin_0, - path: '../../app.ts', - }); - plugin.register({ - apply: Plugin_1, - path: '../plugin-initial-state/runtime', - }); - plugin.register({ - apply: Plugin_2, - path: '../plugin-model/runtime', - }); - -export const __mfsu = 1; diff --git a/web/src/.umi/core/polyfill.ts b/web/src/.umi/core/polyfill.ts deleted file mode 100644 index ed222a0d0..000000000 --- a/web/src/.umi/core/polyfill.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-nocheck -import 'core-js'; -import 'regenerator-runtime/runtime'; -export {}; diff --git a/web/src/.umi/core/routes.ts b/web/src/.umi/core/routes.ts deleted file mode 100644 index 6e34a4de9..000000000 --- a/web/src/.umi/core/routes.ts +++ /dev/null @@ -1,58 +0,0 @@ -// @ts-nocheck -import React from 'react'; -import { ApplyPluginsType } from '/root/ob-repository-synchronize/web/node_modules/umi/node_modules/@umijs/runtime'; -import * as umiExports from './umiExports'; -import { plugin } from './plugin'; - -export function getRoutes() { - const routes = [ - { - "path": "/", - "component": require('@/layouts/index').default, - "routes": [ - { - "path": "/", - "redirect": "/obrobot/project", - "exact": true - }, - { - "name": "同步工程管理", - "path": "/obrobot/project", - "component": require('@/pages/project/index').default, - "exact": true, - "icon": "project" - }, - { - "name": "同步流", - "path": "/obrobot/project/process", - "component": require('@/pages/process/index').default, - "exact": true, - "hideInMenu": true - }, - { - "name": "Pull Request", - "path": "/obrobot/project/pull_request", - "component": require('@/pages/pullRequest/index').default, - "exact": true, - "hideInMenu": true - }, - { - "name": "Github 关联账号管理", - "path": "/obrobot/account", - "component": require('@/pages/account/index').default, - "exact": true, - "icon": "account" - } - ] - } -]; - - // allow user to extend routes - plugin.applyPlugins({ - key: 'patchRoutes', - type: ApplyPluginsType.event, - args: { routes }, - }); - - return routes; -} diff --git a/web/src/.umi/core/umiExports.ts b/web/src/.umi/core/umiExports.ts deleted file mode 100644 index 81e84d3bb..000000000 --- a/web/src/.umi/core/umiExports.ts +++ /dev/null @@ -1,7 +0,0 @@ -// @ts-nocheck -export { history } from './history'; -export { plugin } from './plugin'; -export * from '../plugin-initial-state/exports'; -export * from '../plugin-model/useModel'; -export * from '../plugin-request/request'; -export * from '../plugin-helmet/exports'; diff --git a/web/src/.umi/plugin-helmet/exports.ts b/web/src/.umi/plugin-helmet/exports.ts deleted file mode 100644 index 8b76d1397..000000000 --- a/web/src/.umi/plugin-helmet/exports.ts +++ /dev/null @@ -1,3 +0,0 @@ -// @ts-nocheck -// @ts-ignore -export { Helmet } from '/root/ob-repository-synchronize/web/node_modules/react-helmet'; diff --git a/web/src/.umi/plugin-initial-state/Provider.tsx b/web/src/.umi/plugin-initial-state/Provider.tsx deleted file mode 100644 index 72fef4161..000000000 --- a/web/src/.umi/plugin-initial-state/Provider.tsx +++ /dev/null @@ -1,37 +0,0 @@ -// @ts-nocheck - -import React, { useRef, useEffect } from "react"; -import { plugin } from "../core/umiExports"; -import { ApplyPluginsType } from 'umi'; -import { useModel } from "../plugin-model/useModel"; -if (typeof useModel !== "function") { - throw new Error( - "[plugin-initial-state]: useModel is not a function, @umijs/plugin-model is required." - ); -} - -interface Props { - children: React.ReactNode; -} -export default (props: Props) => { - const { children } = props; - const appLoaded = useRef(false); - // 获取用户的配置,暂时只支持 loading - const useRuntimeConfig = - plugin.applyPlugins({ - key: "initialStateConfig", - type: ApplyPluginsType.modify, - initialValue: {}, - }) || {}; - const { loading = false } = useModel("@@initialState") || {}; - useEffect(() => { - if (!loading) { - appLoaded.current = true; - } - }, [loading]); - // initial state loading 时,阻塞渲染 - if (loading && !appLoaded.current) { - return useRuntimeConfig.loading || null; - } - return children; -}; diff --git a/web/src/.umi/plugin-initial-state/exports.ts b/web/src/.umi/plugin-initial-state/exports.ts deleted file mode 100644 index 8c0290e11..000000000 --- a/web/src/.umi/plugin-initial-state/exports.ts +++ /dev/null @@ -1,7 +0,0 @@ -// @ts-nocheck - -// @ts-ignore -import { InitialState as InitialStateType } from '../plugin-initial-state/models/initialState'; - -export type InitialState = InitialStateType; -export const __PLUGIN_INITIAL_STATE = 1; diff --git a/web/src/.umi/plugin-initial-state/models/initialState.ts b/web/src/.umi/plugin-initial-state/models/initialState.ts deleted file mode 100644 index 4ee992f26..000000000 --- a/web/src/.umi/plugin-initial-state/models/initialState.ts +++ /dev/null @@ -1,2 +0,0 @@ -// @ts-nocheck -export default () => ({ loading: false, refresh: () => {} }) \ No newline at end of file diff --git a/web/src/.umi/plugin-initial-state/runtime.tsx b/web/src/.umi/plugin-initial-state/runtime.tsx deleted file mode 100644 index 870ae68b1..000000000 --- a/web/src/.umi/plugin-initial-state/runtime.tsx +++ /dev/null @@ -1,13 +0,0 @@ -// @ts-nocheck -import React from 'react'; -import Provider from './Provider'; - -export function rootContainer(container: React.ReactNode) { - return React.createElement( - // 这里的 plugin-initial-state 不能从 constant 里取,里面有 path 依赖 - // 但 webpack-5 没有 node 补丁(包括 path) - Provider, - null, - container, - ); -} diff --git a/web/src/.umi/plugin-model/Provider.tsx b/web/src/.umi/plugin-model/Provider.tsx deleted file mode 100644 index b47b0305c..000000000 --- a/web/src/.umi/plugin-model/Provider.tsx +++ /dev/null @@ -1,39 +0,0 @@ -// @ts-nocheck -import React from 'react'; -import initialState from '/root/ob-repository-synchronize/web/src/.umi/plugin-initial-state/models/initialState'; -import model0 from "/root/ob-repository-synchronize/web/src/models/global"; -// @ts-ignore -import Dispatcher from './helpers/dispatcher'; -// @ts-ignore -import Executor from './helpers/executor'; -// @ts-ignore -import { UmiContext } from './helpers/constant'; - -export const models = { '@@initialState': initialState, 'global': model0 }; - -export type Model = { - [key in keyof typeof models]: ReturnType; -}; - -export type Models = Model[T] - -const dispatcher = new Dispatcher!(); -const Exe = Executor!; - -export default ({ children }: { children: React.ReactNode }) => { - - return ( - - { - Object.entries(models).map(pair => ( - { - const [ns] = pair as [keyof typeof models, any]; - dispatcher.data[ns] = val; - dispatcher.update(ns); - }} /> - )) - } - {children} - - ) -} diff --git a/web/src/.umi/plugin-model/helpers/constant.tsx b/web/src/.umi/plugin-model/helpers/constant.tsx deleted file mode 100644 index edb52fca8..000000000 --- a/web/src/.umi/plugin-model/helpers/constant.tsx +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-nocheck -import React from 'react'; - -export const UmiContext = React.createContext({}); diff --git a/web/src/.umi/plugin-model/helpers/dispatcher.tsx b/web/src/.umi/plugin-model/helpers/dispatcher.tsx deleted file mode 100644 index 2acdf4944..000000000 --- a/web/src/.umi/plugin-model/helpers/dispatcher.tsx +++ /dev/null @@ -1,19 +0,0 @@ -// @ts-nocheck -export default class Dispatcher { - callbacks = {}; - - data = {}; - - update = (namespace: string) => { - (this.callbacks[namespace] || []).forEach( - (callback: (val: any) => void) => { - try { - const data = this.data[namespace]; - callback(data); - } catch (e) { - callback(undefined); - } - }, - ); - }; -} diff --git a/web/src/.umi/plugin-model/helpers/executor.tsx b/web/src/.umi/plugin-model/helpers/executor.tsx deleted file mode 100644 index 74f30f0bb..000000000 --- a/web/src/.umi/plugin-model/helpers/executor.tsx +++ /dev/null @@ -1,83 +0,0 @@ -// @ts-nocheck -import React, { useEffect, useRef, useMemo } from 'react'; - -interface ExecutorProps { - hook: () => any; - onUpdate: (val: any) => void; - namespace: string; -} - -export default (props: ExecutorProps) => { - const { hook, onUpdate, namespace } = props; - - const updateRef = useRef(onUpdate); - updateRef.current = onUpdate; - const initialLoad = useRef(false); - - let data: any; - try { - data = hook(); - if ( - process.env.NODE_ENV === 'development' && - typeof document !== 'undefined' - ) { - try { - let count = Object.keys( - ((window as any)._umi_useModel_dev_tool_log || {})[namespace] || {}, - ).length; - (window as any)._umi_useModel_dev_tool = Object.assign( - (window as any)._umi_useModel_dev_tool || {}, - { - [namespace]: data, - }, - ); - (window as any)._umi_useModel_dev_tool_log = Object.assign( - (window as any)._umi_useModel_dev_tool_log || {}, - { - [namespace]: Object.assign( - ((window as any)._umi_useModel_dev_tool_log || {})[namespace] || - {}, - { - [count]: data, - }, - ), - }, - ); - window.dispatchEvent( - new CustomEvent('_umi_useModel_update', { - detail: { - namespace, - time: Date.now(), - data, - index: count, - }, - }), - ); - } catch (e) { - // dev tool 记录失败、可能是低版本浏览器,忽略 - } - } - } catch (e) { - console.error( - `plugin-model: Invoking '${namespace || 'unknown'}' model failed:`, - e, - ); - } - - // 首次执行时立刻返回初始值 - useMemo(() => { - updateRef.current(data); - initialLoad.current = false; - }, []); - - // React 16.13 后 update 函数用 useEffect 包裹 - useEffect(() => { - if (initialLoad.current) { - updateRef.current(data); - } else { - initialLoad.current = true; - } - }); - - return <>; -}; diff --git a/web/src/.umi/plugin-model/runtime.tsx b/web/src/.umi/plugin-model/runtime.tsx deleted file mode 100644 index fbfa5f6c1..000000000 --- a/web/src/.umi/plugin-model/runtime.tsx +++ /dev/null @@ -1,12 +0,0 @@ -// @ts-nocheck -/* eslint-disable import/no-dynamic-require */ -import React from 'react'; -import Provider from './Provider'; - -export function rootContainer(container: React.ReactNode) { - return React.createElement( - Provider, - null, - container, - ); -} diff --git a/web/src/.umi/plugin-model/useModel.tsx b/web/src/.umi/plugin-model/useModel.tsx deleted file mode 100644 index 78984cfab..000000000 --- a/web/src/.umi/plugin-model/useModel.tsx +++ /dev/null @@ -1,71 +0,0 @@ -// @ts-nocheck -import { useState, useEffect, useContext, useRef } from 'react'; -// @ts-ignore -import isEqual from '/root/ob-repository-synchronize/web/node_modules/@umijs/plugin-model/node_modules/fast-deep-equal/index.js'; -// @ts-ignore -import { UmiContext } from './helpers/constant'; -import { Model, models } from './Provider'; - -export type Models = Model[T] - -export function useModel>(model: T): Model[T] -export function useModel, U>(model: T, selector: (model: Model[T]) => U): U - -export function useModel, U>( - namespace: T, - updater?: (model: Model[T]) => U -) : typeof updater extends undefined ? Model[T] : ReturnType>{ - - type RetState = typeof updater extends undefined ? Model[T] : ReturnType> - const dispatcher = useContext(UmiContext); - const updaterRef = useRef(updater); - updaterRef.current = updater; - const [state, setState] = useState( - () => updaterRef.current ? updaterRef.current(dispatcher.data![namespace]) : dispatcher.data![namespace] - ); - const stateRef = useRef(state); - stateRef.current = state; - - const isMount = useRef(false); - useEffect(() => { - isMount.current = true; - return () => { - isMount.current = false; - } - }, []) - - useEffect(() => { - const handler = (e: any) => { - if(!isMount.current) { - // 如果 handler 执行过程中,组件被卸载了,则强制更新全局 data - setTimeout(() => { - dispatcher.data![namespace] = e; - dispatcher.update(namespace); - }); - } else { - if(updater && updaterRef.current){ - const currentState = updaterRef.current(e); - const previousState = stateRef.current - if(!isEqual(currentState, previousState)){ - setState(currentState); - } - } else { - setState(e); - } - } - } - try { - dispatcher.callbacks![namespace]!.add(handler); - dispatcher.update(namespace); - } catch (e) { - dispatcher.callbacks![namespace] = new Set(); - dispatcher.callbacks![namespace]!.add(handler); - dispatcher.update(namespace); - } - return () => { - dispatcher.callbacks![namespace]!.delete(handler); - } - }, [namespace]); - - return state; -}; diff --git a/web/src/.umi/plugin-request/request.ts b/web/src/.umi/plugin-request/request.ts deleted file mode 100644 index 1f125a210..000000000 --- a/web/src/.umi/plugin-request/request.ts +++ /dev/null @@ -1,278 +0,0 @@ -// @ts-nocheck -/** - * Base on https://github.com/umijs//root/ob-repository-synchronize/web/node_modules/umi-request - */ -import { - extend, - Context, - RequestOptionsInit, - OnionMiddleware, - RequestOptionsWithoutResponse, - RequestMethod, - RequestOptionsWithResponse, - RequestResponse, - RequestInterceptor, - ResponseInterceptor, -} from '/root/ob-repository-synchronize/web/node_modules/umi-request'; -// @ts-ignore - -import { ApplyPluginsType } from 'umi'; -import { history, plugin } from '../core/umiExports'; - -// decoupling with antd UI library, you can using `alias` modify the ui methods -// @ts-ignore -import { message, notification } from '@umijs/plugin-request/lib/ui'; -import useUmiRequest, { UseRequestProvider } from '/root/ob-repository-synchronize/web/node_modules/@ahooksjs/use-request'; -import { - BaseOptions, - BasePaginatedOptions, - BaseResult, - CombineService, - LoadMoreFormatReturn, - LoadMoreOptions, - LoadMoreOptionsWithFormat, - LoadMoreParams, - LoadMoreResult, - OptionsWithFormat, - PaginatedFormatReturn, - PaginatedOptionsWithFormat, - PaginatedParams, - PaginatedResult, -} from '/root/ob-repository-synchronize/web/node_modules/@ahooksjs/use-request/lib/types'; - -type ResultWithData = { data?: T; [key: string]: any }; - -function useRequest< - R = any, - P extends any[] = any, - U = any, - UU extends U = any, ->( - service: CombineService, - options: OptionsWithFormat, -): BaseResult; -function useRequest( - service: CombineService, - options?: BaseOptions, -): BaseResult; -function useRequest( - service: CombineService>, - options: LoadMoreOptionsWithFormat, -): LoadMoreResult; -function useRequest< - R extends ResultWithData = any, - RR extends R = any, ->( - service: CombineService>, - options: LoadMoreOptions, -): LoadMoreResult; - -function useRequest( - service: CombineService, - options: PaginatedOptionsWithFormat, -): PaginatedResult; -function useRequest( - service: CombineService< - ResultWithData>, - PaginatedParams - >, - options: BasePaginatedOptions, -): PaginatedResult; -function useRequest(service: any, options: any = {}) { - return useUmiRequest(service, { - formatResult: result => result?.data, - requestMethod: (requestOptions: any) => { - if (typeof requestOptions === 'string') { - return request(requestOptions); - } - if (typeof requestOptions === 'object') { - const { url, ...rest } = requestOptions; - return request(url, rest); - } - throw new Error('request options error'); - }, - ...options, - }); -} - -export interface RequestConfig extends RequestOptionsInit { - errorConfig?: { - errorPage?: string; - adaptor?: (resData: any, ctx: Context) => ErrorInfoStructure; - }; - middlewares?: OnionMiddleware[]; - requestInterceptors?: RequestInterceptor[]; - responseInterceptors?: ResponseInterceptor[]; -} - -export enum ErrorShowType { - SILENT = 0, - WARN_MESSAGE = 1, - ERROR_MESSAGE = 2, - NOTIFICATION = 4, - REDIRECT = 9, -} - -interface ErrorInfoStructure { - success: boolean; - data?: any; - errorCode?: string; - errorMessage?: string; - showType?: ErrorShowType; - traceId?: string; - host?: string; - [key: string]: any; -} - -interface RequestError extends Error { - data?: any; - info?: ErrorInfoStructure; - request?: Context['req']; - response?: Context['res']; -} - -const DEFAULT_ERROR_PAGE = '/exception'; - -let requestMethodInstance: RequestMethod; -const getRequestMethod = () => { - if (requestMethodInstance) { - // request method 已经示例化 - return requestMethodInstance; - } - - // runtime 配置可能应为依赖顺序的问题在模块初始化的时候无法获取,所以需要封装一层在异步调用后初始化相关方法 - // 当用户的 app.ts 中依赖了该文件的情况下就该模块的初始化时间就会被提前,无法获取到运行时配置 - const requestConfig: RequestConfig = plugin.applyPlugins({ - key: 'request', - type: ApplyPluginsType.modify, - initialValue: {}, - }); - - const errorAdaptor = - requestConfig.errorConfig?.adaptor || ((resData) => resData); - - requestMethodInstance = extend({ - errorHandler: (error: RequestError) => { - // @ts-ignore - if (error?.request?.options?.skipErrorHandler) { - throw error; - } - let errorInfo: ErrorInfoStructure | undefined; - if (error.name === 'ResponseError' && error.data && error.request) { - const ctx: Context = { - req: error.request, - res: error.response, - }; - errorInfo = errorAdaptor(error.data, ctx); - error.message = errorInfo?.errorMessage || error.message; - error.data = error.data; - error.info = errorInfo; - } - errorInfo = error.info; - - if (errorInfo) { - const errorMessage = errorInfo?.errorMessage; - const errorCode = errorInfo?.errorCode; - const errorPage = - requestConfig.errorConfig?.errorPage || DEFAULT_ERROR_PAGE; - - switch (errorInfo?.showType) { - case ErrorShowType.SILENT: - // do nothing - break; - case ErrorShowType.WARN_MESSAGE: - message.warn(errorMessage); - break; - case ErrorShowType.ERROR_MESSAGE: - message.error(errorMessage); - break; - case ErrorShowType.NOTIFICATION: - notification.open({ - description: errorMessage, - message: errorCode, - }); - break; - case ErrorShowType.REDIRECT: - // @ts-ignore - history.push({ - pathname: errorPage, - query: { errorCode, errorMessage }, - }); - // redirect to error page - break; - default: - message.error(errorMessage); - break; - } - } else { - message.error(error.message || 'Request error, please retry.'); - } - throw error; - }, - ...requestConfig, - }); - - // 中间件统一错误处理 - // 后端返回格式 { success: boolean, data: any } - // 按照项目具体情况修改该部分逻辑 - requestMethodInstance.use(async (ctx, next) => { - await next(); - const { req, res } = ctx; - // @ts-ignore - if (req.options?.skipErrorHandler) { - return; - } - const { options } = req; - const { getResponse } = options; - const resData = getResponse ? res.data : res; - const errorInfo = errorAdaptor(resData, ctx); - if (errorInfo.success === false) { - // 抛出错误到 errorHandler 中处理 - const error: RequestError = new Error(errorInfo.errorMessage); - error.name = 'BizError'; - error.data = resData; - error.info = errorInfo; - error.response = res; - throw error; - } - }); - - // Add user custom middlewares - const customMiddlewares = requestConfig.middlewares || []; - customMiddlewares.forEach((mw) => { - requestMethodInstance.use(mw); - }); - - // Add user custom interceptors - const requestInterceptors = requestConfig.requestInterceptors || []; - const responseInterceptors = requestConfig.responseInterceptors || []; - requestInterceptors.map((ri) => { - requestMethodInstance.interceptors.request.use(ri); - }); - responseInterceptors.map((ri) => { - requestMethodInstance.interceptors.response.use(ri); - }); - - return requestMethodInstance; -}; - -interface RequestMethodInUmi { - ( - url: string, - options: RequestOptionsWithResponse & { skipErrorHandler?: boolean }, - ): Promise>; - ( - url: string, - options: RequestOptionsWithoutResponse & { skipErrorHandler?: boolean }, - ): Promise; - ( - url: string, - options?: RequestOptionsInit & { skipErrorHandler?: boolean }, - ): R extends true ? Promise> : Promise; -} -const request: RequestMethodInUmi = (url: any, options: any) => { - const requestMethod = getRequestMethod(); - return requestMethod(url, options); -}; - -export { request, useRequest, UseRequestProvider }; diff --git a/web/src/.umi/umi.ts b/web/src/.umi/umi.ts deleted file mode 100644 index c2212701d..000000000 --- a/web/src/.umi/umi.ts +++ /dev/null @@ -1,58 +0,0 @@ -// @ts-nocheck -import './core/polyfill'; - -import { plugin } from './core/plugin'; -import './core/pluginRegister'; -import { createHistory } from './core/history'; -import { ApplyPluginsType } from '/root/ob-repository-synchronize/web/node_modules/umi/node_modules/@umijs/runtime'; -import { renderClient } from '/root/ob-repository-synchronize/web/node_modules/@umijs/renderer-react/dist/index.js'; -import { getRoutes } from './core/routes'; - - -import '../global.less'; - -const getClientRender = (args: { hot?: boolean; routes?: any[] } = {}) => plugin.applyPlugins({ - key: 'render', - type: ApplyPluginsType.compose, - initialValue: () => { - const opts = plugin.applyPlugins({ - key: 'modifyClientRenderOpts', - type: ApplyPluginsType.modify, - initialValue: { - routes: args.routes || getRoutes(), - plugin, - history: createHistory(args.hot), - isServer: process.env.__IS_SERVER, - rootElement: 'root', - defaultTitle: ``, - }, - }); - return renderClient(opts); - }, - args, -}); - -const clientRender = getClientRender(); -export default clientRender(); - - - window.g_umi = { - version: '3.5.26', - }; - - -// hot module replacement -// @ts-ignore -if (module.hot) { - // @ts-ignore - module.hot.accept('./core/routes', () => { - const ret = require('./core/routes'); - if (ret.then) { - ret.then(({ getRoutes }) => { - getClientRender({ hot: true, routes: getRoutes() })(); - }); - } else { - getClientRender({ hot: true, routes: ret.getRoutes() })(); - } - }); -}