【发布时间】:2019-04-03 06:18:20
【问题描述】:
我有一个 Angular Web 应用程序 在 index.html 中写的代码
app.run(function ($rootScope, $cookieStore, $location, $window) {
$rootScope.$on("$routeChangeStart", function (event, next, current) {
if ($cookieStore.get('username') == null) {
$window.location.href = '/report/login.html';
} else {
}
});
});
使用上面的代码,我尝试将其更改为 /regist/index.html 并且更改已保存, 但是当我尝试访问它时,网页仍然指向旧位置而不是最新的 location href 我尝试刷新几次没有任何变化,最后我尝试在开发人员工具中禁用缓存并刷新它, 如何解决它,伙计们需要你的帮助。
【问题讨论】:
-
当你禁用缓存时它修复了吗?
-
是的,我禁用它并刷新浏览器,它会更改为我编写的最新代码
标签: javascript html angularjs session-cookies httpcookie