update:增加ticket过期提示,请求提示,下拉刷新

This commit is contained in:
2021-10-08 09:20:10 +08:00
parent ab1972183c
commit 69c5b7a4f0
12 changed files with 343 additions and 282 deletions

View File

@@ -4,10 +4,6 @@
<div class="date">{{ modifyDate(info.publicTime) }}</div>
<hr />
<div class="content"></div>
<div class="bottomContent">
<p>本服务由浙江政务服务网宁波市住房保障和房屋征收管理中心提供</p>
<p>服务咨询热线<b>0574-88086606</b></p>
</div>
</div>
</template>
<script>
@@ -19,11 +15,11 @@ export default {
};
},
created() {
this.getData();
this.onInit();
},
methods: {
// 获取数据
getData() {
onInit() {
if (this.$route.params.id) {
window.sessionStorage.setItem("zszcId", this.$route.params.id);
}
@@ -38,11 +34,35 @@ export default {
},
appKey: "es4b8zmz+2001833218+dehllx",
onSuccess: data => {
const { data: res } = data;
console.log("res.data", res.data);
this.info = res.data;
let content = document.querySelector(".content");
content.innerHTML = res.data.contents;
if (data.data.success) {
const { data: res } = data;
console.log("res.data", res.data);
this.info = res.data;
let content = document.querySelector(".content");
content.innerHTML = res.data.contents;
} else {
let code = [6501, 6001];
if (code.indexOf(data.data.bizCode) != -1) {
this.$message({
message: "请求超时,请重新登录",
duration: 3000,
type: "info",
center: true
});
setTimeout(() => {
window.location.replace(
"https://puser.zjzwfw.gov.cn/sso/mobile.do?action=oauth&scope=1&servicecode=fwzs"
);
}, 3000);
} else {
this.$message({
message: "请求出错",
duration: 3000,
type: "error",
center: true
});
}
}
},
onFail: function(err) {
console.log("错误信息", err);
@@ -68,17 +88,5 @@ export default {
margin: 10px 0;
font-size: 16px;
}
.bottomContent {
margin-top: 10px;
text-align: center;
width: 100%;
font-size: 10px;
p {
margin: 0;
}
b {
color: #5d8cbc;
}
}
}
</style>