PicaComicNow icon indicating copy to clipboard operation
PicaComicNow copied to clipboard

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

Open ldcivan opened this issue 1 year ago • 0 comments

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

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

ldcivan avatar Feb 14 '24 06:02 ldcivan