8 changed files with 139 additions and 145 deletions
			
			
		- 
					10.env.development
- 
					2src/api/device/configuration.js
- 
					9src/api/device/deviceList.js
- 
					80src/api/login.js
- 
					10src/main.js
- 
					45src/store/getters.js
- 
					23src/store/modules/device.js
- 
					93src/views/device/index.vue
| @ -1,2 +0,0 @@ | |||
| // 开关机配置的接口
 | |||
| import request from '@/utils/request' | |||
| @ -1,58 +1,58 @@ | |||
| import request from '@/utils/request' | |||
| 
 | |||
| export function login(username, password, phone, code, uuid) { | |||
|   return request({ | |||
|     url: 'auth/login', | |||
|     method: 'post', | |||
|     data: { | |||
|       username, | |||
|       password, | |||
|       phone, | |||
|       code, | |||
|       uuid | |||
|     } | |||
|   }) | |||
|     return request({ | |||
|         url: 'auth/login', | |||
|         method: 'post', | |||
|         data: { | |||
|             username, | |||
|             password, | |||
|             phone, | |||
|             code, | |||
|             uuid | |||
|         } | |||
|     }) | |||
| } | |||
| export function getMsg(phone) { | |||
|   return request({ | |||
|     url: 'auth/msg', | |||
|     method: 'post', | |||
|     data: { | |||
|       phone | |||
|     } | |||
|   }) | |||
|     return request({ | |||
|         url: 'auth/msg', | |||
|         method: 'post', | |||
|         data: { | |||
|             phone | |||
|         } | |||
|     }) | |||
| } | |||
| 
 | |||
| export function setPassword(phone, new_pass, code, uuid) { | |||
|   return request({ | |||
|     url: 'auth/password', | |||
|     method: 'post', | |||
|     data: { | |||
|       phone, | |||
|       new_pass, | |||
|       code, | |||
|       uuid | |||
|     } | |||
|   }) | |||
|     return request({ | |||
|         url: 'auth/password', | |||
|         method: 'post', | |||
|         data: { | |||
|             phone, | |||
|             new_pass, | |||
|             code, | |||
|             uuid | |||
|         } | |||
|     }) | |||
| } | |||
| 
 | |||
| export function getInfo() { | |||
|   return request({ | |||
|     url: 'auth/info', | |||
|     method: 'get' | |||
|   }) | |||
|     return request({ | |||
|         url: 'auth/info', | |||
|         method: 'get' | |||
|     }) | |||
| } | |||
| 
 | |||
| export function getCodeImg() { | |||
|   return request({ | |||
|     url: 'auth/code', | |||
|     method: 'get' | |||
|   }) | |||
|     return request({ | |||
|         url: 'auth/code', | |||
|         method: 'get' | |||
|     }) | |||
| } | |||
| 
 | |||
| export function logout() { | |||
|   return request({ | |||
|     url: 'auth/logout', | |||
|     method: 'delete' | |||
|   }) | |||
|     return request({ | |||
|         url: 'auth/logout', | |||
|         method: 'delete' | |||
|     }) | |||
| } | |||
| @ -1,25 +1,26 @@ | |||
| const getters = { | |||
|   deployUploadApi: state => state.api.deployUploadApi, | |||
|   databaseUploadApi: state => state.api.databaseUploadApi, | |||
|   size: state => state.app.size, | |||
|   sidebar: state => state.app.sidebar, | |||
|   device: state => state.app.device, | |||
|   token: state => state.user.token, | |||
|   visitedViews: state => state.tagsView.visitedViews, | |||
|   cachedViews: state => state.tagsView.cachedViews, | |||
|   roles: state => state.user.roles, | |||
|   user: state => state.user.user, | |||
|   loadMenus: state => state.user.loadMenus, | |||
|   permission_routers: state => state.permission.routers, | |||
|   addRouters: state => state.permission.addRouters, | |||
|   socketApi: state => state.api.socketApi, | |||
|   imagesUploadApi: state => state.api.imagesUploadApi, | |||
|   baseApi: state => state.api.baseApi, | |||
|   fileUploadApi: state => state.api.fileUploadApi, | |||
|   updateAvatarApi: state => state.api.updateAvatarApi, | |||
|   qiNiuUploadApi: state => state.api.qiNiuUploadApi, | |||
|   sqlApi: state => state.api.sqlApi, | |||
|   swaggerApi: state => state.api.swaggerApi, | |||
|   sidebarRouters: state => state.permission.sidebarRouters | |||
|     deployUploadApi: state => state.api.deployUploadApi, | |||
|     databaseUploadApi: state => state.api.databaseUploadApi, | |||
|     size: state => state.app.size, | |||
|     sidebar: state => state.app.sidebar, | |||
|     device: state => state.app.device, | |||
|     token: state => state.user.token, | |||
|     visitedViews: state => state.tagsView.visitedViews, | |||
|     cachedViews: state => state.tagsView.cachedViews, | |||
|     roles: state => state.user.roles, | |||
|     user: state => state.user.user, | |||
|     loadMenus: state => state.user.loadMenus, | |||
|     permission_routers: state => state.permission.routers, | |||
|     addRouters: state => state.permission.addRouters, | |||
|     socketApi: state => state.api.socketApi, | |||
|     imagesUploadApi: state => state.api.imagesUploadApi, | |||
|     baseApi: state => state.api.baseApi, | |||
|     fileUploadApi: state => state.api.fileUploadApi, | |||
|     updateAvatarApi: state => state.api.updateAvatarApi, | |||
|     qiNiuUploadApi: state => state.api.qiNiuUploadApi, | |||
|     sqlApi: state => state.api.sqlApi, | |||
|     swaggerApi: state => state.api.swaggerApi, | |||
|     sidebarRouters: state => state.permission.sidebarRouters, | |||
| 
 | |||
| } | |||
| export default getters | |||
| @ -1,23 +0,0 @@ | |||
| import { ReqDeviceList, ReqDeviceEdit } from '@/api/device/deviceList' | |||
| const device = { | |||
|     state: { | |||
|         deviceList: [] | |||
| 
 | |||
|     }, | |||
|     mutations: { | |||
|         GETDEVICELIST: (state, deviceList) => { | |||
|             state.deviceList = deviceList | |||
|         } | |||
|     }, | |||
|     actions: { | |||
|         //获取设备列表的信息
 | |||
|         async getDeviceList({ commit }, { page, size }) { | |||
|             let result = await ReqDeviceList(page, size) | |||
|             if (result.code == 200) { | |||
|                 commit('GETDEVICELIST', result.data.content) | |||
|             } | |||
|         }, | |||
|     }, | |||
| } | |||
| 
 | |||
| export default device | |||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue