Commit b9f395ff authored by 张牧越's avatar 张牧越

bugfix

parent 32511e2e
......@@ -10,9 +10,8 @@ export default {
components: {},
methods: {},
mounted() {
if (this.$route.query.token) {
localStorage.setItem("token", this.$route.query.token);
// this.$router.push("/");
if (this.$route.query.token_code) {
localStorage.setItem("token", this.$route.query.token_code);
}
},
};
......
import request from "@/utils/request"
export function getXAccessToken(token) {
return request({
url: `/pweb/s/token/${token}`,
method: 'get',
})
}
export function getBaseData() {
return request({
url: '/pweb/s/project/basedata',
......
......@@ -29,12 +29,13 @@
</div>
</div>
</div>
<div>
<div v-if="signIn">
<router-view></router-view>
</div>
</div>
</template>
<script>
import { getXAccessToken } from "@/api/index";
export default {
name: "Index",
data() {
......@@ -43,6 +44,7 @@ export default {
weekDay: "",
date: "",
zoom: 1,
signIn: false,
};
},
methods: {
......@@ -101,6 +103,16 @@ export default {
jumpBack() {
window.location.href = window.location.origin + "/pweb/m/";
},
getXAccessToken() {
getXAccessToken(localStorage.getItem("token")).then((res) => {
if (res.status == 200) {
localStorage.setItem("Authorization", res.data.access_token);
this.$nextTick(() => {
this.signIn = true;
});
}
});
},
},
computed: {
token() {
......@@ -110,7 +122,9 @@ export default {
mounted() {
this.$nextTick(() => {
this.bodyScale();
this.getXAccessToken();
});
this.getTime();
setInterval(() => {
this.getTime();
......
......@@ -133,7 +133,7 @@
<img class="rt" src="@/assets/rt.png" alt="" />
<img class="rb" src="@/assets/rb.png" alt="" />
<img class="lb" src="@/assets/lb.png" alt="" />
<el-carousel :interval="5000" arrow="always" height="600px">
<el-carousel :interval="5000" arrow="always" height="520px">
<el-carousel-item
v-for="(item, index) in screenDetail.plane_image_arr"
:key="index"
......@@ -486,13 +486,7 @@ export default {
});
getDeviceStatus().then((res) => {
if (res.status == 200) {
this.deviceStatus = res.data.map((item) => {
return {
...item,
icon_path:
process.env.VUE_APP_RESOURCE_URL + "/" + item.icon_path,
};
});
this.deviceStatus = res.data;
}
});
getProgressDetail().then((res) => {
......@@ -721,7 +715,7 @@ export default {
position: relative;
.container-img {
width: 100%;
height: calc(100vh - 500px);
height: 520px;
vertical-align: top;
}
.lt,
......@@ -784,7 +778,7 @@ export default {
}
}
.unit-scroll {
max-height: 200px;
max-height: 160px;
overflow: scroll;
}
.construction-status {
......
......@@ -41,9 +41,9 @@ const request = axios.create({
request.interceptors.request.use(
config => {
const token = localStorage.getItem('token')
if (token) {
config.headers['token'] = token
const Authorization = localStorage.getItem('Authorization')
if (Authorization) {
config.headers['Authorization'] = Authorization
}
showLoading()
return config
......@@ -64,7 +64,7 @@ request.interceptors.response.use(
})
}
if (response.data.status == 401) {
// window.location.href = process.env.VUE_APP_RESOURCE_URL + 'pweb/m/login'
window.location.href = process.env.VUE_APP_RESOURCE_URL + 'pweb/m/login'
}
return response.data
},
......
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