|
@@ -40,9 +40,18 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
- import {reqLogin, reqLogout} from "../api"
|
|
|
|
|
|
+ import {
|
|
|
|
+ reqBigScreen,
|
|
|
|
+ reqConfigBigScreen,
|
|
|
|
+ reqConfigDevice,
|
|
|
|
+ reqDevice,
|
|
|
|
+ reqLogin,
|
|
|
|
+ reqLogout,
|
|
|
|
+ reqPreviewSourceList
|
|
|
|
+ } from "../api"
|
|
import {getStaticFile} from "../../utils/tools"
|
|
import {getStaticFile} from "../../utils/tools"
|
|
import storageUtils from "../../utils/storageUtils"
|
|
import storageUtils from "../../utils/storageUtils"
|
|
|
|
+ import axios from "axios"
|
|
|
|
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
@@ -126,6 +135,42 @@
|
|
storageUtils.saveToken(res.token)
|
|
storageUtils.saveToken(res.token)
|
|
// 跳转到管理界面
|
|
// 跳转到管理界面
|
|
this.$router.replace('/admin')
|
|
this.$router.replace('/admin')
|
|
|
|
+
|
|
|
|
+ // 上传配置数据和获取接口数据
|
|
|
|
+ axios.get('static/Data/EnityBigScreen.Data').then(async res => {
|
|
|
|
+ if (res.status === 200) {
|
|
|
|
+ const result = await reqConfigBigScreen(res.data)
|
|
|
|
+ if(result[0].ID){
|
|
|
|
+ console.log('上传大屏配置文件成功!')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ axios.get('static/Data/EnityDevice.Data').then(async res => {
|
|
|
|
+ if (res.status === 200) {
|
|
|
|
+ const result = await reqConfigDevice(res.data)
|
|
|
|
+ if(result[0].ID){
|
|
|
|
+ console.log('上传设备配置文件成功!')
|
|
|
|
+
|
|
|
|
+ const windowJson = await getStaticFile('EnityWindow.Data')
|
|
|
|
+ const arr = windowJson.filter(item => item.IsVisibility === true)
|
|
|
|
+ const homeJson = arr[0]
|
|
|
|
+ this.$store.dispatch('updateHomeJson',homeJson)
|
|
|
|
+
|
|
|
|
+ // 获取大屏,信号源,设备数据,label数据并保存到vuex中
|
|
|
|
+ const bigScreenJson = await reqBigScreen()
|
|
|
|
+ const signalListJson = await reqPreviewSourceList()
|
|
|
|
+ const deviceJson = await reqDevice()
|
|
|
|
+ const labelJson = await getStaticFile('EnityLable.Data')
|
|
|
|
+ this.$store.dispatch('updateLabelJson',labelJson)
|
|
|
|
+ this.$store.dispatch('saveBigscreen',bigScreenJson)
|
|
|
|
+ this.$store.dispatch('saveSignalList',signalListJson)
|
|
|
|
+ this.$store.dispatch('saveDevice',deviceJson)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
this.$message.error('用户名或密码错误!')
|
|
this.$message.error('用户名或密码错误!')
|
|
}
|
|
}
|