Просмотр исходного кода

Merge remote-tracking branch 'origin/dev-mysql' into dev-mysql

wangyc 8 лет назад
Родитель
Сommit
be4fac4913

+ 4 - 1
src/main/java/com/uas/platform/b2c/common/account/controller/SecurityController.java

@@ -201,7 +201,7 @@ public class SecurityController {
 	 */
 	@RequestMapping(value = "/login/other")
 	@ResponseBody
-	public String afterCrossLogin(HttpServletRequest request, HttpServletResponse response, UserView userView) {
+	public String afterCrossLogin(HttpServletRequest request, HttpServletResponse response, UserView userView, Integer maxage) {
 		String callback =request.getParameter("jsoncallback");
 		response.setContentType("text/html;charset=UTF-8");
 		if (userView != null && userView.getUid() != null) {
@@ -209,6 +209,9 @@ public class SecurityController {
 				tk.setUid(userView.getUid());
 				tk.setTime(System.currentTimeMillis());
 				tk.setData(JSON.toJSONString(userView));
+				if (null != maxage) {
+					request.setAttribute("sso_cookie_maxage", maxage);
+				}
 				SSOHelper.setSSOCookie(request, response, tk, true);
 				User user = getUserByToken(tk);
 				if (user != null) {

+ 8 - 2
src/main/webapp/resources/js/common/controllers/commonCtrls.js

@@ -89,11 +89,17 @@ define([ 'app/app' ], function(app) {
 				$scope.switching = !$scope.switching;
 			};
 
+
+            // 企业换企业开关
+            $scope.toggleSwitchFalse = function () {
+                $scope.switching = false;
+            };
+
 			// 切换企业
 			$scope.switchto = function(en) {
-				AuthenticationService.reSignin(en.enUU).success(function(){
+				AuthenticationService.reSignin(en.uu).success(function(){
 					//$window.location.reload();
-					if (!en.enUU || en.enUU == '0'){
+					if (!en.uu || en.uu == '0'){
 						if (window.location.href.contains('vendor')){
                             location.href = './register-saler';
                             return;

+ 2 - 2
src/main/webapp/resources/view/common/site-nav.html

@@ -139,7 +139,7 @@
         <li ng-if="!userInfo"><a ng-click="signinModal()" href="javascript:void(0)">登录</a></li>
         <li ng-if="!userInfo"><a ng-click="registerModal()" href="javascript:void(0)">注册</a></li>
         <!--<li ng-if="!userInfo"><a href="http://account.ubtob.com/sso/register?returnURL=http%253A%252F%252Fwww.usoftmall.com%252Flogin%252Fproxy&appId=mall">注册</a></li>-->
-        <li ng-if="userInfo" class="dropdown">
+        <li ng-if="userInfo" class="dropdown" ng-mouseleave="toggleSwitchFalse()">
             <a class="dropdown-toggle" href="javascript:void(0)">欢迎您,
                 <span ng-bind="userInfo.userName"></span>
                 <span> | </span>
@@ -175,7 +175,7 @@
         <li><a href=".">商城首页</a></li>
         <li ng-if="userInfo"><a href="user#/home">买家中心</a></li>
         <li ng-if="userInfo.enterprise && userInfo.enterprise.isVendor == 313"><a href="vendor">卖家中心</a></li>
-        <li ng-if="!userInfo.enterprise || userInfo.enterprise.isVendor != 313"><a href="./register-saler">卖家中心</a></li>
+        <li ng-if="userInfo && (!userInfo.enterprise || userInfo.enterprise.isVendor != 313)" ><a href="./register-saler">卖家中心</a></li>
         <li><a href="help/home" target="_blank">帮助中心</a></li>
         <!-- <li><a href="http://wpa.qq.com/msgrd?v=3&uin=3432892085&site=www.ubtoc.com&menu=yes" target="_blank">在线客服</a></li> -->
        <!-- <li><a href="javascript:void(0)">服务电话:400-830-1818</a></li>-->