mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-23 14:40:49 +08:00
fix: waitlist
This commit is contained in:
@@ -26,7 +26,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
hideMenu() {
|
||||
return ['/login', '/signup', '/404'].includes(this.$route.path)
|
||||
return ['/login', '/signup', '/404', '/signup-reason'].includes(this.$route.path)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,8 +185,10 @@
|
||||
<NotificationContainer :item="item" :markRead="markRead">
|
||||
{{ item.fromUser.username }} 希望注册为会员,理由是:{{ item.content }}
|
||||
<template #actions v-if="authState.role === 'ADMIN'">
|
||||
<button class="mark-read-button-item" @click="approve(item.fromUser.id, item.id)">同意</button>
|
||||
<button class="mark-read-button-item" @click="reject(item.fromUser.id, item.id)">拒绝</button>
|
||||
<div class="optional-buttons">
|
||||
<div class="mark-approve-button-item" @click="approve(item.fromUser.id, item.id)">同意</div>
|
||||
<div class="mark-reject-button-item" @click="reject(item.fromUser.id, item.id)">拒绝</div>
|
||||
</div>
|
||||
</template>
|
||||
</NotificationContainer>
|
||||
</template>
|
||||
@@ -403,7 +405,7 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (n.type === 'POST_REVIEW_REQUEST') {
|
||||
} else if (n.type === 'POST_REVIEW_REQUEST') {
|
||||
notifications.value.push({
|
||||
...n,
|
||||
src: n.fromUser ? n.fromUser.avatar : null,
|
||||
@@ -419,7 +421,7 @@ export default {
|
||||
notifications.value.push({
|
||||
...n,
|
||||
icon: iconMap[n.type],
|
||||
iconClick: () => {}
|
||||
iconClick: () => { }
|
||||
})
|
||||
} else {
|
||||
notifications.value.push({
|
||||
@@ -605,6 +607,32 @@ export default {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.optional-buttons {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.mark-approve-button-item {
|
||||
color: green;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.mark-reject-button-item {
|
||||
color: red;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.mark-approve-button-item:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.mark-reject-button-item:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.notif-content-text:hover {
|
||||
color: var(--primary-color) !important;
|
||||
text-decoration: underline !important;
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
<template>
|
||||
<div class="reason-page">
|
||||
<div class="reason-content">
|
||||
<div class="reason-title">注册理由</div>
|
||||
<div class="reason-description">
|
||||
为了我们社区的良性发展,请填写注册理由,我们将根据你的理由审核你的注册, 谢谢!
|
||||
</div>
|
||||
<BaseInput textarea rows="4" v-model="reason" placeholder="请填写注册理由" />
|
||||
<div v-if="error" class="error-message">{{ error }}</div>
|
||||
<div class="signup-page-button-primary" @click="submit" >提交</div>
|
||||
<div v-if="!isWaitingForRegister" class="signup-page-button-primary" @click="submit">提交</div>
|
||||
<div v-else class="signup-page-button-primary disabled">提交中...</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -20,7 +25,8 @@ export default {
|
||||
return {
|
||||
reason: '',
|
||||
error: '',
|
||||
isGoogle: false
|
||||
isGoogle: false,
|
||||
isWaitingForRegister: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -42,6 +48,7 @@ export default {
|
||||
return
|
||||
}
|
||||
try {
|
||||
this.isWaitingForRegister = true
|
||||
const res = await fetch(`${API_BASE_URL}/api/auth/register`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
@@ -61,6 +68,8 @@ export default {
|
||||
}
|
||||
} catch (e) {
|
||||
toast.error('发送失败')
|
||||
} finally {
|
||||
this.isWaitingForRegister = false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,9 +77,54 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.reason-page { display: flex; justify-content: center; align-items: center; height: calc(100vh - var(--header-height)); }
|
||||
.reason-content { display: flex; flex-direction: column; gap: 20px; width: 400px; }
|
||||
.error-message { color: red; font-size: 14px; }
|
||||
.signup-page-button-primary { background-color: var(--primary-color); color: white; padding: 10px 20px; border-radius: 10px; text-align: center; cursor: pointer; }
|
||||
.signup-page-button-primary:hover { background-color: var(--primary-color-hover); }
|
||||
.reason-page {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: var(--background-color);
|
||||
height: calc(100vh - var(--header-height));
|
||||
}
|
||||
|
||||
.reason-title {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.reason-description {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.reason-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
color: red;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.signup-page-button-primary {
|
||||
background-color: var(--primary-color);
|
||||
color: white;
|
||||
padding: 10px 20px;
|
||||
border-radius: 10px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.signup-page-button-primary:hover {
|
||||
background-color: var(--primary-color-hover);
|
||||
}
|
||||
|
||||
.signup-page-button-primary.disabled {
|
||||
background-color: var(--primary-color-disabled);
|
||||
}
|
||||
|
||||
.signup-page-button-primary.disabled:hover {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -96,6 +96,7 @@ public class SecurityConfig {
|
||||
.requestMatchers(HttpMethod.GET, "/api/comments/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/categories/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/tags/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/config/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/search/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/users/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/reaction-types").permitAll()
|
||||
@@ -128,7 +129,7 @@ public class SecurityConfig {
|
||||
(uri.startsWith("/api/posts") || uri.startsWith("/api/comments") ||
|
||||
uri.startsWith("/api/categories") || uri.startsWith("/api/tags") ||
|
||||
uri.startsWith("/api/search") || uri.startsWith("/api/users") ||
|
||||
uri.startsWith("/api/reaction-types"));
|
||||
uri.startsWith("/api/reaction-types") || uri.startsWith("/api/config"));
|
||||
|
||||
if (authHeader != null && authHeader.startsWith("Bearer ")) {
|
||||
String token = authHeader.substring(7);
|
||||
|
||||
Reference in New Issue
Block a user