javascript - 如何限制用户直接从 AngularJS (1.x) 中的 URL 访问 html 模板
问题描述
努力让用户限制直接在AngularJS(1.x)中访问HTML页面
我的应用程序 URL 是:https://mylocalhost/
该页面需要限制访问 URL:https://mylocalhost/common/security/login.html
尝试在 app.js 中使用“stateChangeStart”
$rootScope.$on("$stateChangeStart", function(event, toState, toParams, fromState, fromParams){
//restric condition here
});
由于此 html 页面直接从 url 加载,因此此页面不受 appModule/loginController 控制。浏览器网络面板只显示加载的 Html 页面。
任何限制此页面直接访问的建议/建议。
解决方案
推荐阅读
- wordpress - 选择子字段在被 wc_get_related_products 循环时返回空字符串
- c# - Automapper 映射嵌套不同的对象属性
- javascript - 根据您选择的选项显示图像
- arrays - SwiftUI:数组内的修饰符
- c++ - g++ 为 transform() 的参数生成错误
- objective-c - 文本字段验证方法 obj c
- jquery - 像谷歌驱动器那样异步下载文件
- google-api - 当我向 googleapis 发出请求时,收到 400 Bad Request
- git - 纱线 v2 gitignore
- c++ - 内存栅栏是否涉及内核