[AngularJS] Store the entry url and redirect to entry url after Logged in
For example when a outside application need to visit your app address:
https://www.example.com/#/lobby/abc
But before enter '/lobby/abc', user need to login, so the application will redirect user to
https://www.example.com/#/login
Now what you want is after user logged in, you can redirect them to
https://www.example.com/#/lobby/abc
Instead of other pages like:
https://www.example.com/#/lobby
So to solve the problem, we need to do two things
1. Store the entry url
2. After logged in, redirect user to entry url
1. Store the entry ur:
angular.module('app')
// When can get pull url by using $location.absUrl()
// Because run block only run once for the module and app module is our main application module, so this should only store our entry url
// To reuse the entryUrl later, we store it in LoginService
.run(($location, LoginService) => LoginService.entryUrl = $location.absUrl())
2. After logged in, then we can redirect user to the entry url by doing:
$location.url(LoginService.entryUrl)
[AngularJS] Store the entry url and redirect to entry url after Logged in的更多相关文章
- django ajax报错解决:You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set.
Django版本号:1.11.15 django中ajax请求报错:You called this URL via POST, but the URL doesn't end in a slash a ...
- SharePoint 2010 Url Shortener --SharePoint 2010 短URL生成器
SharePoint 2010 Url Shortener --SharePoint 2010 短URL生成器 项目描写叙述 本项目加入了这种功能.在SP站点中能够生成短URLs. 这些URLs指向列 ...
- js 获取url中的参数 修改url 参数 移除url参数
js 获取url中的参数 修改url 参数 移除url参数 var jsUrlHelper = { getUrlParam : function(url, ref) { var str = " ...
- Django报错:提交表单报错---RuntimeError: You called this URL via POST, but the URL doesn’t end in a slash and you have APPEND_SLASH set.
Django报错:提交表单报错---RuntimeError: You called this URL via POST, but the URL doesn’t end in a slash and ...
- IDEA报错: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.datasource.url' in value "${spring.datasource.url}"
运行审核流模块: 在ActivitiServiceApplication模块日志报错: Error starting ApplicationContext. To display the auto-c ...
- UrlUtils工具类,Java URL工具类,Java URL链接工具类
UrlUtils工具类,Java URL工具类,Java URL链接工具类 >>>>>>>>>>>>>>>&g ...
- 获取URL的name值 getUrl(url,name) 传入url和key 得到key对应的value
<body> <script type="text/javascript"> var url = "http://192.168.1.82:802 ...
- URL Handle in Swift (一) -- URL 分解
更新时间: 2018-6-6 在程序开发过程之中, 我们总是希望模块化处理某一类相似的事情. 在 ezbuy 开发中, 我接触到了对于 URL 处理的优秀的代码, 学习.改进.记录下来.希望对你有所帮 ...
- 加密解密Url字符串,C#对Url进行处理,传递Url
string _QueryStringKey = "abcdefgh"; //URL传输参数加密Key /// 加密URL传输的字符串 public string E ...
随机推荐
- 读取.properties配置信息
package com.ctcti.webcallcenter.utils; import java.io.FileInputStream;import java.io.FileNotFoundExc ...
- (转)淘淘商城系列——使用maven构建工程时出现的错误
http://blog.csdn.net/yerenyuan_pku/article/details/72690846 我觉得maven就他妈是一个傻逼,反正我是对它无语了.昨天刚刚使用maven构建 ...
- vue-cli中使用rem,vue自适应
2018年04月27日 09:25:34 董小礼 阅读数:4196 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/qq_39588818/ar ...
- 根据截至日期格式获取倒计时&&时间戳转日期格式
//时间戳转日期格式,传入时间戳必须为数字类型function currentDate(shijianchuo) { var date = new Date(shijianchuo); var y = ...
- 第2节 mapreduce深入学习:6、MapReduce当中的计数器
第2节 mapreduce深入学习:6. MapReduce当中的计数器 计数器是收集作业统计信息的有效手段之一,用于质量控制或应用级统计.计数器还可辅助诊断系统故障.如果需要将日志信息传输到map ...
- python selenium定位总结(转)
转自:http://www.cnblogs.com/yufeihlf/p/5717291.html 父子定位元素 查找有父亲元素的标签名为span,它的所有标签名叫input的子元素 find_ele ...
- Visual Studio 2013/2015/2017快捷键(转载)
本文为转载文章,原文:[心存善念] [Fonour] 项目相关的快捷键 Ctrl + Shift + B = 生成项目 Ctrl + Alt + L = 显示 Solution Explorer(解 ...
- Groovy常用语法汇总
基本语法 1.Grovvy的注释分为//和/**/和java的一样. 2.Grovvy语法可以不已分号结尾. 3.单引号,里面的内容严格的对应java中的String,不对$符号进行转义. def s ...
- 零基础入门学习Python(32)--异常处理:你不可能总是对的
知识点 即便Python程序的语法是正确的,在运行它的时候,也有可能发生错误.运行期检测到的错误被称为异常. 大多数的异常都不会被程序处理,都以错误信息的形式展现在这里: Python标准异常总结 序 ...
- Linux终端以及bash
目 录 第1章 Linux系统终端概述 1 1.1 图形化 1 1.2 字符终端 1 1.3 who和w 1 1.3.1 who 1 1.3.2 w 1 1.3.3 ...