chore: update resource base url

This commit is contained in:
Steven 2022-09-09 07:40:21 +08:00
parent b1e6956441
commit fbce43870f
4 changed files with 13 additions and 6 deletions

View File

@ -56,8 +56,11 @@ func NewServer(profile *profile.Profile) *Server {
Profile: profile,
}
publicRouteGroup := e.Group("/h")
s.registerResourcePublicRoutes(publicRouteGroup)
webhookGroup := e.Group("/h")
s.registerResourcePublicRoutes(webhookGroup)
publicGroup := e.Group("/o")
s.registerResourcePublicRoutes(publicGroup)
apiGroup := e.Group("/api")
apiGroup.Use(func(next echo.HandlerFunc) echo.HandlerFunc {

View File

@ -116,7 +116,7 @@ const MemoEditor = () => {
try {
const image = await resourceService.upload(file);
const url = `/h/r/${image.id}/${image.filename}`;
const url = `/o/r/${image.id}/${image.filename}`;
return url;
} catch (error: any) {
console.error(error);

View File

@ -90,11 +90,11 @@ const ResourcesDialog: React.FC<Props> = (props: Props) => {
};
const handlPreviewBtnClick = (resource: Resource) => {
showPreviewImageDialog(`${window.location.origin}/h/r/${resource.id}/${resource.filename}`);
showPreviewImageDialog(`${window.location.origin}/o/r/${resource.id}/${resource.filename}`);
};
const handleCopyResourceLinkBtnClick = (resource: Resource) => {
utils.copyTextToClipboard(`${window.location.origin}/h/r/${resource.id}/${resource.filename}`);
utils.copyTextToClipboard(`${window.location.origin}/o/r/${resource.id}/${resource.filename}`);
toastHelper.success("Succeed to copy resource link to clipboard");
};

View File

@ -6,13 +6,17 @@ import { resolve } from "path";
export default defineConfig({
plugins: [react()],
server: {
cors: true,
host: "0.0.0.0",
port: 3000,
proxy: {
"/api": {
target: "http://localhost:8080/",
changeOrigin: true,
},
"/o/": {
target: "http://localhost:8080/",
changeOrigin: true,
},
"/h/": {
target: "http://localhost:8080/",
changeOrigin: true,