mirror of
https://github.com/usememos/memos.git
synced 2024-09-21 00:37:58 +03:00
chore: update resource base url
This commit is contained in:
parent
b1e6956441
commit
fbce43870f
@ -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 {
|
||||
|
@ -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);
|
||||
|
@ -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");
|
||||
};
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user