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

建议:关于签到功能的实现 #3

Open
YujioNako opened this issue Feb 14, 2024 · 0 comments
Open

建议:关于签到功能的实现 #3

YujioNako opened this issue Feb 14, 2024 · 0 comments

Comments

@YujioNako
Copy link

因为自己fork的项目已经被改的太乱就不pr了,直接在这里提建议
关于签到功能的,我是在profile页面实现的:
这是签到按钮:

      lable(v-if="!userData.isPunched")
        button(@click='punchin') Punchin
      lable(v-else)
        button(:disabled='userData.isPunched') Punched

这是签到的函数:

function punchin(){
  axios
    .post(`${API_BASE}/users/punch-in`, {
      
    })
    .then(() => {
      return getProfile()
    })
    .catch((e) => {
      console.warn('Faild to punchin!', e)
    })
}

代码是直接手撸的,只是作参考,因为像我这种人总对签到有种莫名的执念,所以还是想实现一下(

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

No branches or pull requests

1 participant