angularjs如何取到后台存储的session

package com.cmsz.itbrs.infoserver.controller;




import java.util.HashMap;

import java.util.Map;


import javax.servlet.http.HttpSession;


import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.RequestBody;

import org.springframework.web.bind.annotation.RequestMapping;



import org.springframework.web.bind.annotation.RequestMethod;

import org.springframework.web.bind.annotation.RestController;


import com.cmsz.itbrs.infoserver.service.LoginService;

import com.cmsz.vo.UserInfoVo;


@RestController

public class LoginController {

@Autowired

LoginService loginservice;

@RequestMapping(value="denglu",method=RequestMethod.POST)

public Map<String, Object> Login(@RequestBody UserInfoVo user,

HttpSession session){

Map<String,Object> result=new HashMap<String, Object>();

UserInfoVo userinfovo=loginservice.dl(user);

if(userinfovo!=null){

session.setAttribute("yhm", userinfovo.getLoginUser());

session.setMaxInactiveInterval(30);

result.put("result", "success");

}else{

result.put("result", "shibai");

}

return result;


}

}


慕粉2301164623
浏览 9732回答 2
2回答

慕瓜9220888

OFKTLURAKGGVXSMYSLFGVFNNJMGZFKMOKXKTGODIQNJPHMUZUMFXDDBSUTUXHKTEVNIERKDGWNVXWFIINIPRJWPCFFXRTYKQGNZIFRQLIKRAXBACUTLYBAHYJTTWZIMNSRAJFFCIJOQFYBERHYNCDXFBUMQNQTNYGHTYEEXESECKJPTOFWTTJYACSEUXALTPBXUNTZIDYXMGJWECFKMPBHBEMXPRKWBBXTENIEXHQNCXQBPPORUSWSAGCYLVQLXFHRUQWDNNJLWJPUBXWLPZTZTSBHXKXEKHBTYUTDYYYMYYHZWTCPBINEZJJPSNYDYDAMJFMJLNSVEBJVMHZVLWCWRJBGRREUQINQPBISWLABNDIRUFPUVNWBNRXQUVRCOHBUDLOJPZLBIRDYGSXQQTVEFKCEXKNXUURJBBHAKVZEQSIEHKVMBZBENKSOTBQBLGWSAVNSKXXZJZDSDCMPZCFQYALVYCCDGLGFCVERVGLYNRXATAVKJUOUMPTUTASEUHKGHZLJJWZJQHJBUNKTFRKZHTWFZSMXWLDWFPLU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KUGG

落叶1111

用相应的服务模块

李晓健

session  是java 里的,js是取不到的。  不过你可以在java端开一个接口,js通过ajax去请求获取。
打开App,查看更多内容
随时随地看视频慕课网APP