Commit d2ad9133 by 万亚飞

title

parent 547fbd34
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Modal, Toast } from 'antd-mobile'; import { Modal, Toast } from 'antd-mobile';
import classNames from 'classnames'; import classNames from 'classnames';
import { linkTo } from '@/utils/tools'; import { linkTo, setTitle } from '@/utils/tools';
import TrainItem from '../../Components/page/user/TrainItem'; import TrainItem from '../../Components/page/user/TrainItem';
import TabBar from '../../Components/page/user/TabBar'; import TabBar from '../../Components/page/user/TabBar';
import { MATERIAL_ARR } from '../../static/js/constant'; import { MATERIAL_ARR } from '../../static/js/constant';
...@@ -72,7 +72,8 @@ class JobList extends Component { ...@@ -72,7 +72,8 @@ class JobList extends Component {
}; };
} }
componentWillMount() { componentWillMount() {
document.title = '执业背景'; setTitle('执业背景');
// document.title = '执业背景';
this.setState({ this.setState({
tabIndex: parseInt(getParameterByName('index', location.href)) || 0 tabIndex: parseInt(getParameterByName('index', location.href)) || 0
}); });
......
...@@ -65,3 +65,16 @@ export function linkTo(url) { ...@@ -65,3 +65,16 @@ export function linkTo(url) {
// app().goPage(`${location.origin}${url}`); // app().goPage(`${location.origin}${url}`);
// app().gotoOCChat('壹点零', `${location.origin}${url}`); // app().gotoOCChat('壹点零', `${location.origin}${url}`);
} }
export function setTitle(title) {
document.title = title;
if (navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
const hackIframe = document.createElement('iframe');
hackIframe.style.display = 'none';
hackIframe.src = '/favicon.ico?r=' + Math.random();
document.body.appendChild(hackIframe);
setTimeout(_ => {
document.body.removeChild(hackIframe);
}, 300);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment