import {
  makeAutoObservable
} from 'mobx';

// import CryptoJS from 'crypto-js';
// // const CryptoJS = require('crypto-js');
// const hash = createHash('sha256');

// hash.update(bundle[fileName].source);
// const hashValue = hash.digest('hex').substring(0, 8);


// 首页
let homeJs1 = {
  homeBg: './assets/homePage/homeBg.png',
}


// 处理图片防止缓存
const dealImg = (obj) => {

  Object.keys(obj)?.map(item => {
    if (typeof obj[item] == 'string') {
      obj[item] = `${obj[item]}?v=${__BUILD_TIME__}`
    } else if (Array.isArray(obj[item])) {
      return dealImg(obj[item])
    }
  })

  return obj
}
let homeJs = dealImg(homeJs1)
const skinStore = makeAutoObservable({
  homeJs,
})
export default skinStore;
