强制使用谷歌或者火狐浏览器
This commit is contained in:
parent
fb0a5e1f38
commit
0661a53d79
|
@ -22,9 +22,9 @@
|
||||||
</a-input>
|
</a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<!-- IE Chrome -->
|
<!-- IE Chrome || judgeAgent() !== 'Chrome'-->
|
||||||
<a-button type="primary" html-type="submit"
|
<a-button type="primary" html-type="submit"
|
||||||
:disabled="form.username === '' || form.password === '' || judgeAgent() !== 'Chrome'">
|
:disabled="form.username === '' || form.password === '' || !canOpen.includes(judgeAgent())">
|
||||||
登录
|
登录
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
@ -57,6 +57,9 @@ export default {
|
||||||
redirect: undefined,
|
redirect: undefined,
|
||||||
dependencies: dependencies,
|
dependencies: dependencies,
|
||||||
devDependencies: devDependencies,
|
devDependencies: devDependencies,
|
||||||
|
is360: false,
|
||||||
|
isIE: false,
|
||||||
|
canOpen: ['FF', 'Chrome']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -76,13 +79,11 @@ export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
this.form.username = ''
|
this.form.username = ''
|
||||||
this.form.password = ''
|
this.form.password = ''
|
||||||
/* setTimeout(() => {
|
|
||||||
this.handleSubmit()
|
if (!this.canOpen.includes(this.judgeAgent())) {
|
||||||
}, 3000) */
|
|
||||||
if (this.judgeAgent() !== 'Chrome') {
|
|
||||||
Modal.warning({
|
Modal.warning({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '请使用谷歌浏览器!',
|
content: '请使用谷歌或火狐浏览器!',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -93,6 +94,7 @@ export default {
|
||||||
// 判断浏览器
|
// 判断浏览器
|
||||||
judgeAgent() {
|
judgeAgent() {
|
||||||
let userAgent = navigator.userAgent // 取得浏览器的userAgent字符串
|
let userAgent = navigator.userAgent // 取得浏览器的userAgent字符串
|
||||||
|
console.log('userAgent------------>', userAgent);
|
||||||
let isOpera = userAgent.indexOf('Opera') > -1
|
let isOpera = userAgent.indexOf('Opera') > -1
|
||||||
//判断是否Opera浏览器
|
//判断是否Opera浏览器
|
||||||
if (isOpera) {
|
if (isOpera) {
|
||||||
|
|
Loading…
Reference in New Issue