Commit b9321d34 authored by caicaicai's avatar caicaicai

视频页面完善

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