| 12345678910111213141516171819202122232425262728293031323334353637 |
- import { Message } from 'element-ui'
- let tools = {}
- tools.error=function(msg){
- Message({
- message: msg,
- type: 'error',
- duration: 2000
- })
- }
- tools.success=function(msg){
- Message({
- message: msg,
- type: 'success',
- duration: 2000
- })
- }
- tools.getLang=function(){
- return localStorage.getItem('lang') || 'en'
- }
- export default tools
- export function hasMobile() {
- let isMobile = false;
- if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
- isMobile = true;
- }
- if (document.body.clientWidth < 800) {
- isMobile = true;
- }
- return isMobile
- }
|