mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-08 11:02:48 +08:00
切换新版layui;增加表格多模板机制;增加local操作方法;增加页面记忆操作方法;删除多余代码;
This commit is contained in:
@@ -39,8 +39,27 @@ loading.hide = function (count) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
const tools = {};
|
||||
|
||||
|
||||
// 操作本地缓存,实现set和get
|
||||
tools.setLocal = function (key, value) {
|
||||
value = JSON.stringify([value]);
|
||||
return localStorage.setItem(key, value);
|
||||
|
||||
};
|
||||
|
||||
tools.getLocal = function (key, defaultValue) {
|
||||
var value = localStorage.getItem(key);
|
||||
|
||||
if (value) {
|
||||
value = JSON.parse(value)[0];
|
||||
return value;
|
||||
}
|
||||
return defaultValue;
|
||||
};
|
||||
|
||||
tools.checkMobile = function () {
|
||||
var userAgentInfo = navigator.userAgent;
|
||||
var mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
|
||||
|
||||
Reference in New Issue
Block a user