这已经在几个不同的问题中得到了解决,并且在一些不同的教程中,但我遇到的所有以前的资源并没有完全触及.
http://client.foo到http://api.foo/loginlogout路由的用户提供"登录"GUI /组件状态api.foo/status确定用户是否已登录.(ATM我正在使用Express进行路由)这会导致打嗝,因为Angular会确定ng-show="user.is_authenticated"{{user.first_name}},或者在注销的情况下,清空该值.// Sample response from `/status` if successful
{
customer: {...},
is_authenticated: true,
authentication_timeout: 1376959033,
...
}
Run Code Online (Sandbox Code Playgroud)
POST使用post data而不是query params.文件在这件事上没有任何结果.withCredentials:true,因此不是问题不可否认,我是Angular的新手,如果我以荒谬的方式接近它,也不会感到惊讶; 如果有人建议替代方案,我会很激动 - 即使它是汤到坚果.
我的使用Express主要是因为我真的很喜欢- 我Jade并Stylus …
javascript restful-authentication node.js angularjs angular-http-interceptors
public class Portfolio extends Thread {
private volatile Thread stopMe= Thread.currentThread();
public Portfolio(String name) {
super(name);
// TODO Auto-generated constructor stub
}
public void stopMe(){
stopMe= null;
}
@Override
public void run() {
while(stopMe== Thread.currentThread()){
try {
for(int i=0; i<10; i++){
//sleep(700);
System.out.println("You have " +(500+i)+ " shares of IBM");
}
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println(Thread.currentThread().getName()+e.toString());
}}
}
}
Run Code Online (Sandbox Code Playgroud)
public class TestThreads {
/**
* @param args
*/
public static void main(String[] …Run Code Online (Sandbox Code Playgroud)