diff --git a/data/article.json b/data/article.json
deleted file mode 100644
index 095e0a3..0000000
--- a/data/article.json
+++ /dev/null
@@ -1,115 +0,0 @@
-{
- "code": 0,
- "msg": "",
- "count": 12,
- "data": [
- {
- "id": "001",
- "title": "LV降价了!宇宙大牌最值得买的包可以下手啦!",
- "url": "http://ok-admin.xlbweb.cn/p/100",
- "readSize": 288,
- "publisher": "admin",
- "isTop": true,
- "status": true
- },
- {
- "id": "002",
- "title": "这颗彗星时速13.5万公里,有人想抓点样本带回地球",
- "url": "http://ok-admin.xlbweb.cn/p/101",
- "readSize": 188,
- "publisher": "admin",
- "isTop": false,
- "status": false
- },
- {
- "id": "003",
- "title": "LV降价了!宇宙大牌最值得买的包可以下手啦!",
- "url": "http://ok-admin.xlbweb.cn/p/100",
- "readSize": 288,
- "publisher": "admin",
- "isTop": true,
- "status": true
- },
- {
- "id": "004",
- "title": "这颗彗星时速13.5万公里,有人想抓点样本带回地球",
- "url": "http://ok-admin.xlbweb.cn/p/101",
- "readSize": 188,
- "publisher": "admin",
- "isTop": false,
- "status": false
- },
- {
- "id": "005",
- "title": "LV降价了!宇宙大牌最值得买的包可以下手啦!",
- "url": "http://ok-admin.xlbweb.cn/p/100",
- "readSize": 288,
- "publisher": "admin",
- "isTop": true,
- "status": true
- },
- {
- "id": "006",
- "title": "这颗彗星时速13.5万公里,有人想抓点样本带回地球",
- "url": "http://ok-admin.xlbweb.cn/p/101",
- "readSize": 188,
- "publisher": "admin",
- "isTop": false,
- "status": false
- },
- {
- "id": "007",
- "title": "LV降价了!宇宙大牌最值得买的包可以下手啦!",
- "url": "http://ok-admin.xlbweb.cn/p/100",
- "readSize": 288,
- "publisher": "admin",
- "isTop": true,
- "status": true
- },
- {
- "id": "008",
- "title": "这颗彗星时速13.5万公里,有人想抓点样本带回地球",
- "url": "http://ok-admin.xlbweb.cn/p/101",
- "readSize": 188,
- "publisher": "admin",
- "isTop": false,
- "status": false
- },
- {
- "id": "009",
- "title": "LV降价了!宇宙大牌最值得买的包可以下手啦!",
- "url": "http://ok-admin.xlbweb.cn/p/100",
- "readSize": 288,
- "publisher": "admin",
- "isTop": true,
- "status": true
- },
- {
- "id": "010",
- "title": "这颗彗星时速13.5万公里,有人想抓点样本带回地球",
- "url": "http://ok-admin.xlbweb.cn/p/101",
- "readSize": 188,
- "publisher": "admin",
- "isTop": false,
- "status": false
- },
- {
- "id": "011",
- "title": "LV降价了!宇宙大牌最值得买的包可以下手啦!",
- "url": "http://ok-admin.xlbweb.cn/p/100",
- "readSize": 288,
- "publisher": "admin",
- "isTop": true,
- "status": true
- },
- {
- "id": "012",
- "title": "这颗彗星时速13.5万公里,有人想抓点样本带回地球",
- "url": "http://ok-admin.xlbweb.cn/p/101",
- "readSize": 188,
- "publisher": "admin",
- "isTop": false,
- "status": false
- }
- ]
-}
diff --git a/data/log.json b/data/log.json
deleted file mode 100644
index ffb3d91..0000000
--- a/data/log.json
+++ /dev/null
@@ -1,197 +0,0 @@
-{
- "code": 0,
- "msg": "",
- "count": 12,
- "data": [
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- },
- {
- "id": "001",
- "url": "http://ok-admin.xlbweb.cn",
- "method": "GET",
- "ip": "127.0.0.1",
- "timeConsuming": 100,
- "status": true,
- "operator": "admin",
- "operatingTime": "2019-05-15 12:08:08"
- }
- ]
-}
diff --git a/data/menu.json b/data/menu.json
deleted file mode 100644
index b3c1799..0000000
--- a/data/menu.json
+++ /dev/null
@@ -1,405 +0,0 @@
-{
- "status": 1000,
- "msg": "操作成功",
- "data": [
- {
- "title": "会员管理",
- "path": "",
- "font": "iconfont",
- "icon": "",
- "spread": true,
- "children": [
- {
- "title": "用户列表",
- "path": "pages/user/user.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "角色列表",
- "path": "pages/role/role.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "权限列表",
- "path": "pages/permission/permission.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- }
- ]
- },
- {
- "title": "新闻管理",
- "path": "",
- "font": "iconfont",
- "icon": "",
- "spread": false,
- "children": [
- {
- "title": "新闻列表",
- "path": "pages/article/article.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- }
- ]
- },
- {
- "title": "留言管理",
- "path": "",
- "font": "iconfont",
- "icon": "",
- "spread": false,
- "children": [
- {
- "title": "留言列表",
- "path": "pages/message/message.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- }
- ]
- },
- {
- "title": "下载中心",
- "path": "",
- "font": "iconfont",
- "icon": "",
- "spread": false,
- "children": [
- {
- "title": "下载列表",
- "path": "pages/download/download.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- }
- ]
- },
- {
- "title": "友情链接",
- "path": "",
- "font": "iconfont",
- "icon": "",
- "spread": false,
- "children": [
- {
- "title": "链接列表",
- "path": "pages/link/link.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- }
- ]
- },
- {
- "title": "产品管理",
- "path": "",
- "font": "iconfont",
- "icon": "",
- "spread": false,
- "children": [
- {
- "title": "产品列表",
- "path": "pages/product/product.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- }
- ]
- },
- {
- "title": "图表页面",
- "path": "",
- "font": "layui-icon",
- "icon": "",
- "spread": false,
- "children": [
- {
- "title": "柱状图",
- "path": "pages/map/map1.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "折线图",
- "path": "pages/map/map2.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "折线堆叠图",
- "path": "pages/map/map3.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "饼图",
- "path": "pages/map/map4.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "环形图",
- "path": "pages/map/map5.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "散布图",
- "path": "pages/map/map6.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- }
- ]
- },
- {
- "title": "系统管理",
- "path": "",
- "font": "layui-icon",
- "icon": "",
- "spread": false,
- "children": [
- {
- "title": "网站配置",
- "path": "pages/system/system-setting.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "系统日志",
- "path": "pages/system/system-log.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "屏蔽词",
- "path": "pages/system/system-shield.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- }
- ]
- },
- {
- "title": "框架使用",
- "path": "",
- "font": "iconfont",
- "icon": "",
- "spread": false,
- "children": [
- {
- "title": "okMenu使用",
- "path": "pages/use/use-okMenu.html",
- "font": "layui-icon",
- "icon": "",
- "spread": false
- },
- {
- "title": "okTab使用",
- "path": "pages/use/use-okTab.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "okLayer使用",
- "path": "pages/use/use-okLayer.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "okUtils使用",
- "path": "pages/use/use-okUtils.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "Layui图标",
- "path": "https://www.layui.com/doc/element/icon.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "Iconfont图标",
- "path": "font/demo_index.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- }
- ]
- },
- {
- "title": "其他页面",
- "path": "",
- "font": "iconfont",
- "icon": "",
- "spread": false,
- "children": [
- {
- "title": "登陆页面",
- "path": "pages/use/use-okTab.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "403页面",
- "path": "pages/use/use-okLayer.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "404页面",
- "path": "pages/use/use-okUtils.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "500页面",
- "path": "https://www.layui.com/doc/element/icon.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- },
- {
- "title": "捐赠列表",
- "path": "font/demo_index.html",
- "font": "iconfont",
- "icon": "",
- "spread": false
- }
- ]
- },
- {
- "title": "多级菜单",
- "path": "",
- "font": "layui-icon",
- "icon": "",
- "spread": false,
- "children": [
- {
- "title": "购物网站",
- "path": "",
- "font": "layui-icon",
- "icon": "",
- "spread": false,
- "children": [
- {
- "title": "苏宁",
- "path": "https://www.suning.com",
- "font": "layui-icon",
- "icon": "",
- "spread": false
- },
- {
- "title": "京东",
- "path": "https://www.jd.com",
- "font": "layui-icon",
- "icon": "",
- "spread": false
- },
- {
- "title": "阿里",
- "path": "",
- "font": "layui-icon",
- "icon": "",
- "spread": false,
- "children": [
- {
- "title": "淘宝",
- "path": "https://www.taobao.com",
- "font": "layui-icon",
- "icon": "",
- "spread": false
- },
- {
- "title": "天猫",
- "path": "https://www.tmall.com",
- "font": "layui-icon",
- "icon": "",
- "spread": false
- },
- {
- "title": "聚划算",
- "path": "https://ju.taobao.com",
- "font": "layui-icon",
- "icon": "",
- "spread": false
- }
- ]
- }
- ]
- },
- {
- "title": "新浪微博",
- "path": "https://www.sina.com.cn",
- "font": "layui-icon",
- "icon": "",
- "spread": false
- },
- {
- "title": "搜索引擎",
- "path": "",
- "font": "layui-icon",
- "icon": "",
- "spread": false,
- "children": [
- {
- "title": "百度",
- "path": "https://www.baidu.com",
- "font": "layui-icon",
- "icon": "",
- "spread": false
- },
- {
- "title": "谷歌",
- "path": "https://www.google.com",
- "font": "layui-icon",
- "icon": "",
- "spread": false
- },
- {
- "title": "360搜索",
- "path": "https://www.so.com",
- "font": "layui-icon",
- "icon": "",
- "spread": false
- }
- ]
- },
- {
- "title": "搜狐",
- "path": "http://www.sohu.com",
- "font": "layui-icon",
- "icon": "",
- "spread": false
- },
- {
- "title": "网易",
- "path": "https://www.163.com",
- "font": "layui-icon",
- "icon": "",
- "spread": false
- }
- ]
- }
- ]
-}
diff --git a/data/role.json b/data/role.json
deleted file mode 100644
index 5bec8bf..0000000
--- a/data/role.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "code": 0,
- "msg": "",
- "count": 3,
- "data": [
- {
- "id": "001",
- "name": "ADMIN",
- "remarks": "管理员",
- "createUser": "admin",
- "createTime": "2018-05-06 18:15:28"
- },
- {
- "id": "002",
- "name": "TEACHER",
- "remarks": "教师",
- "createUser": "admin",
- "createTime": "2018-05-06 19:15:28"
- },
- {
- "id": "003",
- "name": "STUDENT",
- "remarks": "学生",
- "createUser": "admin",
- "createTime": "2018-05-06 20:15:28"
- }
- ]
-}
diff --git a/data/user/add.json b/data/user/add.json
deleted file mode 100644
index 8293b8e..0000000
--- a/data/user/add.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "status": 1000,
- "msg": "操作成功",
- "data": {}
-}
diff --git a/data/user/batchDel.json b/data/user/batchDel.json
deleted file mode 100644
index 8293b8e..0000000
--- a/data/user/batchDel.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "status": 1000,
- "msg": "操作成功",
- "data": {}
-}
diff --git a/data/user/batchNormal.json b/data/user/batchNormal.json
deleted file mode 100644
index 8293b8e..0000000
--- a/data/user/batchNormal.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "status": 1000,
- "msg": "操作成功",
- "data": {}
-}
diff --git a/data/user/batchStop.json b/data/user/batchStop.json
deleted file mode 100644
index 8293b8e..0000000
--- a/data/user/batchStop.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "status": 1000,
- "msg": "操作成功",
- "data": {}
-}
diff --git a/data/user/edit.json b/data/user/edit.json
deleted file mode 100644
index 8293b8e..0000000
--- a/data/user/edit.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "status": 1000,
- "msg": "操作成功",
- "data": {}
-}
diff --git a/data/user/login.json b/data/user/login.json
deleted file mode 100644
index be609ca..0000000
--- a/data/user/login.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "status": 1000,
- "msg": "操作成功",
- "data": {
- "username": "bobi",
- "email": "bobi1234@foxmail.com"
- }
-}
diff --git a/data/user/user.json b/data/user/user.json
deleted file mode 100644
index 8c8ffef..0000000
--- a/data/user/user.json
+++ /dev/null
@@ -1,139 +0,0 @@
-{
- "code": 0,
- "msg": "操作成功",
- "count": 11,
- "data": [
- {
- "id": "001",
- "username": "zhangsan",
- "reallyName": "张三",
- "password": "111111",
- "status": 0,
- "role": 0,
- "email": "zhangsan@qq.com",
- "phone": "13222222222",
- "createTime": "2018-05-06 18:15:28",
- "logins": 24
- },
- {
- "id": "002",
- "username": "lisi",
- "reallyName": "李四",
- "password": "111111",
- "status": 0,
- "role": 0,
- "email": "lisi@qq.com",
- "phone": "13222222222",
- "createTime": "2018-05-06 18:15:28",
- "logins": 24
- },
- {
- "id": "003",
- "username": "wangwu",
- "reallyName": "王五",
- "password": "111111",
- "status": 1,
- "role": 1,
- "email": "wangwu@qq.com",
- "phone": "13222222222",
- "createTime": "2018-05-06 18:15:28",
- "logins": 24
- },
- {
- "id": "004",
- "username": "zhaoliu",
- "reallyName": "赵六",
- "password": "111111",
- "status": 1,
- "role": 1,
- "email": "zhaoliu@qq.com",
- "phone": "13222222222",
- "createTime": "2018-05-06 18:15:28",
- "logins": 24
- },
- {
- "id": "005",
- "username": "sunqi",
- "reallyName": "孙七",
- "password": "111111",
- "status": 1,
- "role": 1,
- "email": "sunqi@qq.com",
- "phone": "13222222222",
- "createTime": "2018-05-06 18:15:28",
- "logins": 24
- },
- {
- "id": "006",
- "username": "zhouba",
- "reallyName": "周八",
- "password": "111111",
- "status": 1,
- "role": 1,
- "email": "zhouba@qq.com",
- "phone": "13222222222",
- "createTime": "2018-05-06 18:15:28",
- "logins": 24
- },
- {
- "id": "007",
- "username": "wujiu",
- "reallyName": "吴九",
- "password": "111111",
- "status": 1,
- "role": 1,
- "email": "wujiu@qq.com",
- "phone": "13222222222",
- "createTime": "2018-05-06 18:15:28",
- "logins": 24
- },
- {
- "id": "008",
- "username": "zhengshi",
- "reallyName": "郑十",
- "password": "111111",
- "status": 1,
- "role": 1,
- "email": "zhengshi@qq.com",
- "phone": "13222222222",
- "createTime": "2018-05-06 18:15:28",
- "logins": 24
- },
- {
- "id": "009",
- "username": "liubei",
- "reallyName": "刘备",
- "password": "111111",
- "status": 1,
- "role": 1,
- "email": "liubei@qq.com",
- "phone": "13222222222",
- "createTime": "2018-05-06 18:15:28",
- "logins": 24
- },
- {
- "id": "010",
- "username": "zhangfei",
- "reallyName": "张飞",
- "password": "111111",
- "status": 1,
- "role": 1,
- "email": "zhangfei@qq.com",
- "phone": "13222222222",
- "createTime": "2018-05-06 18:15:28",
- "logins": 24
- },
- {
- "id": "011",
- "username": "guanyu",
- "reallyName": "关羽",
- "password": "111111",
- "status": 1,
- "role": 1,
- "email": "guanyu@qq.com",
- "phone": "13222222222",
- "createTime": "2018-05-06 18:15:28",
- "logins": 24
- }
- ]
-}
diff --git a/js/okadmin.js b/js/okadmin.js
index 82fc1ac..90b20c0 100644
--- a/js/okadmin.js
+++ b/js/okadmin.js
@@ -1,8 +1,9 @@
-layui.use(["element", "layer", "okTab", "okMenu"], function () {
+layui.use(["element", "layer", "okTab", "okMenu", "okUtils"], function () {
var element = layui.element;
var layer = layui.layer;
var okTab = layui.okTab;
var okMenu = layui.okMenu;
+ var okUtils = layui.okUtils;
var $ = layui.jquery;
/**
@@ -32,7 +33,7 @@ layui.use(["element", "layer", "okTab", "okMenu"], function () {
/**
* 生成左侧菜单树
*/
- okMenu.generatorMenu("data/menu.json", "get");
+ okMenu.generatorMenu(okUtils.mockApi.menu.list, "get");
/**
* 监听导航菜单的点击
diff --git a/lib/layui/lay/okmodules/okUtils.js b/lib/layui/lay/okmodules/okUtils.js
index fe31d21..848e32d 100644
--- a/lib/layui/lay/okmodules/okUtils.js
+++ b/lib/layui/lay/okmodules/okUtils.js
@@ -138,6 +138,29 @@ layui.define("layer", function (exports) {
return false;
}
},
+ },
+ mockApi: {
+ login: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/login",
+ menu: {
+ list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/menu/list"
+ },
+ user: {
+ list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/list",
+ batchNormal: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/batchNormal",
+ batchStop: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/batchStop",
+ batchDel: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/batchDel",
+ add: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/add",
+ edit: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/user/edit"
+ },
+ role: {
+ list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/role/list"
+ },
+ article: {
+ list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/article/list"
+ },
+ log: {
+ list: "https://easy-mock.com/mock/5d0ce725424f15399a6c2068/okadmin/log/list"
+ }
}
}
diff --git a/pages/article/article.html b/pages/article/article.html
index 426a838..27a44cd 100644
--- a/pages/article/article.html
+++ b/pages/article/article.html
@@ -49,7 +49,7 @@
var articleTable = table.render({
elem: "#tableId",
- url: "../../data/article.json",
+ url: okUtils.mockApi.article.list,
limit: 10,
page: true,
even: true,
diff --git a/pages/role/role.html b/pages/role/role.html
index 23bf7d3..a9cb783 100644
--- a/pages/role/role.html
+++ b/pages/role/role.html
@@ -48,7 +48,7 @@
var roleTable = table.render({
elem: "#tableId",
- url: "../../data/role.json",
+ url: okUtils.mockApi.role.list,
limit: 10,
page: true,
toolbar: "#toolbarTpl",
diff --git a/pages/system/system-log.html b/pages/system/system-log.html
index a4038ab..92d593c 100644
--- a/pages/system/system-log.html
+++ b/pages/system/system-log.html
@@ -48,7 +48,7 @@
var logTable = table.render({
elem: "#tableId",
- url: "../../data/log.json",
+ url: okUtils.mockApi.log.list,
limit: 10,
page: true,
toolbar: true,
@@ -112,7 +112,7 @@
}
});
}
-
+
function detail (id) {
okLayer.open("日志详情", "system-log-detail.html?id=" + id, "90%", "90%")
}
diff --git a/pages/user/login.html b/pages/user/login.html
index f7e1411..1a8ed30 100644
--- a/pages/user/login.html
+++ b/pages/user/login.html
@@ -51,7 +51,7 @@
// 登陆逻辑
form.on('submit(login)', function (data) {
- okUtils.ajax("../../data/user/login.json", "get", data.field).done(function (response) {
+ okUtils.ajax(okUtils.mockApi.login, "post", data.field).done(function (response) {
console.log(response)
okLayer.msg.greenTick("登陆成功", function () {
window.location = "../../index.html";
diff --git a/pages/user/user-add.html b/pages/user/user-add.html
index f172f7e..8b1fcd4 100644
--- a/pages/user/user-add.html
+++ b/pages/user/user-add.html
@@ -118,7 +118,7 @@
});
form.on("submit(add)", function (data) {
- okUtils.ajax("../../data/user/add.json", "get", data.field).done(function (response) {
+ okUtils.ajax(okUtils.mockApi.user.add, "post", data.field).done(function (response) {
console.log(response)
okLayer.msg.greenTick("添加成功", function () {
parent.layer.close(parent.layer.getFrameIndex(window.name));
diff --git a/pages/user/user-edit.html b/pages/user/user-edit.html
index c9cdd58..006dbf8 100644
--- a/pages/user/user-edit.html
+++ b/pages/user/user-edit.html
@@ -105,21 +105,21 @@