禁止之后也访问

This commit is contained in:
luyuan 2020-11-24 10:56:51 +08:00
parent a861bc5232
commit 388a5df6b0
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
4 changed files with 61 additions and 5 deletions

View File

@ -8,7 +8,7 @@
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title> <title><%= htmlWebpackPlugin.options.title %></title>
<link href="https://imgcache.qq.com/open/qcloud/video/tcplayer/tcplayer.css" rel="stylesheet"> <link href="https://imgcache.qq.com/open/qcloud/video/tcplayer/tcplayer.css" rel="stylesheet">
<script data-ad-client="ca-pub-7145171713084445" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 如需在IE8、9浏览器中初始化播放器浏览器需支持Flash并在页面中引入 --> <!-- 如需在IE8、9浏览器中初始化播放器浏览器需支持Flash并在页面中引入 -->
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="//imgcache.qq.com/open/qcloud/video/tcplayer/ie8/videojs-ie8.js"></script> <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/ie8/videojs-ie8.js"></script>
@ -107,6 +107,19 @@
</script> </script>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js"></script> <script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js"></script>
<script src="/js/cropper.min.js"></script> <script src="/js/cropper.min.js"></script>
<div id="divadsensedisplaynone" style="width: 500px;height: 100px;">
<script data-ad-client="ca-pub-7145171713084445" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 测试 -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-7145171713084445"
data-ad-slot="4213570423"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</body> </body>
</html> </html>

View File

@ -27,6 +27,7 @@ export default defineComponent({
if(getValue('token')){ if(getValue('token')){
console.log("token") console.log("token")
store.commit("login", true) store.commit("login", true)
store.dispatch("getcode");
store.dispatch("setUserInfo"); store.dispatch("setUserInfo");
}else{ }else{

View File

@ -1040,7 +1040,7 @@ export async function luzhi(roomid: string){
} }
export function getaddr() { export function getaddr() {
return new Promise((r)=>{ return new Promise(async (r)=>{
console.log("开始定位") console.log("开始定位")
const lan = getValue("Lanvuage"); const lan = getValue("Lanvuage");
if ("geolocation" in navigator) { if ("geolocation" in navigator) {
@ -1065,11 +1065,45 @@ export function getaddr() {
r({yy: 'en', yyx: 'English', hb: '美元$', qh}) r({yy: 'en', yyx: 'English', hb: '美元$', qh})
} }
} }
},(err) => { },async () => {
message.error(err.message) const qh = await get<any>('countryCode', {
console.log(err, 'err')
});
console.log(qh)
if(lan != null && lan){
if(qh.data.ename == "China"){
r({hb: '人民币¥', qh});
}else {
r({hb: '美元$'})
}
}else{
if(qh.data.ename == "China"){
r({yy: "zh", yyx: "中文", hb: '人民币¥', qh});
}else {
r({yy: 'en', yyx: 'English', hb: '美元$', qh})
}
}
// message.error(err.message)
// console.log(err, 'err')
}) })
} else { } else {
const qh = await get<any>('countryCode', {
});
console.log(qh)
if(lan != null && lan){
if(qh.data.ename == "China"){
r({hb: '人民币¥', qh});
}else {
r({hb: '美元$'})
}
}else{
if(qh.data.ename == "China"){
r({yy: "zh", yyx: "中文", hb: '人民币¥', qh});
}else {
r({yy: 'en', yyx: 'English', hb: '美元$', qh})
}
}
/* 地理位置服务不可用 */ /* 地理位置服务不可用 */
console.log("无法定位") console.log("无法定位")
} }

View File

@ -110,6 +110,9 @@ export default createStore({
} }
}, },
setquhao(state, data){
state.qh = data.qh.data;
},
setWlan(state){ setWlan(state){
const lan = getValue("Lanvuage"); const lan = getValue("Lanvuage");
if(lan != null && lan){ if(lan != null && lan){
@ -134,6 +137,11 @@ export default createStore({
const info = await getaddr(); const info = await getaddr();
console.log(info,11256445); console.log(info,11256445);
commit("setLanguage", info) commit("setLanguage", info)
},
async getcode({ commit }){
const info = await getaddr();
console.log(info,11256445);
commit("setquhao", info)
} }
}, },
modules: { modules: {