Browse Source

Merge branch 'dev-mysql' into liusw-account-v1.0.10.19

# Conflicts:
#	src/main/webapp/resources/view/usercenter/forstore/home_center.html
#	src/main/webapp/resources/view/vendor/forstore/vendor_index.html
529010777@qq.com 8 years ago
parent
commit
a7f0c2857d

+ 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 - 1
src/main/java/com/uas/platform/b2c/prod/product/brand/controller/BrandSubmitController.java

@@ -8,12 +8,14 @@ import com.uas.platform.b2c.external.erp.product.service.OperationInfoService;
 import com.uas.platform.b2c.prod.product.brand.modal.Brand;
 import com.uas.platform.b2c.prod.product.brand.modal.BrandSubmit;
 import com.uas.platform.b2c.prod.product.brand.service.BrandSubmitService;
+import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.PageParams;
 import com.uas.platform.core.model.ServiceCode;
 import com.uas.platform.core.model.Status;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.dao.DataIntegrityViolationException;
 import org.springframework.data.domain.Page;
 import org.springframework.web.bind.annotation.*;
 
@@ -170,6 +172,11 @@ public class BrandSubmitController {
 	public Brand audituUpdate(@RequestBody String json) {
 		BrandSubmit brandSubmit = FastjsonUtils.fromJson(json, BrandSubmit.class);
 		logger.log("品牌维护", "审核通过冲突品牌申请", "审核通过与现版本信息冲突的品牌申请", brandSubmit.getNameCn(), brandSubmit.getId());
-		return brandSubmitService.audituUpdate(brandSubmit);
+		try {
+			Brand brand = brandSubmitService.audituUpdate(brandSubmit);
+			return brand;
+		} catch (DataIntegrityViolationException e) {
+			throw new IllegalOperatorException("品牌已存在,请重新确认品牌信息");
+		}
 	}
 }

+ 1 - 1
src/main/resources/prod/account.properties

@@ -11,7 +11,7 @@ sso.cookie.secure=true
 sso.cookie.httponly=true
 sso.login.url=https://account.ubtob.com/sso/login
 sso.logout.url=https://account.ubtob.com/sso/logout
-sso.register.url=http://account.ubtob.com/sso/register_p
+sso.register.url=http://account.ubtob.com/sso/register
 
 #cross domain
 sso.ask.url=https://account.ubtob.com/sso/login/ask

+ 16 - 3
src/main/webapp/resources/js/common/controllers/commonCtrls.js

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

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

@@ -139,25 +139,29 @@
         <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 href="javascript:void(0)" ng-click="logout()" class="logout">[退出]</span>
+                <span> | </span>
+
+                <span style="float:right;margin-left: 15px" href="javascript:void(0)" ng-click="logout()" class="logout">[退出]</span>
+                <span style="float:right;margin-left: 8px;max-width: 190px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;display: inline-block;" ng-if="userInfo.enterprise" ng-bind="userInfo.enterprise.enName" ></span>
+                <span style="float:right;margin-left: 8px;max-width: 190px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;display: inline-block;" ng-if="!userInfo.enterprise" ng-bind="'个人账户'" ></span>
             </a>
-            <div class="dropdown-menu" style="top: 36px; left: 0; min-width: 220px;">
+            <div class="dropdown-menu" style="top: 36px; left: 0; min-width: 220px; width: 100%">
                <!-- <p>欢迎您,<span ng-bind="userInfo.userName"></span>
                     <a href="javascript:void(0)" class="pull-right" ng-click="logout()">退出</a>
                 </p>-->
                 <p>
                     <!--<i class="fa fa-map-marker"></i> <span ng-if="userInfo.enterprises" ng-bind="userInfo.enterprise.enName"></span><span ng-if="!userInfo.enterprises" ng-bind="userInfo.userName"></span><span ng-if="!userInfo.enterprises">(个人账户)</span>-->
-                    <i class="fa fa-map-marker"></i>
+                    <i class="fa fa-map-marker" style="position: relative;bottom: 2px;"></i>
                     <span ng-if="userInfo.enterprise" ng-bind="userInfo.enterprise.enName" class="member-text"></span>
-                    <span ng-if="!userInfo.enterprise" ng-bind="userInfo.userName + '(个人账户)'" class="member-text"></span>
+                    <span ng-if="!userInfo.enterprise" ng-bind="' 个人账户'" class="member-text"></span>
                     <a href="javascript:void(0)" class="pull-right" ng-if="userInfo.enterprises" ng-click="toggleSwitch()" ng-bind="switching?'取消':'切换'">切换</a>
                 </p>
                 <ul class="unstyled" ng-show="switching" style="-webkit-padding-start: 0;">
                     <li ng-repeat="en in userInfo.enterprises" ng-if="!en.current && userInfo.enterprises" style="line-height: 30px;">
-                        <a href="javascript:void(0)"  ng-bind="en.enName" title="{{en.enName}}" ng-click="switchto(en.uu)"></a>
+                        <a href="javascript:void(0)"  ng-bind="en.enName" title="{{en.enName}}" ng-click="switchto(en)"></a>
                     </li>
                     <!--<li ng-if="!userInfo.enterprises">
                         <a href="javascript:void(0)"><span ng-bind="userInfo.userName"></span><span>(个人账户)</span></a>
@@ -171,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>-->

+ 3 - 2
src/main/webapp/resources/view/usercenter/forstore/home_center.html

@@ -18,8 +18,9 @@
                 <dl>
                     <dt><img src="static/img/user/images/user_photo.png" /></dt>
                     <dd>
-                       <span ng-cloak>{{userInfo.userName}}<br/> <!--<em>账户余额:¥68899.99</em>--></span>
-                        <a href="#/accountManager/" ui-sref="account_manager">账户设置&nbsp;》</a>
+                       <span ng-cloak>{{userInfo.userName}} | <br/> <!--<em>账户余额:¥68899.99</em>--></span>
+                        <span ng-cloak ng-bind="userInfo.enterprise.enName || '个人账户'"><br/> <!--<em>账户余额:¥68899.99</em>--></span>
+                        <a href="user#/accountManager">账户设置&nbsp;》</a>
                     </dd>
                 </dl>
             </div>

+ 3 - 2
src/main/webapp/resources/view/vendor/forstore/vendor_index.html

@@ -19,8 +19,9 @@
             <dl>
                 <dt><img src="static/img/vendor/images/user_photo.png" /></dt>
                 <dd>
-                    <span>{{vendor.enName}}<br/><!--<em>账户余额:¥68899.99</em>--></span>
-                    <a ui-sref="vendor_account_management">账户设置&nbsp;》</a>
+                    <span>{{userInfo.userName}}  | <br/><!--<em>账户余额:¥68899.99</em>--></span>
+                    <span ng-bind="vendor.enName || '个人账户'"><br/> <!--<em>账户余额:¥68899.99</em>--></span>
+                    <a href="vendor#/account/management">账户设置&nbsp;》</a>
                     <!--<p><img src="static/img/vendor/images/sell_grade.png"/>专有服务:******</p>-->
                 </dd>
             </dl>