mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-25 15:40:49 +08:00
feat: fix some code
This commit is contained in:
@@ -112,6 +112,7 @@ public class SecurityConfig {
|
||||
.requestMatchers(HttpMethod.POST,"/api/auth/reason").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/search/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/users/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/medals/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/push/public-key").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/reaction-types").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/activities/**").permitAll()
|
||||
@@ -147,7 +148,7 @@ public class SecurityConfig {
|
||||
uri.startsWith("/api/search") || uri.startsWith("/api/users") ||
|
||||
uri.startsWith("/api/reaction-types") || uri.startsWith("/api/config") ||
|
||||
uri.startsWith("/api/activities") || uri.startsWith("/api/push/public-key") ||
|
||||
uri.startsWith("/api/sitemap.xml"));
|
||||
uri.startsWith("/api/sitemap.xml") || uri.startsWith("/api/medals"));
|
||||
|
||||
if (authHeader != null && authHeader.startsWith("Bearer ")) {
|
||||
String token = authHeader.substring(7);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue'
|
||||
import { API_BASE_URL } from '../main'
|
||||
import { API_BASE_URL, toast } from '../main'
|
||||
|
||||
const props = defineProps({
|
||||
userId: {
|
||||
@@ -41,6 +41,9 @@ const fetchMedals = async () => {
|
||||
const res = await fetch(`${API_BASE_URL}/api/medals?userId=${props.userId}`)
|
||||
if (res.ok) {
|
||||
medals.value = await res.json()
|
||||
} else {
|
||||
medals.value = []
|
||||
toast.error('获取成就失败')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user