liwei2496 1 年之前
父節點
當前提交
b606ad6fce
共有 2 個文件被更改,包括 51 次插入35 次删除
  1. 3 4
      pages/index/Workordertodone/Workorderdetails/Workorderdetails.vue
  2. 48 31
      pages/login/login.vue

+ 3 - 4
pages/index/Workordertodone/Workorderdetails/Workorderdetails.vue

@@ -202,11 +202,10 @@
 		},
 		methods: {
 			getUserList() {
-				this.$api.get('/user/list',{ page: 1,
-					limit: 100,})
+				this.$api.get('/user/list',{ page: 1,limit: 100,})
 						.then(res=>{
-						//	console.log('111111111111111111',res.data.data)
-this.columnsrenyuan=[res.data.data]
+						
+               this.columnsrenyuan=[res.data.data]
 						})
 			},
 			getdata(){

+ 48 - 31
pages/login/login.vue

@@ -57,44 +57,54 @@
 		},
 		methods: {
 			loginbtn() {
-				if (this.account == "") {
+				
+				if(this.isChecked==false){
 					this.$refs.uToast.show({
 						type: "error",
-						message: "请输入账号",
+						message: "请同意用户协议和隐私政策",
 					});
-				} else if (this.password == "") {
-					this.$refs.uToast.show({
-						type: "error",
-						message: "请输入密码",
-					});
-				}
-
-				let formData = {
-					username: this.account,
-					password: this.password,
-				};
-				//登录功能
-				this.$api.post("/login", formData).then((res) => {
-					if (res.data.code == 0) {
-						uni.setStorageSync("tokendata", res.data.data.token); //token
-						uni.setStorageSync("Userinformation", formData); //用户信息
-						//获取用户的信息,如组织架构,个人信息,权限等
-						Promise.all([
-							this.getpermissions(),
-							this.getDictList(),
-							this.getuserInfo(),
-						]).then(() => {
-							uni.navigateTo({
-								url: "/pages/index/index",
-							});
+				}else{
+					if (this.account == "") {
+						this.$refs.uToast.show({
+							type: "error",
+							message: "请输入账号",
 						});
-					} else {
+						return false
+					} else if (this.password == "") {
 						this.$refs.uToast.show({
 							type: "error",
-							message: "账号或者密码错误,重新输入",
+							message: "请输入密码",
 						});
+							return false
 					}
-				});
+					
+					let formData = {
+						username: this.account,
+						password: this.password,
+					};
+					//登录功能
+					this.$api.post("/login", formData).then((res) => {
+						if (res.data.code == 0) {
+							uni.setStorageSync("tokendata", res.data.data.token); //token
+							uni.setStorageSync("Userinformation", formData); //用户信息
+							//获取用户的信息,如组织架构,个人信息,权限等
+							Promise.all([
+								this.getpermissions(),
+								this.getDictList(),
+								this.getuserInfo(),
+							]).then(() => {
+								uni.navigateTo({
+									url: "/pages/index/index",
+								});
+							});
+						} else {
+							this.$refs.uToast.show({
+								type: "error",
+								message: "账号或者密码错误,请重新输入",
+							});
+						}
+					});
+				}									
 			},
 			getpermissions() {
 				console.log("权限功能");
@@ -178,6 +188,13 @@
 </script>
 
 <style lang="scss">
+	.Userprotocol{
+		margin-top: 100rpx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+	
 	.form-box {
 		width: 91%;
 		background: #fff;
@@ -213,7 +230,7 @@
 		}
 
 		.login-btn {
-			margin-top: 50px;
+			margin-top: 20px;
 			font-size: 16px;
 			letter-spacing: 7px;
 			color: #ffffff;