Browse Source

修改权限

wangchao 3 years ago
parent
commit
ed3e72922c

+ 19 - 14
common/helper.js

@@ -12,21 +12,26 @@ const isArray = Array.isArray || function(obj) {
 const getListByUserId = function() {
 	let baseUrlNew = config.def().baseUrlNew
 	var userInfo = uni.getStorageSync("userInfo")
-	uni.request({
-		url: baseUrlNew + '/roleMenu/query/getListByUserId',
-		data: {
-			userId: userInfo.id
-		},
-		method: 'GET',
-		success: (res) => {
-			if (res.statusCode === 200) {
-				uni.setStorageSync("jurisdiction", res.data.data)
-				let list = getUserAllRoles(res.data.data);
-				uni.setStorageSync("rolesList", list)
-
+	
+	console.log("------",userInfo)
+	if(userInfo){
+		uni.request({
+			url: baseUrlNew + '/roleMenu/query/getListByUserId',
+			data: {
+				userId: userInfo.id?userInfo.id:userInfo.data.id
+			},
+			method: 'GET',
+			success: (res) => {
+				if (res.statusCode === 200) {
+					uni.setStorageSync("jurisdiction", res.data.data)
+					let list = getUserAllRoles(res.data.data);
+					uni.setStorageSync("rolesList", list)
+		
+				}
 			}
-		}
-	})
+		})
+	}
+
 }
 const getUserAllRoles = (item) => {
 	console.log(item)

+ 4 - 4
pages/erpbusiness/customer.vue

@@ -189,7 +189,7 @@
 				}
 
 			},
-			registeredCustomerClick(item){debugger
+			registeredCustomerClick(item){
 			
 			uni.setStorageSync('checkcustomer', item)
 				if (this.recentCustomers.length == 0) {
@@ -349,20 +349,20 @@
 				// 	}
 				// }
 			},
-			emptysearch() {debugger
+			emptysearch() {
 				this.show = false
 				this.searchKeyWord = ''
 				this.gridList = []
 				this.currentPage = 1
 				this.getList()
 			},
-			doSearch() {debugger
+			doSearch() {
 				this.show = true
 				this.gridList = []
 				this.currentPage = 1
 				this.getList()
 			},
-			getList() {debugger
+			getList() {
 				var that = this
 				var url = ''
 				var data = {}

+ 2 - 2
pages/erpbusiness/index.vue

@@ -14,9 +14,9 @@
 			<!-- 检斤员权限 -->
 			<!-- isShowAcquisitionInfo -->
 			<!-- 获取当前用户负责的仓库,如果无仓库隐藏收购信息 -->
-			<view class="content2">
+			<view class="content2" v-if="isShowAcquisitionInfo&&sgId">
 				<view>收购信息</view>
-				<view v-if="isShowAcquisitionInfo&&sgId" @click="navTo('/pages/erpbusiness/acquisitionInformation?status='+status+'&id='+sgId)">{{status}}></view>
+				<view @click="navTo('/pages/erpbusiness/acquisitionInformation?status='+status+'&id='+sgId)">{{status}}></view>
 			</view>
 		</view>
 		<!-- <view class="wrap">

+ 1 - 1
pages/public/code.vue

@@ -179,7 +179,7 @@
 									helper.getListByUserId()
 								}
 								else{
-									that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '13333333333',
+									that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '14444444444',
 									veriCode: "123456",}).then(res2 => {
 										uni.setStorageSync('pcUserInfo', res2.data.data)
 										helper.getListByUserId()

+ 1 - 1
pages/public/login_account_number.vue

@@ -120,7 +120,7 @@
 								helper.getListByUserId()
 							}
 							else{
-								that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '13333333333',
+								that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '14444444444',
 								veriCode: "123456",}).then(res2 => {
 									uni.setStorageSync('pcUserInfo', res2.data.data)
 									helper.getListByUserId()

File diff suppressed because it is too large
+ 543 - 425
pages/public/register.vue


+ 3 - 3
pages/user/user.vue

@@ -305,8 +305,8 @@
 				} else {
 					this.headUrl = this.userInfo.avatarUrl
 				}
-				this.username = this.userInfo.userName
-				this.userphone = this.userInfo.phone
+				this.username = this.userInfo.userName?this.userInfo.userName:uni.getStorageSync("userInfo").data.userName
+								this.userphone = this.userInfo.phone?this.userInfo.phone:uni.getStorageSync("userInfo").data.phone
 				var that = this
 				this.$api.doRequest('get', '/notice/query/noticeNumber').then(res => {
 					console.log("noticeNumber", res)
@@ -385,7 +385,7 @@
 						that.$api.msg('切换成功')
 					} else {
 						that.$api.doRequest('post', '/commonUser/api/loginQuickly', {
-							mobilePhone: '13333333333',
+							mobilePhone: '14444444444',
 							companyName: this.companyList[e[0]].compName,
 							veriCode: "123456",
 						}).then(res2 => {

Some files were not shown because too many files changed in this diff