You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
121 lines
3.2 KiB
121 lines
3.2 KiB
<template> |
|
<div class="wrapper"> |
|
<header> |
|
<img src="/imgs/bg1.png" alt="" /> |
|
</header> |
|
<main> |
|
<div class="flex gap-10 center mt-20"> |
|
<a |
|
class="flex v-center center gap-16" |
|
@click="go('/mail?active=write')" |
|
> |
|
<div style="width: 48px"> |
|
<img src="/imgs/write.png" alt="" /> |
|
</div> |
|
<span>我要写信</span> |
|
</a> |
|
<a |
|
class="flex v-center center gap-16" |
|
@click="go('/mail?active=my')" |
|
> |
|
<div style="width: 48px"> |
|
<img src="/imgs/search.png" alt="" /> |
|
</div> |
|
<span>回复查询</span> |
|
</a> |
|
</div> |
|
<p class="text-center mt-20"> |
|
局长信箱只接受实名举报投诉,不受理报警业务 |
|
</p> |
|
<p class="text-center">如遇紧急情况请拨打110</p> |
|
</main> |
|
<footer class="text-center"> |
|
<a href="https://beian.miit.gov.cn" target="_blank">湘ICP备19012776号-1</a> |
|
</footer> |
|
</div> |
|
</template> |
|
<script setup> |
|
import { showLoadingToast } from "vant"; |
|
import { useRoute, useRouter } from "vue-router"; |
|
import { auth, authOpenid } from "@/api/auth"; |
|
import UserStore from "@/store/user"; |
|
import { setToken, getToken } from "@/util/cookie"; |
|
import WxStore from "@/store/wx"; |
|
|
|
const wxStore = WxStore(); |
|
|
|
const router = useRouter(); |
|
const route = useRoute(); |
|
const userStore = UserStore(); |
|
|
|
const toast = showLoadingToast({ |
|
message: "加载中...", |
|
forbidClick: true, |
|
duration: 0, |
|
}); |
|
const code = route.query.code; |
|
if (!getToken()) { |
|
if (code) { |
|
// 授权登录 |
|
auth(code).then((data) => { |
|
setToken(data.token); |
|
userStore.user = data.user; |
|
toast.close(); |
|
window.location.href = "https://jzxx.biutag.com/" |
|
}); |
|
} else if (route.query.openid) { |
|
// 自定义登录 |
|
authOpenid(route.query.openid).then((data) => { |
|
setToken(data.token); |
|
userStore.user = data.user; |
|
toast.close(); |
|
}); |
|
} else { |
|
const appid = "wx795f76e4bc3b0062"; |
|
// // const location = window.location.href |
|
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent( |
|
location.origin |
|
)}&response_type=code&scope=snsapi_base&state=#wechat_redirect`; |
|
} |
|
} else { |
|
toast.close(); |
|
wxStore.initSign() |
|
} |
|
|
|
function go(url) { |
|
router.push(url) |
|
} |
|
</script> |
|
<style lang="scss" scoped> |
|
.wrapper { |
|
background-color: #fff; |
|
} |
|
|
|
header { |
|
img { |
|
width: 100%; |
|
} |
|
} |
|
|
|
a { |
|
width: 45.2%; |
|
height: 84px; |
|
text-decoration: none; |
|
border: 1px solid var(--primary-color); |
|
color: var(--primary-color); |
|
font-weight: bold; |
|
font-size: 18px; |
|
|
|
&:hover { |
|
cursor: pointer; |
|
} |
|
} |
|
footer { |
|
margin-top: 34vh; |
|
a { |
|
font-size: 12px; |
|
font-weight: 500; |
|
border: none; |
|
} |
|
} |
|
</style>
|
|
|