修改title和ico
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import QS from 'qs';
|
||||
import router from '../router/index'
|
||||
import { redirectToExternalWebsite } from '@/utils/util.js'
|
||||
//qs.stringify()是将对象 序列化成URL的形式,以&进行拼接
|
||||
// let protocol = window.location.protocol; //协议
|
||||
// let host = window.location.host; //主机
|
||||
@@ -44,6 +45,7 @@ axios.interceptors.response.use(
|
||||
// 跳转登录页面
|
||||
case 403:
|
||||
// router.push('/login')
|
||||
redirectToExternalWebsite()
|
||||
break
|
||||
// 404请求不存在
|
||||
case 404:
|
||||
|
||||
15
src/utils/util.js
Normal file
15
src/utils/util.js
Normal file
@@ -0,0 +1,15 @@
|
||||
function setSeoTitle(title) {
|
||||
document.title = '港校租房-' + title
|
||||
}
|
||||
|
||||
function redirectToExternalWebsite(url) {
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.target = '_blank';
|
||||
link.click();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
setSeoTitle,
|
||||
redirectToExternalWebsite,
|
||||
}
|
||||
Reference in New Issue
Block a user