Skip to content

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

@YujioNako

Description

@YujioNako

因为自己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)
    })
}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions