/*
 * @Author: 吴文洁
 * @Date: 2020-08-31 09:34:25
 * @LastEditors: wufan
 * @LastEditTime: 2020-12-26 14:19:23
 * @Description: 
 * @Copyright: 杭州杰竞科技有限公司 版权所有
 */

import Storage from './storage';
import { PREFIX } from '@/domains/basic-domain/constants';

class User {
  
  getStoreId(){
    return Storage.get(`${PREFIX}_storeId`)
  }

  getStoreName(){
    return Storage.get(`${PREFIX}_storeName`) 
  }

  getStoreUserId(){
    return Storage.get(`${PREFIX}_storeUserId`)
  }

  getUserId(){
    return Storage.get(`${PREFIX}_userId`)
  }
  getUserRole(){
    return Storage.get(`${PREFIX}_userRole`)
  }

  getToken() {
    return Storage.get(`${PREFIX}_token`);
  }

  setStoreId(value:any){
    return Storage.set(`${PREFIX}_storeId`,value)
  }

  setStoreName(value:any){
    return Storage.set(`${PREFIX}_storeName`,value) 
  }

  setStoreUserId(value:any){
    return Storage.set(`${PREFIX}_storeUserId`,value)
  }

  setUserId(value:any){
    return Storage.set(`${PREFIX}_userId`,value)
  }

  setUserRole(value:any){
    return Storage.set(`${PREFIX}_userRole`,value)
  }

  setToken(value:any) {
    return Storage.set(`${PREFIX}_token`,value);
  }
  removeToken(){
    return Storage.remove(`${PREFIX}_token`);
  }
  removeUserId(){
    return Storage.remove(`${PREFIX}_userId`);
  }
}

export default new User();