feat(source link): create perm source link with shorter url

This commit is contained in:
HFO4 2022-10-30 09:42:53 +08:00
parent 2ca4a957a5
commit 10eedadea3
3 changed files with 9 additions and 12 deletions

View File

@ -666,6 +666,7 @@ module.exports = function(webpackEnv) {
// a route with query params (e.g. auth callbacks).
new RegExp('/[^/?]+\\.[^/]+$'),
new RegExp(/^\/api/),
new RegExp(/^\/f/),
new RegExp(/^\/custom/),
],
}),

View File

@ -1065,8 +1065,12 @@ export const batchGetSource = (): ThunkAction<any, any, any, any> => {
API.post("/file/source", { items: items })
.then((response) => {
console.log(response);
dispatch(closeAllModals());
if (response.data.length == 1 && response.data[0].error) {
dispatch(toggleSnackbar("top", "right", response.data[0].error, "warning"));
return
}
dispatch(
openGetSourceDialog(
response.data.length == 1

View File

@ -1,19 +1,11 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const proxy = require("http-proxy-middleware");
module.exports = function (app) {
app.use(
"/api",
["/api","/custom","/f"].map(p=>app.use(
p,
proxy({
target: "http://localhost:5212",
changeOrigin: true,
})
);
app.use(
"/custom",
proxy({
target: "http://localhost:5212",
changeOrigin: true,
})
);
))
};