qzyReal 3 سال پیش
والد
کامیت
52131dfe32
3فایلهای تغییر یافته به همراه36 افزوده شده و 19 حذف شده
  1. 3 0
      app/apis/api.js
  2. 32 19
      app/pages/index/index.vue
  3. 1 0
      app/pages/login/login.vue

+ 3 - 0
app/apis/api.js

@@ -47,5 +47,8 @@ export default {
     },
 	deleteHsPeople(data){
 		  return ajax.postForm('/TbBusinessPeople/deleteById', data)
+	},
+	getCurrentPerCode(){
+		return ajax.get('/SpRolePermission/getPcodeByCurrRid')
 	}
 }

+ 32 - 19
app/pages/index/index.vue

@@ -41,9 +41,9 @@
 	export default {
 		data() {
 			return {
-				isLogin:false,//是否登录状态
-				userName:'张三',
-				companyName:'爱你一万年有限公司',
+				isLogin: false, //是否登录状态
+				userName: '张三',
+				companyName: '爱你一万年有限公司',
 				qrcoderlc: 'https://shiyupeng.com/data/img/ewm.png',
 				indexItemList: [{
 						auth: false,
@@ -79,18 +79,21 @@
 			}
 		},
 		onLoad() {
-
+			this.getStoreInfo();
 		},
 		methods: {
+			getStoreInfo() {
+				let token = uni.getStorageSync('info');
+				
+			},
 			navTo(item) {
 				let auth = item.auth;
 				let token = uni.getStorageSync('token');
-				this.$common.to(item.url)
-				// if (!auth||token) {
-				// 	this.$common.to(item.url)
-				// } else {
-				// 	this.$common.to('/pages/login/login')
-				// }
+				if (!auth||token) {
+					this.$common.to(item.url)
+				} else {
+					this.$common.to('/pages/login/login')
+				}
 			}
 		}
 	}
@@ -100,7 +103,8 @@
 	page {
 		background-color: #fff;
 	}
-	.top-nav{
+
+	.top-nav {
 		position: fixed;
 		top: 0;
 		left: 0;
@@ -111,10 +115,12 @@
 		justify-content: space-between;
 		padding: 20rpx 0;
 		background-color: #0080ff;
-		.l{
+
+		.l {
 			display: flex;
 			align-items: center;
-			.login-btn{
+
+			.login-btn {
 				border: 1rpx solid #359aff;
 				border-radius: 8rpx;
 				color: #fff;
@@ -122,31 +128,37 @@
 				font-size: 28rpx;
 				margin-left: 30rpx;
 			}
-			.user-img{
+
+			.user-img {
 				width: 80rpx;
 				height: 80rpx;
 				border-radius: 50%;
 				margin-left: 30rpx;
 				margin: 20rpx;
 			}
-			.l-r{
+
+			.l-r {
 				display: flex;
 				flex-direction: column;
-				.u-name{
+
+				.u-name {
 					font-size: 30rpx;
 					color: #fff;
 					font-weight: bold;
 				}
-				.c-name{
+
+				.c-name {
 					font-size: 24rpx;
 					color: #fff;
 				}
 			}
 		}
-		.r{
+
+		.r {
 			display: flex;
 			align-items: center;
-			.l-out{
+
+			.l-out {
 				border: 1rpx solid #359aff;
 				border-radius: 8rpx;
 				color: #c8e4ff;
@@ -156,6 +168,7 @@
 			}
 		}
 	}
+
 	.top-bg {
 		position: relative;
 		top: 0;

+ 1 - 0
app/pages/login/login.vue

@@ -53,6 +53,7 @@
 					if(data.tokenInfo){
 						uni.setStorageSync('token',data.tokenInfo.tokenValue);
 						uni.setStorageSync('customerId',data.admin.customerId)
+						uni.setStorageSync('info',data.admin)
 						this.$common.to('/pages/index/index')
 					}else{
 						this.$common.toast('登录失败');