🐛 Fix avatar and banner APIs
This commit is contained in:
		
							
								
								
									
										63
									
								
								.idea/workspace.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										63
									
								
								.idea/workspace.xml
									
									
									
										generated
									
									
									
								
							| @@ -4,15 +4,10 @@ | ||||
|     <option name="autoReloadType" value="ALL" /> | ||||
|   </component> | ||||
|   <component name="ChangeListManager"> | ||||
|     <list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":bug: Fix magic token's foreign key"> | ||||
|     <list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":sparkles: Better avatar and banner APIs"> | ||||
|       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> | ||||
|       <change beforePath="$PROJECT_DIR$/pkg/internal/server/api/avatar_api.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/server/api/avatar_api.go" afterDir="false" /> | ||||
|       <change beforePath="$PROJECT_DIR$/pkg/internal/server/api/index.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/server/api/index.go" afterDir="false" /> | ||||
|       <change beforePath="$PROJECT_DIR$/settings.toml" beforeDir="false" afterPath="$PROJECT_DIR$/settings.toml" afterDir="false" /> | ||||
|       <change beforePath="$PROJECT_DIR$/web/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/web/.gitignore" afterDir="false" /> | ||||
|       <change beforePath="$PROJECT_DIR$/web/.vite/deps/_metadata.json" beforeDir="false" afterPath="$PROJECT_DIR$/web/.vite/deps/_metadata.json" afterDir="false" /> | ||||
|       <change beforePath="$PROJECT_DIR$/web/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/web/package.json" afterDir="false" /> | ||||
|       <change beforePath="$PROJECT_DIR$/web/src/components/NotificationList.vue" beforeDir="false" afterPath="$PROJECT_DIR$/web/src/components/NotificationList.vue" afterDir="false" /> | ||||
|       <change beforePath="$PROJECT_DIR$/web/src/components/UserMenu.vue" beforeDir="false" afterPath="$PROJECT_DIR$/web/src/components/UserMenu.vue" afterDir="false" /> | ||||
|       <change beforePath="$PROJECT_DIR$/web/src/views/dashboard.vue" beforeDir="false" afterPath="$PROJECT_DIR$/web/src/views/dashboard.vue" afterDir="false" /> | ||||
|     </list> | ||||
|     <option name="SHOW_DIALOG" value="false" /> | ||||
| @@ -48,34 +43,34 @@ | ||||
|     <option name="hideEmptyMiddlePackages" value="true" /> | ||||
|     <option name="showLibraryContents" value="true" /> | ||||
|   </component> | ||||
|   <component name="PropertiesComponent"><![CDATA[{ | ||||
|   "keyToString": { | ||||
|     "DefaultGoTemplateProperty": "Go File", | ||||
|     "Go Build.Backend.executor": "Run", | ||||
|     "Go 构建.Backend.executor": "Run", | ||||
|     "RunOnceActivity.ShowReadmeOnStart": "true", | ||||
|     "RunOnceActivity.go.formatter.settings.were.checked": "true", | ||||
|     "RunOnceActivity.go.migrated.go.modules.settings": "true", | ||||
|     "RunOnceActivity.go.modules.automatic.dependencies.download": "true", | ||||
|     "RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "true", | ||||
|     "git-widget-placeholder": "master", | ||||
|     "go.import.settings.migrated": "true", | ||||
|     "go.sdk.automatically.set": "true", | ||||
|     "last_opened_file_path": "/Users/littlesheep/Documents/Projects/Hydrogen/Passport/pkg/internal/server/api", | ||||
|     "node.js.detected.package.eslint": "true", | ||||
|     "node.js.selected.package.eslint": "(autodetect)", | ||||
|     "nodejs_package_manager_path": "npm", | ||||
|     "run.code.analysis.last.selected.profile": "pProject Default", | ||||
|     "settings.editor.selected.configurable": "preferences.pluginManager", | ||||
|     "ts.external.directory.path": "/Users/littlesheep/Documents/Projects/Hydrogen/Passport/web/node_modules/typescript/lib", | ||||
|     "vue.rearranger.settings.migration": "true" | ||||
|   <component name="PropertiesComponent">{ | ||||
|   "keyToString": { | ||||
|     "DefaultGoTemplateProperty": "Go File", | ||||
|     "Go Build.Backend.executor": "Run", | ||||
|     "Go 构建.Backend.executor": "Run", | ||||
|     "RunOnceActivity.ShowReadmeOnStart": "true", | ||||
|     "RunOnceActivity.go.formatter.settings.were.checked": "true", | ||||
|     "RunOnceActivity.go.migrated.go.modules.settings": "true", | ||||
|     "RunOnceActivity.go.modules.automatic.dependencies.download": "true", | ||||
|     "RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "true", | ||||
|     "git-widget-placeholder": "master", | ||||
|     "go.import.settings.migrated": "true", | ||||
|     "go.sdk.automatically.set": "true", | ||||
|     "last_opened_file_path": "/Users/littlesheep/Documents/Projects/Hydrogen/Passport/pkg/internal/server/api", | ||||
|     "node.js.detected.package.eslint": "true", | ||||
|     "node.js.selected.package.eslint": "(autodetect)", | ||||
|     "nodejs_package_manager_path": "npm", | ||||
|     "run.code.analysis.last.selected.profile": "pProject Default", | ||||
|     "settings.editor.selected.configurable": "preferences.pluginManager", | ||||
|     "ts.external.directory.path": "/Users/littlesheep/Documents/Projects/Hydrogen/Passport/web/node_modules/typescript/lib", | ||||
|     "vue.rearranger.settings.migration": "true" | ||||
|   }, | ||||
|   "keyToStringList": { | ||||
|     "DatabaseDriversLRU": [ | ||||
|       "postgresql" | ||||
|   "keyToStringList": { | ||||
|     "DatabaseDriversLRU": [ | ||||
|       "postgresql" | ||||
|     ] | ||||
|   } | ||||
| }]]></component> | ||||
| }</component> | ||||
|   <component name="RecentsManager"> | ||||
|     <key name="CopyFile.RECENT_KEYS"> | ||||
|       <recent name="$PROJECT_DIR$/pkg/internal/server/api" /> | ||||
| @@ -151,7 +146,6 @@ | ||||
|     </option> | ||||
|   </component> | ||||
|   <component name="VcsManagerConfiguration"> | ||||
|     <MESSAGE value=":bug: Bug fix and fix" /> | ||||
|     <MESSAGE value=":bug: Fix APNs non-production" /> | ||||
|     <MESSAGE value=":bug: Bug fixes on notification badges for APNs" /> | ||||
|     <MESSAGE value=":bug: Fix APNs pushes no sound" /> | ||||
| @@ -176,7 +170,8 @@ | ||||
|     <MESSAGE value=":bug: Bug fixes" /> | ||||
|     <MESSAGE value=":arrow_up: Fix notification listen" /> | ||||
|     <MESSAGE value=":bug: Fix magic token's foreign key" /> | ||||
|     <option name="LAST_COMMIT_MESSAGE" value=":bug: Fix magic token's foreign key" /> | ||||
|     <MESSAGE value=":sparkles: Better avatar and banner APIs" /> | ||||
|     <option name="LAST_COMMIT_MESSAGE" value=":sparkles: Better avatar and banner APIs" /> | ||||
|   </component> | ||||
|   <component name="VgoProject"> | ||||
|     <settings-migrated>true</settings-migrated> | ||||
|   | ||||
| @@ -94,7 +94,7 @@ func getAvatar(c *fiber.Ctx) error { | ||||
| 	if content := user.GetAvatar(); content == nil { | ||||
| 		return c.SendStatus(fiber.StatusNotFound) | ||||
| 	} else { | ||||
| 		return c.Redirect(*content, fiber.StatusNotFound) | ||||
| 		return c.Redirect(*content, fiber.StatusFound) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @@ -107,6 +107,6 @@ func getBanner(c *fiber.Ctx) error { | ||||
| 	if content := user.GetBanner(); content == nil { | ||||
| 		return c.SendStatus(fiber.StatusNotFound) | ||||
| 	} else { | ||||
| 		return c.Redirect(*content, fiber.StatusNotFound) | ||||
| 		return c.Redirect(*content, fiber.StatusFound) | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|   <v-menu> | ||||
|     <template #activator="{ props }"> | ||||
|       <v-btn flat exact v-bind="props" icon> | ||||
|         <v-avatar color="transparent" icon="mdi-account-circle" :image="'/api/avatar/' + id.userinfo.data?.avatar" /> | ||||
|         <v-avatar color="transparent" icon="mdi-account-circle" image="/api/users/me/avatar" /> | ||||
|       </v-btn> | ||||
|     </template> | ||||
|  | ||||
|   | ||||
| @@ -1,14 +1,14 @@ | ||||
| <template> | ||||
|   <div> | ||||
|     <v-card> | ||||
|       <v-img cover class="bg-grey-lighten-2" :height="240" src="/api/avatar" /> | ||||
|       <v-img cover class="bg-grey-lighten-2" :height="240" src="/api/users/me/avatar" /> | ||||
|  | ||||
|       <v-card-text class="flex gap-3.5 px-5 pb-5"> | ||||
|         <v-avatar | ||||
|           color="grey-lighten-2" | ||||
|           icon="mdi-account-circle" | ||||
|           class="rounded-card" | ||||
|           image="/api/banner" | ||||
|           image="/api/users/me/banner" | ||||
|           :size="54" | ||||
|         /> | ||||
|         <div> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user