fix(perf): 移除登录页阻塞加载的搜狐 IP 第三方脚本
CI/CD Deploy (Web) / 构建前端镜像并部署 (push) Successful in 25s

- 根因:public/index.html head 内同步引用 pv.sohu.com/cityjson,
  浏览器需阻塞等待该外部脚本加载完成(该服务已不稳定,经常长时间挂起),
  是登录页打开慢的主因
- ip 参数整链路为死代码:login.vue 取 returnCitySN["cip"] →
  store handleLogin 透传 → api login() 中根本未使用;
  后端也无一处消费 ip 参数(smart-campus 脚手架遗留)
- 删除 index.html 脚本引用与 login.vue / store 中的 ip 取值透传
This commit is contained in:
张家训
2026-10-20 16:42:40 +08:00
parent deb7476e4a
commit 8cc5ac7116
2 changed files with 29 additions and 33 deletions
-2
View File
@@ -5,8 +5,6 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!--获取当前ip的js依赖-->
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<title>freedom</title>
</head>
<body>
+1 -3
View File
@@ -47,10 +47,8 @@
'getUserInfo'
]),
handleSubmit ({ username, password }) {
// returnCitySN 由 index.html 引用的第三方脚本定义,可能加载失败,需兜底
var ip = (typeof returnCitySN !== 'undefined' && returnCitySN) ? returnCitySN["cip"] : ''
this.$refs.loginForm.loading = true
this.handleLogin({username, password, ip}).then(res => {
this.handleLogin({ username, password }).then(res => {
setTimeout(() => {
this.$refs.loginForm.loading = false
this.$router.push({