Commit b9321d34 authored by caicaicai's avatar caicaicai

视频页面完善

parent 2d6affb6
//-----------------登录--------------------
export const login = 'auth/login'; //登录
export const code = 'auth/code';
export const mainCamera = 'camera/mainCamera'; //视频监控分区表
export const mainCameraDetail = 'camera/list'; //视频监控分区摄像头详情表
\ No newline at end of file
......@@ -17,7 +17,7 @@ axios.interceptors.request.use(
let ticket = JSON.parse(localStorage.getItem(appConfig.USER_KEY)).ticket;
config.headers.ticket = ticket == null ? '' : ticket;
}
config.headers.token = token == null ? '' : token;
config.headers.Authorization = token == null ? '' : token;
return config;
},
......
......@@ -25,10 +25,13 @@ const mineMonitoring = {
productionAutomation:{
name:"生产自动化",
context:[{name:"发货车辆",num:"36辆"},{name:"发货量",num:"36辆"}],
}
},
user:"",
},
mutations:{
changeUser(userName){
state.user = userName;
}
},
getters:{
......@@ -65,12 +68,10 @@ export default new Vuex.Store({
state: {
projectName:"鑫海数字矿山后台管理系统",
platformName:"鑫海数字矿山后台管理平台",
user:"",
},
mutations: {
changeUser(userName){
state.user = userName;
}
},
actions: {
},
......
......@@ -5,7 +5,7 @@
<span>{{ $store.state.platformName }}</span>
<div class="userInformationBar">
<div style="margin-right:10px;">
<span>{{$store.state.user}}</span>
<span>{{userName}}</span>
<span class="iconfont icon-xiajiantou xiajiantou" style="font-size:18px;"></span>
</div>
<el-button type="primary" circle @click="handleFullScreen()" size="small" style="margin-right:10px;"><span :class="quanping"></span></el-button>
......
......@@ -26,6 +26,7 @@ import axios from "axios"
import {login,code} from "@/axios/api.js"
import {encrypt} from "@/utils/rsaEncrypt.js"
import Cookies from 'js-cookie'
import { config as appConfig } from '../config.js'
export default {
......@@ -62,6 +63,7 @@ export default {
}
},
LoginInitiation(){
let self = this
if(this.loginForm.userName == "" || this.loginForm.password == ""){
alert("请输入正确的用户名或密码!")
}else{
......@@ -76,9 +78,17 @@ export default {
}
if(valid){
httpPostForJson(login, user).then( res =>{
//console.log(res);
console.log(res);
if(res.user.user.enabled){
//this.$store.commit('changeUser',res.user.user.nickName);
//self.$store.a.commit('changeUser',res.user.user.nickName);
localStorage.setItem(appConfig.TOKEN_KEY,res.token);
if (user.rememberMe) {
Cookies.set('username', user.username, { expires: Config.passCookieExpires })
Cookies.set('password', user.password, { expires: Config.passCookieExpires })
} else {
Cookies.remove('username')
Cookies.remove('password')
}
this.$router.push({path: 'homepage/mineMonitoring'});
}else{
// console.log(res);
......@@ -89,13 +99,7 @@ export default {
}
})
this.loading = true
if (user.rememberMe) {
Cookies.set('username', user.username, { expires: Config.passCookieExpires })
Cookies.set('password', user.password, { expires: Config.passCookieExpires })
} else {
Cookies.remove('username')
Cookies.remove('password')
}
} else {
console.log('error submit!!')
return false
......
......@@ -4,8 +4,8 @@
<div class="leftMenuBar">
<div style="color:#071E4C;font-weight:600;font-size:20px;margin-bottom:20px;">视频监控区域</div>
<div style="color:#071E4C;font-weight:600;font-size:17px;">
<div v-for="(item,index) in videoAreaArray" :key="index" style="margin-bottom:10px;cursor: pointer;" :class="index == videoAreaIndex ? 'leftMenuSelected' : '' " @click="videoMenuIndex(index)">
<span class="el-icon-camera-solid"> {{item}}</span>
<div v-for="(item,index) in main_camera" :key="index" style="margin-bottom:10px;cursor: pointer;" :class="index == videoAreaIndex ? 'leftMenuSelected' : '' " @click="videoMenuIndex(index)">
<span class="el-icon-camera-solid"> {{item.name}}</span>
</div>
</div>
</div>
......@@ -23,7 +23,22 @@
export default {
data(){
return{
videoAreaArray:["采区监控","厂区监控","办公室监控","办公室监控1","办公室监控2"],
main_camera:[{
name:"采区监控",
cnt:4,
},{
name:"厂区监控",
cnt:4
},{
name:"办公室监控",
cnt:4
},{
name:"办公室监控1",
cnt:4
},{
name:"办公室监控2",
cnt:4
}],
videoAreaIndex:0,
rightVideoBoxArray:[4,4,4,4],
}
......
......@@ -94,25 +94,26 @@ module.exports = {
// 所有 webpack-dev-server 的选项都支持
devServer: {
proxy: {
'/api': {
target: process.env.VUE_APP_URL,
changeOrigin: true,
pathRewrite: {
'^/api' : ''
}
},
'/mock': {
// target: "http://192.168.7.124:20000/mock/5cf77a56210725034419be41",
// target: 'http://45.125.46.128:20000/mock/5cf77a56210725034419be41',
target: 'localhost:30003/hlkj/',
// proxy: {
// '/api': {
// // target: process.env.VUE_APP_URL,
// target: 'http://192.168.0.108:8013/',
// changeOrigin: true,
ws: true,
pathRewrite: {
"^/mock": ""
}
},
}
// pathRewrite: {
// '^/api' : ''
// }
// },
// '/mock': {
// // target: "http://192.168.7.124:20000/mock/5cf77a56210725034419be41",
// // target: 'http://45.125.46.128:20000/mock/5cf77a56210725034419be41',
// target: 'localhost:30003/hlkj/',
// // changeOrigin: true,
// ws: true,
// pathRewrite: {
// "^/mock": ""
// }
// },
// }
},
// 是否为 Babel 或 TypeScript 使用 thread-loader
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment