login.ts 735 Bytes


import { defineStore } from 'pinia'

const useLogin = defineStore(
  // 唯一ID
  'login',
  () => {
    const isCheckSms = ref(false)
    const smsValidateCode = ref('');
    const firstUnmetRequirement = ref('');
    const encodePwd = ref('')
    return {
      /**
       * 密文
       */
      encodePwd,
      /**
       * 是否直接去校验验证码
       */
      isCheckSms,
      /**
      * 网关登录验证码
     */
      smsValidateCode,
      /**
       * 注册密码未满足的第一条规则的 label
       */
      firstUnmetRequirement,
    }
  },
  {
    persist:{
      storage: sessionStorage,
      paths: ['firstUnmetRequirement','smsValidateCode','encodePwd']
    }
  }
)

export default useLogin