Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
wuyu8512 committed Jan 21, 2024
1 parent 17af6fd commit 2cbdb77
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 3 additions & 9 deletions src/services/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,12 @@ export async function resetPassword(email: string, newPassword: string, code: st
})
}

export async function register(
userName: string,
email: string,
password: string,
code: string,
registerPassword: string
) {
export async function register(userName: string, email: string, password: string, code: string, inviteCode: string) {
const res = await requestWithFetch<
Types.Login.Res,
{ userName: string; email: string; code: string; password: string; registerPassword: string }
{ userName: string; email: string; code: string; password: string; inviteCode: string }
>(PATH.USER_REGISTER, {
payload: { userName, email, password, code, registerPassword }
payload: { userName, email, password, code, inviteCode }
})

sessionToken.set(res.Token)
Expand Down
6 changes: 3 additions & 3 deletions src/views/Login/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<q-btn @click="sendEmail" :loading="sending">发送验证码</q-btn>
</template>
</q-input>
<q-input v-model="registerPassword" label="注册口令(一般不填)">
<q-input v-model="inviteCode" :rules="[(val) => !!val || '无效的邀请码']" label="邀请码">
<template v-slot:prepend>
<q-icon :name="icon.mdiLockPlus" />
</template>
Expand Down Expand Up @@ -98,7 +98,7 @@ const email = ref('')
const password = ref('')
const rePassword = ref('')
const code = ref('')
const registerPassword = ref(null)
const inviteCode = ref(null)
const isPwd = ref(true)
const loading = ref(false)
const sending = ref(false)
Expand Down Expand Up @@ -151,7 +151,7 @@ const _register = async () => {
email.value,
await sha256(password.value),
code.value,
registerPassword.value
inviteCode.value
)
appStore.user = user
$q.notify({
Expand Down
6 changes: 6 additions & 0 deletions src/views/User/Profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ const profileListOptions: Array<Record<string, any>> = [
icon: icon.mdiEmail,
copiable: true
},
{
label: '邀请码',
key: 'InviteCode',
icon: icon.mdiLockPlus,
copiable: true
},
{
label: '用户组',
key: 'UserGroup',
Expand Down

0 comments on commit 2cbdb77

Please sign in to comment.