Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge(SuitApply):合并正装借用,修复部分 bug #96

Merged
merged 3 commits into from
Aug 11, 2024

Conversation

Tianci-King
Copy link
Member

No description provided.

Comment on lines +82 to +89
run({
iid: iid.value,
stuid: stuid.value,
password: password.value
});
};

const { run } = useRequest(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的 run 函数在定义前被使用了?

Comment on lines +82 to +89
run({
iid: iid.value,
stuid: stuid.value,
password: password.value
});
};

const { run } = useRequest(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useRequest 如果没声明 config.manual = true,应该会在组件挂载的时候发送一次请求。你这里的请求函数从名字上看是用来修改密码,那不应该自动发送请求才对。你得显式传入个 manual

如果不需要挂载的时候触发请求,不需要渲染请求的结果,不需要拿到请求的 loading 状态,那没必要用 useRequest, 直接调用 Service 下的函数就行

@xixiIBN5100
Copy link
Collaborator

因为版本推送需要暂时merge,后续会优化这段代码

@xixiIBN5100 xixiIBN5100 merged commit 8e91c0a into zjutjh:master Aug 11, 2024
1 check passed
@j10ccc
Copy link
Collaborator

j10ccc commented Aug 11, 2024

@xixiIBN5100 让现在的开发人员注意一下 useRequest 的使用,注意我说的点,另外直接调用暴露出的 run,也不设个别名,这样太不合理了

@xixiIBN5100
Copy link
Collaborator

@xixiIBN5100 让现在的开发人员注意一下 useRequest 的使用,注意我说的点,另外直接调用暴露出的 run,也不设个别名,这样太不合理了

收到,感谢指正

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants