fix admin invitations api url and account settings
This commit is contained in:
1 parent
7a18db2123
commit
ed0cc75615
10 files changed
+201
-14
No files matched your search
+17
-2
@@ -17,6 +17,7 @@ import { adminNavigation, userNavigation } from './data'
|
||||
import AuthView from './views/AuthView.vue'
|
||||
import AdminConsole from './views/AdminConsole.vue'
|
||||
import UserConsole from './views/UserConsole.vue'
|
||||
import AccountSettings from './components/AccountSettings.vue'
|
||||
import type { Portal } from './types'
|
||||
import { authClient, type AuthUser } from './services/auth'
|
||||
|
||||
@@ -30,6 +31,7 @@ const authUser = ref<AuthUser>()
|
||||
const accountMenuOpen = ref(false)
|
||||
const userName = ref('')
|
||||
const availableCredit = ref<number>()
|
||||
const accountSettingsOpen = ref(false)
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
@@ -93,8 +95,13 @@ function logout() {
|
||||
|
||||
function openAccountSettings() {
|
||||
accountMenuOpen.value = false
|
||||
if (portal.value === 'admin') navigate('admin-settings')
|
||||
else notify('账号设置将在后续阶段开放')
|
||||
accountSettingsOpen.value = true
|
||||
}
|
||||
|
||||
function accountSaved(user: AuthUser) {
|
||||
authUser.value = user
|
||||
userName.value = user.displayName
|
||||
accountSettingsOpen.value = false
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -173,5 +180,13 @@ function openAccountSettings() {
|
||||
|
||||
</div>
|
||||
|
||||
<AccountSettings
|
||||
v-if="accountSettingsOpen && authUser"
|
||||
:user="authUser"
|
||||
@close="accountSettingsOpen = false"
|
||||
@saved="accountSaved"
|
||||
@notify="notify"
|
||||
/>
|
||||
|
||||
<Transition name="toast"><div v-if="toastMessage" class="toast"><ShieldCheck :size="17" /><span>{{ toastMessage }}</span><button @click="toastMessage = ''"><X :size="15" /></button></div></Transition>
|
||||
</template>
|
||||
Reference in new issue
Block a user