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

bugfix

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