achao 2 years ago
parent
commit
d7032faa7d

+ 68 - 57
unimall-admin/src/api/gubi/transaction.js

@@ -2,82 +2,93 @@ import request from '@/utils/request'
 
 // 查询交易记录列表
 export function listTransaction(query) {
-  return request({
-    method: 'get',
-    params: {
-      _gp: 'admin.gubi.gubiTransaction',
-      _mt: 'list',
-      ...query
-    }
-  })
+    return request({
+        method: 'get',
+        params: {
+            _gp: 'admin.gubi.gubiTransaction',
+            _mt: 'list',
+            ...query
+        }
+    })
 }
+export function loginRecord(query) {
+    return request({
+        method: 'get',
+        params: {
+            _gp: 'admin.log.logininfor',
+            _mt: 'list',
+            ...query
+        }
+    })
+}
+
 export function typeList(query) {
-  return request({
-    method: 'get',
-    params: {
-      _gp: 'admin.gubi.gubiTypeInfo',
-      _mt: 'listInfo',
-      ...query
-    }
-  })
+    return request({
+        method: 'get',
+        params: {
+            _gp: 'admin.gubi.gubiTypeInfo',
+            _mt: 'listInfo',
+            ...query
+        }
+    })
 }
 
 // 查询交易记录详细
 export function getTransaction(id) {
-  return request({
-    method: 'get',
-    params: {
-      _gp: 'admin.gubi.gubiTransaction',
-      _mt: 'get',
-      id: id
-    }
-  })
+    return request({
+        method: 'get',
+        params: {
+            _gp: 'admin.gubi.gubiTransaction',
+            _mt: 'get',
+            id: id
+        }
+    })
 }
 
 // 新增交易记录
 export function addTransaction(data) {
-  return request({
-    method: 'post',
-    params: {
-      _gp: 'admin.gubi.gubiTransaction',
-      _mt: 'add',
-      gubiTransaction: data
-    }
-  })
+    return request({
+        method: 'post',
+        params: {
+            _gp: 'admin.gubi.gubiTransaction',
+            _mt: 'add',
+            gubiTransaction: data
+        }
+    })
 }
 
 // 修改交易记录
 export function updateTransaction(data) {
-  return request({
-    method: 'post',
-    params: {
-      _gp: 'admin.gubi.gubiTransaction',
-      _mt: 'update',
-      gubiTransaction: data
-    }
-  })
+    return request({
+        method: 'post',
+        params: {
+            _gp: 'admin.gubi.gubiTransaction',
+            _mt: 'update',
+            gubiTransaction: data
+        }
+    })
 }
 
 // 删除交易记录
 export function delTransaction(id) {
-  return request({
-    method: 'post',
-    params: {
-      _gp: 'admin.gubi.gubiTransaction',
-      _mt: 'delete',
-      id: id
-    }
-  })
+    return request({
+        method: 'post',
+        params: {
+            _gp: 'admin.gubi.gubiTransaction',
+            _mt: 'delete',
+            id: id
+        }
+    })
 }
 
 // 导出交易记录
 export function exportTransaction(query) {
-  return request({
-    method: 'get',
-    params: {
-      _gp: 'admin.gubi.gubiTransaction',
-      _mt: 'export',
-      ...query
-    }
-  })
-}
+    return request({
+        method: 'get',
+        params: {
+            _gp: 'admin.gubi.gubiTransaction',
+            _mt: 'export',
+            ...query
+        }
+    })
+}

+ 219 - 112
unimall-admin/src/router/index.js

@@ -25,124 +25,231 @@ import Layout from '@/views/layout/Layout'
     noCache: true                if true ,the page will no be cached(default is false)
   }
 **/
-export const constantRouterMap = [
-  {
-    path: '/redirect',
-    component: Layout,
-    hidden: true,
-    children: [
-      {
-        path: '/redirect/:path*',
-        component: () => import('@/views/redirect/index')
-      }
-    ]
-  },
-  {
-    path: '/login',
-    component: () => import('@/views/login/index'),
-    hidden: true
-  },
-  {
-    path: '/auth-redirect',
-    component: () => import('@/views/login/authredirect'),
-    hidden: true
-  },
-  {
-    path: '/404',
-    component: () => import('@/views/errorPage/404'),
-    hidden: true
-  },
-  {
-    path: '/401',
-    component: () => import('@/views/errorPage/401'),
-    hidden: true
-  },
-  {
-    path: '',
-    component: Layout,
-    redirect: 'dashboard',
-    children: [
-      {
-        path: 'dashboard',
-        component: () => import('@/views/dashboard/index'),
-        name: 'Dashboard',
-        meta: { title: 'dashboard', icon: 'dashboard', noCache: true }
-      }
-    ]
-  },
-  {
-    path: '/info',
-    component: Layout,
-    redirect: 'info',
-    children: [
-      {
-        path: 'info',
-        component: () => import('@/views/gubi/info'),
-        name: 'Dashboard',
-        meta: { title: '分类管理', icon: 'dashboard', noCache: true }
-      }
-    ]
-  },
-  {
-    path: '/three',
-    component: Layout,
-    redirect: 'three',
-    children: [
-      {
-        path: 'three',
-        component: () => import('@/views/gubi/three/index1'),
-        name: 'three',
-        meta: { title: '币种信息', icon: 'dashboard', noCache: true }
-      }
-    ]
-  },
-  {
-    path: '/priceHis',
-    component: Layout,
-    redirect: 'priceHis',
-    children: [
-      {
-        path: 'priceHis',
-        component: () => import('@/views/gubi/priceHis'),
-        name: 'priceHis',
-        meta: { title: '历史价格', icon: 'dashboard', noCache: true }
-      }
-    ]
-  },
-  {
-    path: '/transaction',
-    component: Layout,
-    redirect: 'transaction',
-    children: [
-      {
-        path: 'transaction',
-        component: () => import('@/views/gubi/transaction'),
-        name: 'transaction',
-        meta: { title: '交易记录', icon: 'dashboard', noCache: true }
-      }
-    ]
-  }
+
+console.log('user', localStorage.getItem('user'))
+export const constantRouterMap = [{
+        path: '/redirect',
+        component: Layout,
+        hidden: true,
+        children: [{
+            path: '/redirect/:path*',
+            component: () =>
+                import ('@/views/redirect/index')
+        }]
+    },
+    {
+        path: '/login',
+        component: () =>
+            import ('@/views/login/index'),
+        hidden: true
+    },
+    {
+        path: '/auth-redirect',
+        component: () =>
+            import ('@/views/login/authredirect'),
+        hidden: true
+    },
+    {
+        path: '/404',
+        component: () =>
+            import ('@/views/errorPage/404'),
+        hidden: true
+    },
+    {
+        path: '/401',
+        component: () =>
+            import ('@/views/errorPage/401'),
+        hidden: true
+    },
+    {
+        path: '',
+        component: Layout,
+        redirect: 'dashboard',
+        children: [{
+            path: 'dashboard',
+            component: () =>
+                import ('@/views/dashboard/index'),
+            name: 'Dashboard',
+            meta: { title: 'dashboard', icon: 'dashboard', noCache: true }
+        }]
+    },
+    {
+        path: '/info',
+        component: Layout,
+        redirect: 'info',
+        children: [{
+            path: 'info',
+            component: () =>
+                import ('@/views/gubi/info'),
+            name: 'Dashboard',
+            meta: { title: '分类管理', icon: 'dashboard', noCache: true }
+        }],
+        hidden: localStorage.getItem('user') == 'xiaomei' ? true : false
+    },
+    {
+        path: '/three',
+        component: Layout,
+        redirect: 'three',
+        children: [{
+            path: 'three',
+            component: () =>
+                import ('@/views/gubi/three/index1'),
+            name: 'three',
+            meta: { title: '币种信息', icon: 'dashboard', noCache: true }
+        }],
+        hidden: localStorage.getItem('user') == 'xiaomei' ? true : false
+    },
+    {
+        path: '/priceHis',
+        component: Layout,
+        redirect: 'priceHis',
+        children: [{
+            path: 'priceHis',
+            component: () =>
+                import ('@/views/gubi/priceHis'),
+            name: 'priceHis',
+            meta: { title: '历史价格', icon: 'dashboard', noCache: true }
+        }],
+        hidden: localStorage.getItem('user') == 'xiaomei' ? true : false
+    },
+    {
+        path: '/transaction',
+        component: Layout,
+        redirect: 'transaction',
+        children: [{
+            path: 'transaction',
+            component: () =>
+                import ('@/views/gubi/transaction'),
+            name: 'transaction',
+            meta: { title: '交易记录', icon: 'dashboard', noCache: true }
+        }]
+    },
+    {
+        path: '/loginRecord',
+        component: Layout,
+        redirect: 'loginRecord',
+        children: [{
+            path: 'loginRecord',
+            component: () =>
+                import ('@/views/gubi/loginRecord'),
+            name: 'loginRecord',
+            meta: { title: '登录记录', icon: 'dashboard', noCache: true }
+        }],
+        hidden: localStorage.getItem('user') == 'xiaomei' ? true : false
+    }
 ]
 
 export default new Router({
-  mode: 'history',
-  scrollBehavior: () => ({ y: 0 }),
-  routes: constantRouterMap
+    mode: 'history',
+    scrollBehavior: () => ({ y: 0 }),
+    routes: constantRouterMap
 })
 
 const parseJson = () => {
-  const mapArray = routeJson
-  for (let i = 0; i < mapArray.length; i++) {
-    const item = mapArray[i]
-    item.component = Layout
-    if (item.children && item.children.length > 0) {
-      for (let j = 0; j < item.children.length; j++) {
-        const childrenItem = item.children[j]
-        childrenItem.component = () => import(`@/views${childrenItem.page}`)
-      }
+    const mapArray = [{
+            'redirect': 'noredirect',
+            'path': '/sys',
+            'children': [{
+                'path': 'admin',
+                'meta': {
+                    'noCache': true,
+                    'icon': 'admin',
+                    'perms': [
+                        'admin:admin:list',
+                        'admin:admin:create',
+                        'admin:admin:update',
+                        'admin:admin:delete'
+                    ],
+                    'title': '会员'
+                },
+                'name': 'admin',
+                'page': '/sys/admin'
+            }, {
+                'path': 'role',
+                'meta': {
+                    'noCache': true,
+                    'icon': 'role',
+                    'perms': [
+                        'admin:role:list',
+                        'admin:role:create',
+                        'admin:role:delete',
+                        'admin:role:update',
+                        'admin:role:permissionList',
+                        'admin:permission:list'
+                    ],
+                    'title': '角色管理'
+                },
+                'name': 'role',
+                'page': '/sys/role'
+            }],
+            'meta': {
+                'icon': 'sys',
+                'title': '会员管理'
+            },
+            'name': 'sysManage',
+            'alwaysShow': true,
+            hidden: localStorage.getItem('user') == 'xiaomei' ? true : false
+        },
+        {
+            'redirect': 'noredirect',
+            'name': 'sysLog',
+            'path': '/log',
+            'meta': {
+                'icon': 'log',
+                'title': '日志管理'
+            },
+            'alwaysShow': true,
+            'children': [{
+                'path': 'logininfor',
+                'name': 'logininfor',
+                'page': '/log/logininfor',
+                'meta': {
+                    'title': '登陆日志',
+                    'icon': 'logininfor',
+                    'noCache': true,
+                    'perms': [
+                        'log:logininfor:list',
+                        'log:logininfor:create',
+                        'log:logininfor:delete',
+                        'log:logininfor:update'
+                    ]
+                }
+            }],
+            hidden: localStorage.getItem('user') == 'xiaomei' ? true : false
+        },
+        {
+            'redirect': 'noredirect',
+            'path': '/profile',
+            'hidden': true,
+            'children': [{
+                'path': 'password',
+                'meta': {
+                    'noCache': true,
+                    'title': '修改密码'
+                },
+                'name': 'password',
+                'page': '/profile/password'
+            }],
+            'alwaysShow': true
+        },
+        {
+            'redirect': '/404',
+            'path': '*',
+            'hidden': true
+        }
+    ]
+    for (let i = 0; i < mapArray.length; i++) {
+        const item = mapArray[i]
+        item.component = Layout
+        if (item.children && item.children.length > 0) {
+            for (let j = 0; j < item.children.length; j++) {
+                const childrenItem = item.children[j]
+                childrenItem.component = () =>
+                    import (`@/views${childrenItem.page}`)
+            }
+        }
     }
-  }
-  return mapArray
+    return mapArray
 }
 
-export const asyncRouterMap = parseJson()
+export const asyncRouterMap = parseJson()

+ 111 - 96
unimall-admin/src/router/route.json

@@ -1,98 +1,113 @@
 [
-	
-	{
-		"redirect": "noredirect",
-		"path": "/sys",
-		"children": [
-			{
-				"path": "admin",
-				"meta": {
-					"noCache": true,
-					"icon": "admin",
-					"perms": [
-						"admin:admin:list",
-						"admin:admin:create",
-						"admin:admin:update",
-						"admin:admin:delete"
-					],
-					"title": "会员"
-				},
-				"name": "admin",
-				"page": "/sys/admin"
-			},{
-				"path": "role",
-				"meta": {
-					"noCache": true,
-					"icon": "role",
-					"perms": [
-						"admin:role:list",
-						"admin:role:create",
-						"admin:role:delete",
-						"admin:role:update",
-						"admin:role:permissionList",
-						"admin:permission:list"
-					],
-					"title": "角色管理"
-				},
-				"name": "role",
-				"page": "/sys/role"
-			}
-		],
-		"meta": {
-			"icon": "sys",
-			"title": "会员管理"
-		},
-		"name": "sysManage",
-		"alwaysShow": true
-	},
-	{
-		"redirect": "noredirect",
-		"name": "sysLog",
-		"path": "/log",
-		"meta": {
-			"icon": "log",
-			"title": "日志管理"
-		},
-		"alwaysShow": true,
-		"children": [
-			{
-				"path": "logininfor",
-				"name": "logininfor",
-				"page": "/log/logininfor",
-				"meta": {
-					"title": "登陆日志",
-					"icon": "logininfor",
-					"noCache": true,
-					"perms": [
-						"log:logininfor:list",
-						"log:logininfor:create",
-						"log:logininfor:delete",
-						"log:logininfor:update"
-					]
-				}
-			}
-		]
-	},
-	{
-		"redirect": "noredirect",
-		"path": "/profile",
-		"hidden": true,
-		"children": [
-			{
-				"path": "password",
-				"meta": {
-					"noCache": true,
-					"title": "修改密码"
-				},
-				"name": "password",
-				"page": "/profile/password"
-			}
-		],
-		"alwaysShow": true
-	},
-	{
-		"redirect": "/404",
-		"path": "*",
-		"hidden": true
-	}
+
+    {
+        "redirect": "noredirect",
+        "path": "/tools",
+        "children": [{
+            "path": "generator",
+            "meta": {
+                "noCache": true,
+                "perms": [
+                    ""
+                ],
+                "title": "代码生成器"
+            },
+            "name": "tools",
+            "page": "/tools/gen"
+        }],
+        "meta": {
+            "icon": "tools",
+            "title": "实用工具"
+        },
+        "name": "toolsManage",
+        "alwaysShow": true
+    }, {
+        "redirect": "noredirect",
+        "path": "/sys",
+        "children": [{
+            "path": "admin",
+            "meta": {
+                "noCache": true,
+                "icon": "admin",
+                "perms": [
+                    "admin:admin:list",
+                    "admin:admin:create",
+                    "admin:admin:update",
+                    "admin:admin:delete"
+                ],
+                "title": "会员"
+            },
+            "name": "admin",
+            "page": "/sys/admin"
+        }, {
+            "path": "role",
+            "meta": {
+                "noCache": true,
+                "icon": "role",
+                "perms": [
+                    "admin:role:list",
+                    "admin:role:create",
+                    "admin:role:delete",
+                    "admin:role:update",
+                    "admin:role:permissionList",
+                    "admin:permission:list"
+                ],
+                "title": "角色管理"
+            },
+            "name": "role",
+            "page": "/sys/role"
+        }],
+        "meta": {
+            "icon": "sys",
+            "title": "会员管理"
+        },
+        "name": "sysManage",
+        "alwaysShow": true
+    },
+    {
+        "redirect": "noredirect",
+        "name": "sysLog",
+        "path": "/log",
+        "meta": {
+            "icon": "log",
+            "title": "日志管理"
+        },
+        "alwaysShow": true,
+        "children": [{
+            "path": "logininfor",
+            "name": "logininfor",
+            "page": "/log/logininfor",
+            "meta": {
+                "title": "登陆日志",
+                "icon": "logininfor",
+                "noCache": true,
+                "perms": [
+                    "log:logininfor:list",
+                    "log:logininfor:create",
+                    "log:logininfor:delete",
+                    "log:logininfor:update"
+                ]
+            }
+        }]
+    },
+    {
+        "redirect": "noredirect",
+        "path": "/profile",
+        "hidden": true,
+        "children": [{
+            "path": "password",
+            "meta": {
+                "noCache": true,
+                "title": "修改密码"
+            },
+            "name": "password",
+            "page": "/profile/password"
+        }],
+        "alwaysShow": true
+    },
+    {
+        "redirect": "/404",
+        "path": "*",
+        "hidden": true
+    }
 ]

+ 132 - 130
unimall-admin/src/store/modules/user.js

@@ -2,146 +2,148 @@ import { loginByUsername, logout, getUserInfo } from '@/api/login'
 import { getToken, setToken, removeToken } from '@/utils/auth'
 
 const user = {
-  state: {
-    user: '',
-    status: '',
-    code: '',
-    token: getToken(),
-    name: '',
-    avatar: '',
-    introduction: '',
-    roles: [],
-    perms: [],
-    setting: {
-      articlePlatform: []
-    }
-  },
-
-  mutations: {
-    SET_CODE: (state, code) => {
-      state.code = code
-    },
-    SET_TOKEN: (state, token) => {
-      state.token = token
-    },
-    SET_INTRODUCTION: (state, introduction) => {
-      state.introduction = introduction
-    },
-    SET_SETTING: (state, setting) => {
-      state.setting = setting
-    },
-    SET_STATUS: (state, status) => {
-      state.status = status
-    },
-    SET_NAME: (state, name) => {
-      state.name = name
+    state: {
+        user: '',
+        status: '',
+        code: '',
+        token: getToken(),
+        name: '',
+        avatar: '',
+        introduction: '',
+        roles: [],
+        perms: [],
+        setting: {
+            articlePlatform: []
+        }
     },
-    SET_AVATAR: (state, avatar) => {
-      state.avatar = avatar
-    },
-    SET_ROLES: (state, roles) => {
-      state.roles = roles
-    },
-    SET_PERMS: (state, perms) => {
-      state.perms = perms
-    }
-  },
 
-  actions: {
-    // 用户名登录
-    LoginByUsername({ commit }, userInfo) {
-      const username = userInfo.username.trim()
-      return new Promise((resolve, reject) => {
-        loginByUsername(username, userInfo.password, userInfo.verifyCode).then(response => {
-          const token = response.data.data
-          commit('SET_TOKEN', token)
-          setToken(token)
-          resolve()
-        }).catch(error => {
-          reject(error)
-        })
-      })
+    mutations: {
+        SET_CODE: (state, code) => {
+            state.code = code
+        },
+        SET_TOKEN: (state, token) => {
+            state.token = token
+        },
+        SET_INTRODUCTION: (state, introduction) => {
+            state.introduction = introduction
+        },
+        SET_SETTING: (state, setting) => {
+            state.setting = setting
+        },
+        SET_STATUS: (state, status) => {
+            state.status = status
+        },
+        SET_NAME: (state, name) => {
+            state.name = name
+        },
+        SET_AVATAR: (state, avatar) => {
+            state.avatar = avatar
+        },
+        SET_ROLES: (state, roles) => {
+            state.roles = roles
+        },
+        SET_PERMS: (state, perms) => {
+            state.perms = perms
+        }
     },
 
-    // 获取用户信息
-    GetUserInfo({ commit, state }) {
-      return new Promise((resolve, reject) => {
-        getUserInfo(state.token).then(response => {
-          const data = response.data.data
+    actions: {
+        // 用户名登录
+        LoginByUsername({ commit }, userInfo) {
+            const username = userInfo.username.trim()
+            return new Promise((resolve, reject) => {
+                loginByUsername(username, userInfo.password, userInfo.verifyCode).then(response => {
+                    const token = response.data.data
+                    commit('SET_TOKEN', token)
+                    setToken(token)
+                    resolve()
+                }).catch(error => {
+                    reject(error)
+                })
+            })
+        },
 
-          if (data.perms && data.perms.length > 0) { // 验证返回的perms是否是一个非空数组
-            commit('SET_PERMS', data.perms)
-          } else {
-            reject('getInfo: perms must be a non-null array !')
-          }
+        // 获取用户信息
+        GetUserInfo({ commit, state }) {
+            return new Promise((resolve, reject) => {
+                getUserInfo(state.token).then(response => {
+                    debugger
+                    const data = response.data.data
 
-          commit('SET_ROLES', data.roles)
-          commit('SET_NAME', data.name)
-          commit('SET_AVATAR', data.avatar)
-          commit('SET_INTRODUCTION', data.introduction)
-          resolve(response)
-        }).catch(error => {
-          reject(error)
-        })
-      })
-    },
+                    if (data.perms && data.perms.length > 0) { // 验证返回的perms是否是一个非空数组
+                        commit('SET_PERMS', data.perms)
+                    } else {
+                        reject('getInfo: perms must be a non-null array !')
+                    }
+                    localStorage.setItem('user', data.username)
+                    commit('SET_ROLES', data.roles)
+                    commit('SET_NAME', data.name)
+                    commit('SET_AVATAR', data.avatar)
+                    commit('SET_INTRODUCTION', data.introduction)
+                    resolve(response)
+                }).catch(error => {
+                    reject(error)
+                })
+            })
+        },
 
-    // 第三方验证登录
-    // LoginByThirdparty({ commit, state }, code) {
-    //   return new Promise((resolve, reject) => {
-    //     commit('SET_CODE', code)
-    //     loginByThirdparty(state.status, state.email, state.code).then(response => {
-    //       commit('SET_TOKEN', response.data.token)
-    //       setToken(response.data.token)
-    //       resolve()
-    //     }).catch(error => {
-    //       reject(error)
-    //     })
-    //   })
-    // },
+        // 第三方验证登录
+        // LoginByThirdparty({ commit, state }, code) {
+        //   return new Promise((resolve, reject) => {
+        //     commit('SET_CODE', code)
+        //     loginByThirdparty(state.status, state.email, state.code).then(response => {
+        //       commit('SET_TOKEN', response.data.token)
+        //       setToken(response.data.token)
+        //       resolve()
+        //     }).catch(error => {
+        //       reject(error)
+        //     })
+        //   })
+        // },
 
-    // 登出
-    LogOut({ commit, state }) {
-      return new Promise((resolve, reject) => {
-        logout(state.token).then(() => {
-          commit('SET_TOKEN', '')
-          commit('SET_ROLES', [])
-          commit('SET_PERMS', [])
-          removeToken()
-          resolve()
-        }).catch(error => {
-          reject(error)
-        })
-      })
-    },
+        // 登出
+        LogOut({ commit, state }) {
+            return new Promise((resolve, reject) => {
+                logout(state.token).then(() => {
+                    commit('SET_TOKEN', '')
+                    commit('SET_ROLES', [])
+                    commit('SET_PERMS', [])
+                    removeToken()
+                    localStorage.clear()
+                    resolve()
+                }).catch(error => {
+                    reject(error)
+                })
+            })
+        },
 
-    // 前端 登出
-    FedLogOut({ commit }) {
-      return new Promise(resolve => {
-        commit('SET_TOKEN', '')
-        removeToken()
-        resolve()
-      })
-    },
+        // 前端 登出
+        FedLogOut({ commit }) {
+            return new Promise(resolve => {
+                commit('SET_TOKEN', '')
+                removeToken()
+                resolve()
+            })
+        },
 
-    // 动态修改权限
-    ChangeRoles({ commit, dispatch }, role) {
-      return new Promise(resolve => {
-        commit('SET_TOKEN', role)
-        setToken(role)
-        getUserInfo(role).then(response => {
-          const data = response.data
-          commit('SET_ROLES', data.roles)
-          commit('SET_PERMS', data.perms)
-          commit('SET_NAME', data.name)
-          commit('SET_AVATAR', data.avatar)
-          commit('SET_INTRODUCTION', data.introduction)
-          dispatch('GenerateRoutes', data) // 动态修改权限后 重绘侧边菜单
-          resolve()
-        })
-      })
+        // 动态修改权限
+        ChangeRoles({ commit, dispatch }, role) {
+            return new Promise(resolve => {
+                commit('SET_TOKEN', role)
+                setToken(role)
+                getUserInfo(role).then(response => {
+                    const data = response.data
+                    commit('SET_ROLES', data.roles)
+                    commit('SET_PERMS', data.perms)
+                    commit('SET_NAME', data.name)
+                    commit('SET_AVATAR', data.avatar)
+                    commit('SET_INTRODUCTION', data.introduction)
+                    dispatch('GenerateRoutes', data) // 动态修改权限后 重绘侧边菜单
+                    resolve()
+                })
+            })
+        }
     }
-  }
 }
 
-export default user
+export default user

+ 34 - 37
unimall-admin/src/views/gubi/info/index.vue

@@ -665,6 +665,8 @@ export default {
     getList() { // 接口方法
       debugger
       this.loading = true
+      this.sum = 0
+      this.num = 0
       // this.$api.amys.shopGroup.list().then(res => {
       //   if (res.data && res.status == "00000") {
       //     this.arrList = this.resFormat(res.data) //搜索一级分类
@@ -691,30 +693,29 @@ export default {
       //   // this.total = response.data.data.count
       //   // this.loading = false;
       // })
-      listInfo().then(response => {
-          // this.makeData(response.data.data)
-          this.first = response.data.data.items
-          this.arrList = this.resFormat(this.first) // 搜索一级分类
-          this.loading = false;
-          listSecond({
-            page: 1,
-            limit: 100,
-            typeId: this.first[0].id,
-      },).then(response => {
+      listInfo({ page: 1,
+        limit: 1000 }).then(response => {
+        // this.makeData(response.data.data)
+        this.first = response.data.data.items
+        this.arrList = this.resFormat(this.first) // 搜索一级分类
+        this.loading = false
+        listSecond({
+          page: 1,
+          limit: 1000,
+          typeId: this.first[0].id
+        }, ).then(response => {
           // this.makeData(response.data.data)
           this.second = response.data.data.items
           listThree({
             page: 1,
-            limit: 100,
-            secondId: this.second[0].id,
-      },).then(response => {
+            limit: 1000,
+            secondId: this.second[0].id
+          }, ).then(response => {
           // this.makeData(response.data.data)
-          this.tertiary = response.data.data.items
-         
-        });
-         
-        });
-        });
+            this.tertiary = response.data.data.items
+          })
+        })
+      })
     },
     makeData(val) {
       for (let i = 0; i < val.length; i++) {
@@ -750,38 +751,34 @@ export default {
         this.selectOneType = this.arrList[index]
         console.log(this.selectOneType)
         listSecond({
-            page: 1,
-            limit: 100,
-            typeId: this.selectOneType.id,
-      },).then(response => {
+          page: 1,
+          limit: 100,
+          typeId: this.selectOneType.id
+        }, ).then(response => {
           // this.makeData(response.data.data)
           this.sum = 0
           this.second = response.data.data.items
           listThree({
             page: 1,
             limit: 100,
-            secondId: this.second[0].id,
-      },).then(response => {
+            secondId: this.second[0].id
+          }, ).then(response => {
           // this.makeData(response.data.data)
-          this.tertiary = response.data.data.items
-         
-        });
-         
-        });
+            this.tertiary = response.data.data.items
+          })
+        })
         // console.log(this.first, '一级分类')
-
       } else {
         this.sum = index
         this.selectTwoType = this.second[index]
         listThree({
-            page: 1,
-            limit: 100,
-            secondId: this.selectTwoType.id,
-      },).then(response => {
+          page: 1,
+          limit: 100,
+          secondId: this.selectTwoType.id
+        }, ).then(response => {
           // this.makeData(response.data.data)
           this.tertiary = response.data.data.items
-         
-        });
+        })
       }
       // this.listType()
     },

+ 348 - 0
unimall-admin/src/views/gubi/loginRecord/index.vue

@@ -0,0 +1,348 @@
+<template>
+  <div class="app-container">
+    <el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
+      <!-- <el-form-item label="" prop="companyId">
+        <el-input
+          v-model="queryParams.companyId"
+          placeholder="请输入"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="分值id" prop="orderId">
+        <el-input
+          v-model="queryParams.orderId"
+          placeholder="请输入分值id"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item> -->
+      <el-form-item label="用户" prop="userName">
+        <el-input
+          v-model="queryParams.userName"
+          placeholder="请输入编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+
+    </el-form-item></el-form>
+
+    <el-table v-loading="loading" :data="transactionList">
+      <!-- <el-table-column label="" align="center" prop="id" />
+      <el-table-column label="" align="center" prop="companyId" /> -->
+      <!-- <el-table-column label="分值id" align="center" prop="orderId" /> -->
+      <el-table-column label="用户名" align="center" prop="userName" />
+      <el-table-column label="浏览器" align="center" prop="browser" />
+      <el-table-column label="登录ip" align="center" prop="ipaddr" />
+      <el-table-column label="登录时间" align="center" prop="collection" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.loginTime) }}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList" />
+  </div>
+</template>
+
+<script>
+import { uploadPath } from '@/api/storage'
+import { getToken } from '@/utils/auth'
+
+import { loginRecord } from '@/api/gubi/transaction'
+
+export default {
+  data() {
+    return {
+      first: [],
+      second: [],
+      tertiary: [],
+      value1: '',
+      value2: '',
+      value3: '',
+      dialogFormVisible1: false,
+      imgsFileList: [],
+      uploadPath,
+      data: [],
+      newList: [],
+      defaultProps: {
+        children: 'children',
+        label: 'typeName'
+      },
+      formLabelWidth: '120px',
+      dialogFormVisible: false,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 总条数
+      total: 0,
+      // 交易记录表格数据
+      transactionList: [],
+      threeList: [],
+      // 弹出层标题
+      title: '',
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userName: ''
+      },
+      // 表单参数
+      form: {},
+      orderName: '',
+      // 表单校验
+      rules: {
+        deleteFlag: [
+          { required: true, message: '0:否(默认) 1:是不能为空', trigger: 'blur' }
+        ]
+      }
+    }
+  },
+  computed: {
+    headers() {
+      return {
+        accessToken: getToken()
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    sx() {
+      this.dialogFormVisible1 = true
+    },
+    uploadOverrun: function() {
+      this.$message({
+        type: 'error',
+        message: '上传文件个数超出限制!最多上传2张图片!'
+      })
+    },
+    handleimgsUrl(response, file, fileList) {
+      if (response.errno === 200) {
+        this.form.urlPath.push(response.url)
+      }
+    },
+    handleRemove: function(file, fileList) {
+      for (var i = 0; i < this.form.urlPath.length; i++) {
+        // 这里存在两种情况
+        // 1. 如果所删除图片是刚刚上传的图片,那么图片地址是file.response.url
+        //    此时的file.url虽然存在,但是是本机地址,而不是远程地址。
+        // 2. 如果所删除图片是后台返回的已有图片,那么图片地址是file.url
+        var url
+        if (file.response === undefined) {
+          url = file.url
+        } else {
+          url = file.response.url
+        }
+
+        if (this.form.urlPath[i] === url) {
+          this.form.urlPath.splice(i, 1)
+        }
+      }
+      if (this.form.urlPath.length > 0) {
+        this.form.pictureUrl = this.form.urlPath[0]
+      }
+    },
+    handleNodeClick(data) {
+      console.log(data)
+      this.form.orderId = data.id
+      this.orderName = data.typeName
+      this.urlPath = data.urlPath.split(',')
+    },
+    handleNodeClick1(data) {
+      console.log(data)
+      this.queryParams.grade = data.typeId
+    },
+    typeConfirm() {
+      this.dialogFormVisible = false
+    },
+    typeConfirm1() {
+      this.dialogFormVisible1 = false
+      this.handleQuery()
+    },
+    selectType() {
+      this.dialogFormVisible = true
+    },
+    type1(e) {
+      this.value2=''
+      this.value3=''
+      console.log(e)
+      listSecond({
+        page: 1,
+        limit: 100,
+        typeId: e
+      }, ).then(response => {
+        this.second = response.data.data.items
+      })
+    },
+    type2(e) {
+      console.log(e)
+      this.value3=''
+      listThree({
+        page: 1,
+        limit: 100,
+        secondId: e
+      }, ).then(response => {
+        this.tertiary = response.data.data.items
+      })
+    },
+    type3(e) {
+      console.log(e)
+      this.queryParams.orderId = e
+    },
+    type33(e) {
+      console.log(e)
+      this.form.orderId = e
+    },
+    /** 查询交易记录列表 */
+    getList() {
+      this.loading = true
+      loginRecord(this.queryParams).then(response => {
+        this.transactionList = response.data.data.items
+        this.loading = false
+      })
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false
+      this.reset()
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: undefined,
+        companyId: undefined,
+        orderId: undefined,
+        number: undefined,
+        grade: undefined,
+        collection: undefined,
+        price: undefined,
+        status: '',
+        urlPath: [],
+        deleteFlag: undefined,
+        gmtCreate: undefined,
+        gmtUpdate: undefined,
+        userId: undefined,
+        adminId: undefined
+      }
+      this.resetForm('form')
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1
+      this.getList()
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.orderId = ''
+      this.resetForm('queryForm')
+      this.handleQuery()
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length != 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset()
+      this.open = true
+      this.title = '添加交易记录'
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset()
+      this.imgsFileList = []
+      const id = row.id || this.ids.join(',')
+      getTransaction(id).then(response => {
+        this.form = response.data.data
+        if (this.form.urlPath) {
+          this.form.urlPath = this.form.urlPath.split(',')
+        } else {
+          this.form.urlPath = []
+        }
+        this.form.collection = new Date(response.data.data.collection)
+        this.open = true
+        this.title = '修改交易记录'
+      })
+    },
+    /** 提交按钮 */
+    submitForm: function () {
+      this.$refs['form'].validate(valid => {
+        if (valid) {
+          console.log()
+          this.form.urlPath = this.form.urlPath.toString()
+          if (this.form.id != undefined) {
+            updateTransaction(this.form).then(response => {
+              if (response.data) {
+                this.msgSuccess('修改成功')
+                this.open = false
+                this.getList()
+              } else {
+                this.msgError(response.msg)
+              }
+            })
+          } else {
+            addTransaction(this.form).then(response => {
+              if (response.data) {
+                this.msgSuccess('新增成功')
+                this.open = false
+                this.getList()
+              } else {
+                this.msgError(response.msg)
+              }
+            })
+          }
+        }
+      })
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids.join(',')
+      this.$confirm('是否确认删除交易记录编号为"' + ids + '"的数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(function () {
+        return delTransaction(ids)
+      }).then(() => {
+        this.getList()
+        this.msgSuccess('删除成功')
+      }).catch(function () { })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams
+      this.$confirm('是否确认导出所有交易记录数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(function () {
+        return exportTransaction(queryParams)
+      }).then(response => {
+        this.download(response.data.data)
+      }).catch(function () { })
+    }
+  }
+}
+</script>

+ 126 - 129
unimall-admin/src/views/gubi/priceHis/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
+    <el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
       <!-- <el-form-item label="" prop="companyId">
         <el-input
           v-model="queryParams.companyId"
@@ -20,12 +20,14 @@
         />
       </el-form-item> -->
       <el-form-item label="时间" prop="collection">
-        <el-date-picker clearable size="small" style="width: 200px"
+        <el-date-picker
           v-model="queryParams.collection"
+          clearable
+          size="small"
+          style="width: 200px"
           type="date"
           value-format="yyyy-MM-dd"
-          placeholder="选择时间">
-        </el-date-picker>
+          placeholder="选择时间"/>
       </el-form-item>
       <el-form-item label="价钱" prop="price">
         <el-input
@@ -35,8 +37,8 @@
           size="small"
           @keyup.enter.native="handleQuery"
         />
-     </el-form-item>
-         <!-- <el-form-item label="状态" prop="status">
+      </el-form-item>
+      <!-- <el-form-item label="状态" prop="status">
         <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
           <el-option label="请选择字典生成" value="" />
         </el-select>
@@ -88,50 +90,50 @@
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
         <el-button
-        type="primary"
-        size="mini"
-        @click="sx"
-      >筛选</el-button>
+          type="primary"
+          size="mini"
+          @click="sx"
+        >筛选</el-button>
       </el-form-item>
     </el-form>
 
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button
+          v-permission="['gubi:priceHis:add']"
           type="primary"
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-permission="['gubi:priceHis:add']"
         >新增</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-permission="['gubi:priceHis:edit']"
+          :disabled="single"
           type="success"
           icon="el-icon-edit"
           size="mini"
-          :disabled="single"
           @click="handleUpdate"
-          v-permission="['gubi:priceHis:edit']"
         >修改</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-permission="['gubi:priceHis:remove']"
+          :disabled="multiple"
           type="danger"
           icon="el-icon-delete"
           size="mini"
-          :disabled="multiple"
           @click="handleDelete"
-          v-permission="['gubi:priceHis:remove']"
         >删除</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-permission="['gubi:priceHis:export']"
           type="warning"
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-permission="['gubi:priceHis:export']"
         >导出</el-button>
       </el-col>
     </el-row>
@@ -141,6 +143,7 @@
       <!-- <el-table-column label="" align="center" prop="id" />
       <el-table-column label="" align="center" prop="companyId" /> -->
       <!-- <el-table-column label="分值id" align="center" prop="orderId" /> -->
+      <el-table-column label="分类" align="center" prop="strFlag" />
       <el-table-column label="时间" align="center" prop="collection" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.collection).split(" ")[0] }}</span>
@@ -164,23 +167,23 @@
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
+            v-permission="['gubi:priceHis:edit']"
             size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-permission="['gubi:priceHis:edit']"
           >修改</el-button>
           <el-button
+            v-permission="['gubi:priceHis:remove']"
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-permission="['gubi:priceHis:remove']"
           >删除</el-button>
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
       v-show="total>0"
       :total="total"
@@ -200,45 +203,44 @@
         </el-form-item> -->
         <el-form-item label="一级分类" prop="">
           <!-- <div @click="selectType">{{ orderName ? orderName : '选择分值' }}</div> -->
-          <el-select v-model="value1" filterable placeholder="请选择" @change="type1" style="width: 100%">
+          <el-select v-model="value1" filterable placeholder="请选择" style="width: 100%" @change="type1">
             <el-option
               v-for="item in first"
               :key="item.id"
               :label="item.typeName"
-              :value="item.id">
-            </el-option>
+              :value="item.id"/>
           </el-select>
         </el-form-item>
         <el-form-item label="二级分类" prop="">
           <!-- <div @click="selectType">{{ orderName ? orderName : '选择分值' }}</div> -->
-          <el-select v-model="value2" filterable placeholder="请选择" @change="type2" style="width: 100%">
+          <el-select v-model="value2" filterable placeholder="请选择" style="width: 100%" @change="type2">
             <el-option
               v-for="item in second"
               :key="item.id"
               :label="item.secondName"
-              :value="item.id">
-            </el-option>
+              :value="item.id"/>
           </el-select>
         </el-form-item>
         <el-form-item label="三级分类" prop="">
           <!-- <div @click="selectType">{{ orderName ? orderName : '选择分值' }}</div> -->
-          <el-select v-model="value3" filterable placeholder="请选择" @change="type33" style="width: 100%">
+          <el-select v-model="value3" filterable placeholder="请选择" style="width: 100%" @change="type33">
             <el-option
               v-for="item in tertiary"
               :key="item.id"
               :label="item.typeId"
-              :value="item.id">
-            </el-option>
+              :value="item.id"/>
           </el-select>
         </el-form-item>
-    
+
         <el-form-item label="时间" prop="collection">
-          <el-date-picker clearable size="small" style="width: 100%"
+          <el-date-picker
             v-model="form.collection"
+            clearable
+            size="small"
+            style="width: 100%"
             type="date"
             value-format="yyyy-MM-dd"
-            placeholder="选择时间">
-          </el-date-picker>
+            placeholder="选择时间"/>
         </el-form-item>
         <el-form-item label="价钱(万元)" prop="price">
           <el-input v-model="form.price" placeholder="请输入价钱" />
@@ -289,7 +291,7 @@
       </div>
     </el-dialog> -->
     <el-dialog :visible.sync="dialogFormVisible1" title="分类">
-      
+
       <!-- <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"/> -->
       <div>
         <div style="margin-bottom:20px">一级分类</div>
@@ -298,8 +300,7 @@
             v-for="item in first"
             :key="item.id"
             :label="item.typeName"
-            :value="item.id">
-          </el-option>
+            :value="item.id"/>
         </el-select>
       </div>
       <div style="margin-top:20px">
@@ -309,8 +310,7 @@
             v-for="item in second"
             :key="item.id"
             :label="item.secondName"
-            :value="item.id">
-          </el-option>
+            :value="item.id"/>
         </el-select>
       </div>
       <div style="margin-top:20px">
@@ -320,8 +320,7 @@
             v-for="item in tertiary"
             :key="item.id"
             :label="item.typeId"
-            :value="item.id">
-          </el-option>
+            :value="item.id"/>
         </el-select>
       </div>
       <div slot="footer" class="dialog-footer">
@@ -336,25 +335,25 @@
 import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo, clearCache } from '@/api/gubi/info'
 import { listThree, getThree, delThree, addThree, updateThree, exportThree } from '@/api/gubi/three'
 import { listSecond, getSecond, delSecond, addSecond, updateSecond, exportSecond } from '@/api/gubi/second'
-import { listPriceHis, getPriceHis, delPriceHis, addPriceHis, updatePriceHis, exportPriceHis } from "@/api/gubi/priceHis";
-import { listTransaction, getTransaction, delTransaction, addTransaction, updateTransaction, exportTransaction, typeList } from "@/api/gubi/transaction";
+import { listPriceHis, getPriceHis, delPriceHis, addPriceHis, updatePriceHis, exportPriceHis } from '@/api/gubi/priceHis'
+import { listTransaction, getTransaction, delTransaction, addTransaction, updateTransaction, exportTransaction, typeList } from '@/api/gubi/transaction'
 export default {
   data() {
     return {
       first: [],
-      second:[],
-      tertiary:[],
+      second: [],
+      tertiary: [],
       value1: '',
-        value2: '',
-        value3: '',
-      dialogFormVisible1:false,
+      value2: '',
+      value3: '',
+      dialogFormVisible1: false,
       defaultProps: {
         children: 'children',
         label: 'typeName'
       },
       data: [],
       dialogFormVisible: false,
-      orderName: "",
+      orderName: '',
       // 遮罩层
       loading: true,
       // 选中数组
@@ -368,7 +367,7 @@ export default {
       // 价格历史表格数据
       priceHisList: [],
       // 弹出层标题
-      title: "",
+      title: '',
       // 是否显示弹出层
       open: false,
       // 查询参数
@@ -391,48 +390,46 @@ export default {
       // 表单校验
       rules: {
         deleteFlag: [
-          { required: true, message: "0:否(默认) 1:是不能为空", trigger: "blur" }
-        ],      }
-    };
+          { required: true, message: '0:否(默认) 1:是不能为空', trigger: 'blur' }
+        ] }
+    }
   },
   created() {
-    this.getList();
+    this.getList()
   },
   methods: {
     typeConfirm1() {
       this.dialogFormVisible1 = false
       this.handleQuery()
     },
-    type1(e){
+    type1(e) {
       this.value2=''
       this.value3=''
       console.log(e)
-    listSecond({
-            page: 1,
-            limit: 100,
-            typeId: e,
-      },).then(response => {
+      listSecond({
+        page: 1,
+        limit: 100,
+        typeId: e
+      }, ).then(response => {
         this.second = response.data.data.items
-
-      });
+      })
     },
-    type2(e){
+    type2(e) {
       console.log(e)
       this.value3=''
       listThree({
-            page: 1,
-            limit: 100,
-            secondId: e,
-      },).then(response => {
-          this.tertiary = response.data.data.items
-         
-        });
+        page: 1,
+        limit: 100,
+        secondId: e
+      }, ).then(response => {
+        this.tertiary = response.data.data.items
+      })
     },
-    type3(e){
+    type3(e) {
       console.log(e)
       this.queryParams.orderId = e
     },
-    type33(e){
+    type33(e) {
       console.log(e)
       this.form.orderId = e
     },
@@ -440,10 +437,10 @@ export default {
       this.dialogFormVisible1 = true
     },
     handleNodeClick(data) {
-      console.log(data);
+      console.log(data)
       this.form.orderId = data.id
       this.orderName = data.typeName
-      this.urlPath = data.urlPath.split(",")
+      this.urlPath = data.urlPath.split(',')
     },
     typeConfirm() {
       this.dialogFormVisible = false
@@ -453,15 +450,15 @@ export default {
     },
     /** 查询价格历史列表 */
     getList() {
-      this.loading = true;
+      this.loading = true
       listInfo().then(response => {
-          this.first = response.data.data.items
-        });
+        this.first = response.data.data.items
+      })
       listPriceHis(this.queryParams).then(response => {
         this.priceHisList = response.data.data.items
         this.total = response.data.data.count
-        this.loading = false;
-      });
+        this.loading = false
+      })
       // typeList().then(response => {
       //   this.makeData(response.data.data)
       // });
@@ -488,8 +485,8 @@ export default {
     // },
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.reset();
+      this.open = false
+      this.reset()
     },
     // 表单重置
     reset() {
@@ -499,26 +496,26 @@ export default {
         orderId: undefined,
         collection: undefined,
         price: undefined,
-        status: "0",
+        status: '0',
         deleteFlag: undefined,
         gmtCreate: undefined,
         gmtUpdate: undefined,
         userId: undefined,
         adminId: undefined
-      };
-      this.resetForm("form");
+      }
+      this.resetForm('form')
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
+      this.queryParams.pageNum = 1
+      this.getList()
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.queryParams.orderId = '';
-      this.resetForm("queryForm");
+      this.queryParams.orderId = ''
+      this.resetForm('queryForm')
 
-      this.handleQuery();
+      this.handleQuery()
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
@@ -528,76 +525,76 @@ export default {
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加价格历史";
+      this.reset()
+      this.open = true
+      this.title = '添加价格历史'
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset();
+      this.reset()
       const id = row.id || this.ids.join(',')
       getPriceHis(id).then(response => {
         this.form = response.data.data
-        this.form.collection = new Date(response.data.data.collection).toLocaleString().replace(/\//g, '-').split(" ")[0]
-        this.open = true;
-        this.title = "修改价格历史";
-      });
+        this.form.collection = new Date(response.data.data.collection).toLocaleString().replace(/\//g, '-').split(' ')[0]
+        this.open = true
+        this.title = '修改价格历史'
+      })
     },
     /** 提交按钮 */
     submitForm: function() {
-      this.$refs["form"].validate(valid => {
+      this.$refs['form'].validate(valid => {
         if (valid) {
           if (this.form.id != undefined) {
             updatePriceHis(this.form).then(response => {
               if (response.data) {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                this.msgSuccess('修改成功')
+                this.open = false
+                this.getList()
               } else {
-                this.msgError(response.msg);
+                this.msgError(response.msg)
               }
-            });
+            })
           } else {
             addPriceHis(this.form).then(response => {
               if (response.data) {
-                this.msgSuccess("新增成功");
-                this.open = false;
-                this.getList();
+                this.msgSuccess('新增成功')
+                this.open = false
+                this.getList()
               } else {
-                this.msgError(response.msg);
+                this.msgError(response.msg)
               }
-            });
+            })
           }
         }
-      });
+      })
     },
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids.join(',')
-      this.$confirm('是否确认删除价格历史编号为"' + ids + '"的数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delPriceHis(ids);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        }).catch(function() {});
+      this.$confirm('是否确认删除价格历史编号为"' + ids + '"的数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(function() {
+        return delPriceHis(ids)
+      }).then(() => {
+        this.getList()
+        this.msgSuccess('删除成功')
+      }).catch(function() {})
     },
     /** 导出按钮操作 */
     handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有价格历史数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return exportPriceHis(queryParams);
-        }).then(response => {
-          this.download(response.data.data);
-        }).catch(function() {});
+      const queryParams = this.queryParams
+      this.$confirm('是否确认导出所有价格历史数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(function() {
+        return exportPriceHis(queryParams)
+      }).then(response => {
+        this.download(response.data.data)
+      }).catch(function() {})
     }
   }
-};
-</script>
+}
+</script>

+ 35 - 42
unimall-admin/src/views/gubi/transaction/index.vue

@@ -163,6 +163,7 @@
       <!-- <el-table-column label="" align="center" prop="id" />
       <el-table-column label="" align="center" prop="companyId" /> -->
       <!-- <el-table-column label="分值id" align="center" prop="orderId" /> -->
+      <el-table-column label="分类" align="center" prop="strFlag" />
       <el-table-column label="编号" align="center" prop="number" />
       <el-table-column label="分值" align="center" prop="grade" />
       <el-table-column label="时间" align="center" prop="collection" width="180">
@@ -220,35 +221,32 @@
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="一级分类" prop="">
           <!-- <div @click="selectType">{{ orderName ? orderName : '选择分值' }}</div> -->
-          <el-select v-model="value1" filterable placeholder="请选择" @change="type1" style="width: 100%">
+          <el-select v-model="value1" filterable placeholder="请选择" style="width: 100%" @change="type1">
             <el-option
               v-for="item in first"
               :key="item.id"
               :label="item.typeName"
-              :value="item.id">
-            </el-option>
+              :value="item.id"/>
           </el-select>
         </el-form-item>
         <el-form-item label="二级分类" prop="">
           <!-- <div @click="selectType">{{ orderName ? orderName : '选择分值' }}</div> -->
-          <el-select v-model="value2" filterable placeholder="请选择" @change="type2" style="width: 100%">
+          <el-select v-model="value2" filterable placeholder="请选择" style="width: 100%" @change="type2">
             <el-option
               v-for="item in second"
               :key="item.id"
               :label="item.secondName"
-              :value="item.id">
-            </el-option>
+              :value="item.id"/>
           </el-select>
         </el-form-item>
         <el-form-item label="三级分类" prop="">
           <!-- <div @click="selectType">{{ orderName ? orderName : '选择分值' }}</div> -->
-          <el-select v-model="value3" filterable placeholder="请选择" @change="type33" style="width: 100%">
+          <el-select v-model="value3" filterable placeholder="请选择" style="width: 100%" @change="type33">
             <el-option
               v-for="item in tertiary"
               :key="item.id"
               :label="item.typeId"
-              :value="item.id">
-            </el-option>
+              :value="item.id"/>
           </el-select>
         </el-form-item>
         <el-form-item label="名称" prop="grade">
@@ -340,8 +338,7 @@
             v-for="item in first"
             :key="item.id"
             :label="item.typeName"
-            :value="item.id">
-          </el-option>
+            :value="item.id"/>
         </el-select>
       </div>
       <div style="margin-top:20px">
@@ -351,8 +348,7 @@
             v-for="item in second"
             :key="item.id"
             :label="item.secondName"
-            :value="item.id">
-          </el-option>
+            :value="item.id"/>
         </el-select>
       </div>
       <div style="margin-top:20px">
@@ -362,8 +358,7 @@
             v-for="item in tertiary"
             :key="item.id"
             :label="item.typeId"
-            :value="item.id">
-          </el-option>
+            :value="item.id"/>
         </el-select>
       </div>
       <div slot="footer" class="dialog-footer">
@@ -385,11 +380,11 @@ export default {
   data() {
     return {
       first: [],
-      second:[],
-      tertiary:[],
+      second: [],
+      tertiary: [],
       value1: '',
-        value2: '',
-        value3: '',
+      value2: '',
+      value3: '',
       dialogFormVisible1: false,
       imgsFileList: [],
       uploadPath,
@@ -513,45 +508,44 @@ export default {
     selectType() {
       this.dialogFormVisible = true
     },
-    type1(e){
+    type1(e) {
       this.value2=''
       this.value3=''
       console.log(e)
-    listSecond({
-            page: 1,
-            limit: 100,
-            typeId: e,
-      },).then(response => {
+      listSecond({
+        page: 1,
+        limit: 100,
+        typeId: e
+      }, ).then(response => {
         this.second = response.data.data.items
-
-      });
+      })
     },
-    type2(e){
+    type2(e) {
       console.log(e)
       this.value3=''
       listThree({
-            page: 1,
-            limit: 100,
-            secondId: e,
-      },).then(response => {
-          this.tertiary = response.data.data.items
-         
-        });
+        page: 1,
+        limit: 100,
+        secondId: e
+      }, ).then(response => {
+        this.tertiary = response.data.data.items
+      })
     },
-    type3(e){
+    type3(e) {
       console.log(e)
       this.queryParams.orderId = e
     },
-    type33(e){
+    type33(e) {
       console.log(e)
       this.form.orderId = e
     },
     /** 查询交易记录列表 */
     getList() {
       this.loading = true
-      listInfo().then(response => {
-          this.first = response.data.data.items
-        });
+      listInfo({ page: 1,
+        limit: 1000 }).then(response => {
+        this.first = response.data.data.items
+      })
       listTransaction(this.queryParams).then(response => {
         this.transactionList = response.data.data.items
         for (let i = 0; i < this.transactionList.length; i++) {
@@ -564,7 +558,6 @@ export default {
         this.total = response.data.data.count
         this.loading = false
       })
-
     },
     // 取消按钮
     cancel() {
@@ -598,7 +591,7 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.queryParams.orderId = '';
+      this.queryParams.orderId = ''
       this.resetForm('queryForm')
       this.handleQuery()
     },

+ 1 - 5
unimall-admin/src/views/sys/admin.vue

@@ -28,11 +28,7 @@
 
       <el-table-column align="center" label="管理员名称" prop="username" />
 
-      <el-table-column align="center" label="管理员头像" prop="avatar">
-        <template slot-scope="scope">
-          <img v-if="scope.row.avatar" :src="scope.row.avatar" width="40" >
-        </template>
-      </el-table-column>
+      <el-table-column align="center" label="电话" prop="phone"/>
 
       <el-table-column align="center" label="管理员角色" prop="roleIds">
         <template slot-scope="scope">

+ 1 - 1
unimall-admin/src/views/sys/role.vue

@@ -31,7 +31,7 @@
         <template slot-scope="scope">
           <el-button v-permission="['admin:role:update']" type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button>
           <el-button v-permission="['admin:role:delete']" type="danger" size="mini" @click="handleDelete(scope.row)">删除</el-button>
-          <el-button v-permission="['admin:role:permissionList']" type="primary" size="mini" @click="handlePermission(scope.row)">授权</el-button>
+          <!-- <el-button v-permission="['admin:role:permissionList']" type="primary" size="mini" @click="handlePermission(scope.row)">授权</el-button> -->
         </template>
       </el-table-column>
     </el-table>