Browse Source

更新角色权限编辑方法;添加未注册人员时增加去空格检验

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@10201 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 8 years ago
parent
commit
e3f66272d7

+ 18 - 8
pom.xml

@@ -29,10 +29,10 @@
 				<!-- static plugin -->
 				<static-path>static</static-path>
 			</properties>
-				<!-- 默认 -->
+			<!-- 默认 -->
 			<activation>
 				<activeByDefault>true</activeByDefault>
-			</activation>		
+			</activation>
 		</profile>
 		<profile>
 			<!-- 生产环境 -->
@@ -42,7 +42,7 @@
 				<!-- static plugin -->
 				<static-path>http://static.ubtob.com</static-path>
 			</properties>
-		
+			
 		</profile>
 	</profiles>
 	<dependencies>
@@ -335,7 +335,7 @@
 		</resources>
 		<!-- 在maven生命周期validate阶段生成timestamp -->
 		<plugins>
-			<plugin>
+			<!--<plugin>
 				<groupId>org.codehaus.mojo</groupId>
 				<artifactId>buildnumber-maven-plugin</artifactId>
 				<version>1.3</version>
@@ -368,7 +368,7 @@
 				<groupId>com.samaxes.maven</groupId>
 				<artifactId>minify-maven-plugin</artifactId>
 				<version>1.7.4</version>
-				<!-- 静态文件压缩 -->
+				&lt;!&ndash; 静态文件压缩 &ndash;&gt;
 				<executions>
 					<execution>
 						<id>default-minify</id>
@@ -429,7 +429,7 @@
 				<groupId>com.uas.plugins</groupId>
 				<artifactId>static-maven-plugin</artifactId>
 				<version>0.0.2-SNAPSHOT</version>
-				<!-- 静态资源分离 -->
+				&lt;!&ndash; 静态资源分离 &ndash;&gt;
 				<executions>
 					<execution>
 						<id>default-static</id>
@@ -473,9 +473,19 @@
 						</resource>
 					</webResources>
 				</configuration>
+			</plugin>-->
+			<plugin>
+				<groupId>org.apache.tomcat.maven</groupId>
+				<artifactId>tomcat7-maven-plugin</artifactId>
+				<version>2.2</version>
+				<configuration>
+					<port>8090</port>
+					<path>/platform-b2b</path>
+					<uriEncoding>utf-8</uriEncoding>
+				</configuration>
 			</plugin>
 		</plugins>
-		<pluginManagement>
+		<!--<pluginManagement>
 			<plugins>
 				<plugin>
 					<groupId>org.eclipse.m2e</groupId>
@@ -510,7 +520,7 @@
 					</configuration>
 				</plugin>
 			</plugins>
-		</pluginManagement>
+		</pluginManagement>-->
 	</build>
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

+ 4 - 2
src/main/java/com/uas/platform/b2b/controller/UserController.java

@@ -85,7 +85,8 @@ public class UserController {
 		} else {
 			HttpHeaders headers = new HttpHeaders();
 			headers.add("Content-Type", "application/text; charset=utf-8");
-			return new ResponseEntity<Boolean>(userService.isTelUseable(tel), headers, HttpStatus.OK);
+			return new ResponseEntity<Boolean>(userService.isTelUseable(tel.replaceAll("\\s*", "")), headers,
+					HttpStatus.OK);
 		}
 	}
 
@@ -102,7 +103,8 @@ public class UserController {
 		} else {
 			HttpHeaders headers = new HttpHeaders();
 			headers.add("Content-Type", "application/text; charset=utf-8");
-			return new ResponseEntity<Boolean>(userService.isEmailUseable(email), headers, HttpStatus.OK);
+			return new ResponseEntity<Boolean>(userService.isEmailUseable(email.replaceAll("\\s*", "")), headers,
+					HttpStatus.OK);
 		}
 	}
 

+ 15 - 1
src/main/webapp/resources/js/index/app.js

@@ -9057,7 +9057,21 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		$scope.select = function(role) {
 			role.$checked = !role.$checked;
 			if(role.$checked) {
-				$scope.checked.push(role);
+				if(role.desc === '管理员') {
+					$scope.checked = [];
+					angular.forEach($scope.roles, function(r){
+						if(r.desc != '管理员') {
+							r.$checked = false;
+						}
+					});
+					$scope.checked.push(role);
+				} else {
+					angular.forEach($scope.roles, function(r){
+						if(r.desc === '管理员') {
+							r.$checked = false;
+						}
+					});
+				}
 			} else {
 				angular.forEach($scope.checked, function(c, i){
 					if(c.id == role.id)

+ 1 - 1
src/main/webapp/resources/tpl/index/approvalFlow/user_role.html

@@ -23,9 +23,9 @@
 <div class="modal-body">
 	<div class="userrole-list">
 		<div class="item" ng-repeat="role in roles track by role.id" ng-click="select(role)" ng-class="{'checked': role.$checked}">
+			<h5 class="text-center" ng-bind="role.desc"></h5>
 			<div class="icon"> <i class="fa fa-user"
 				ng-class="{'fa-user-md': role.name=='ROLE_ADMIN','fa-male': role.name=='ROLE_SALE','fa-street-view': role.name=='ROLE_USER'}"></i>
-				<h5 ng-bind="role.desc"></h5>
 			</div>
 			<div class="desc">
 				<div class="text-muted" ng-bind="role.duty"></div>