You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
629 B

var saveSelectColor = {
'Name': 'SelcetColor',
'Color': 'theme-white'
}
// 判断用户是否已有自己选择的模板风格
if (storageLoad('SelcetColor')) {
$('body').attr('class', storageLoad('SelcetColor').Color)
} else {
storageSave(saveSelectColor);
$('body').attr('class', 'theme-white')
}
// 本地缓存
function storageSave(objectData) {
localStorage.setItem(objectData.Name, JSON.stringify(objectData));
}
function storageLoad(objectName) {
if (localStorage.getItem(objectName)) {
return JSON.parse(localStorage.getItem(objectName))
} else {
return false
}
}