Browse Source

feat:用户id变更为token

zhanghui 5 months ago
parent
commit
f3bd1e74dc

+ 2 - 2
common/js/env.js

@@ -1,5 +1,5 @@
-let baseUrl = `http://admin.yaojiuapp.com/api`
-// let baseUrl = `http://192.168.1.70:8801`
+// let baseUrl = `http://admin.yaojiuapp.com/api`
+let baseUrl = `http://192.168.1.70:8801`
 
 // 变量可自行添加修改
 export default { //存放变量的容器

+ 4 - 4
pages.json

@@ -8,7 +8,8 @@
 		{
 			"path": "pages/index/index",
 			"style": {
-				"navigationBarTitleText": "uni-app",
+				"navigationBarTitleText": "注册",
+				"enablePullDownRefresh" : false,
 				"navigationStyle": "custom"
 			}
 		},
@@ -16,7 +17,7 @@
 			"path" : "pages/zhuanpan/zhuanpan",
 			"style" :
 			{
-				"navigationBarTitleText" : "",
+				"navigationBarTitleText" : "幸运大转盘",
 				"enablePullDownRefresh" : false,
 				"navigationStyle": "custom"
 			}
@@ -41,9 +42,8 @@
 		}
 	],
 	"globalStyle": {
-
 		"navigationBarTextStyle": "black",
-		"navigationBarTitleText": "uni-app",
+		"navigationBarTitleText": "加载中...",
 		"navigationBarBackgroundColor": "#fa7b12",
 		"backgroundColor": "#fa7b12"
 	},

+ 7 - 7
pages/lotteryRecord/lotteryRecord.vue

@@ -5,7 +5,7 @@
 			<view class="flex-row justify-center">
 				<image  :src="'/static/img/1712668343314.jpg'" mode="widthFix" class="titlePhoto"></image>
 			</view>
-			<mescroll-item ref="MescrollItem" :i="0" :userId="userId" :height="windowHeight * 0.95 - 60 +'px'" v-if="userId">
+			<mescroll-item ref="MescrollItem" :i="0"  :height="windowHeight * 0.95 - 60 +'px'" >
 			</mescroll-item>
 		</view>
 	</view>
@@ -24,12 +24,12 @@
 			}
 		},
 		onLoad(e){
-			console.log(e)
-			console.log(e.userId)
-			if (e.userId){
-				this.userId = e.userId
-				console.log('获取到的userId',this.userId)
-			}
+			// console.log(e)
+			// console.log(e.userId)
+			// if (e.userId){
+			// 	this.userId = e.userId
+			// 	console.log('获取到的userId',this.userId)
+			// }
 			let sysinfo = uni.getSystemInfoSync()
 			this.windowHeight = sysinfo.windowHeight
 		},

+ 7 - 7
pages/lotteryRecord/module/mescrollUni-item.vue

@@ -61,12 +61,12 @@
 				}
 			},
 
-			userId: {
-				type: String,
-				default () {
-					return ''
-				}
-			},
+			// userId: {
+			// 	type: String,
+			// 	default () {
+			// 		return ''
+			// 	}
+			// },
 
 			tabs: { // 为了请求数据,演示用,可根据自己的项目判断是否要传
 				type: Array,
@@ -107,7 +107,7 @@
 				let httpData = {
 					current: page.num,
 					size: 30,
-					userId:this.userId
+					flag:true
 				}
 				this.$api.service.winningRecord(httpData).then((res) => {
 					//联网成功的回调,隐藏下拉刷新和上拉加载的状态;

+ 7 - 4
pages/zhuanpan/zhuanpan.vue

@@ -87,9 +87,11 @@
 			this.getScrollHeight();
 		},
 		onLoad(e){
-			if (e.userId){
-				this.userId = e.userId
-				console.log('获取到的userId',this.userId)
+			if (e.token){
+				uni.setStorageSync('accessToken', e.token);
+				console.log('获取到的token', e.token)
+			}else {
+				uni.setStorageSync('accessToken', null);
 			}
 			this.prizeList()
 			this.winningRecord()
@@ -122,6 +124,7 @@
 				this.$api.service.winningRecord({
 					current: 1,
 					size: 50,
+					flag:false
 				}).then(res=>{
 					this.winningRecordList = res.data.data
 				})
@@ -159,7 +162,7 @@
 
 			goRecord(){
 				uni.navigateTo({
-					url:'/pages/lotteryRecord/lotteryRecord?userId=' + this.userId
+					url:'/pages/lotteryRecord/lotteryRecord'
 				})
 			},
 			goRule(){