Skip to content

Commit

Permalink
[*] Fix reset password
Browse files Browse the repository at this point in the history
  • Loading branch information
Muska-Ami committed Dec 25, 2024
1 parent a26ed12 commit 54b130c
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/api/base.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const base = {
api_v1_url: 'https://api.locyanfrp.cn',
api_v2_url: 'https://api-v2.locyanfrp.cn/api/v2',
// api_v2_url: 'http://localhost:18080/api/v2',
// api_v2_url: 'https://api-v2.locyanfrp.cn/api/v2',
api_v2_url: 'http://localhost:18080/api/v2',
buildResponse: (res: any, useDataPath: boolean = true) => {
const message =
res.data?.message ??
Expand Down
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions src/api/v2/auth/oauth/authorized/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {

}
Empty file.
Empty file.
4 changes: 2 additions & 2 deletions src/api/v2/email/password.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import { get } from '@/utils/request'
import base from '@/api/base'

const password = async (user_id: number) => {
const password = async (user: number) => {
const rs = get(`${base.api_v2_url}/email/password`, {
user_id: user_id
user: user
})
return base.buildResponse(await rs)
}
Expand Down
8 changes: 4 additions & 4 deletions src/views/auth/ResetPasswordView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<n-grid-item span="0:6 600:4">
<n-input
type="text"
v-model:value="model.username"
v-model:value="model.user"
placeholder="用户名 / 邮箱"
@keyup.enter="sendResetMail"
/>
Expand Down Expand Up @@ -109,7 +109,7 @@ const sendResetEmail = ref(true)
const model = ref([
{
username: '',
user: '',
password: '',
confirmPassword: '',
verifyCode: ''
Expand Down Expand Up @@ -150,7 +150,7 @@ async function doResetRequest() {
let rs
try {
rs = await api.v2.user.password(
model.value.username,
model.value.user,
undefined,
model.value.password,
model.value.verifyCode
Expand All @@ -176,7 +176,7 @@ async function sendResetMail() {
ldb.start()
let rs
try {
rs = await api.v2.email.password(model.value.username)
rs = await api.v2.email.password(model.value.user)
} catch (e) {
message.error('请求失败: ' + e)
}
Expand Down

0 comments on commit 54b130c

Please sign in to comment.