Sfoglia il codice sorgente

自贡随手拍积分

zhaojiaqi 1 giorno fa
parent
commit
5d5fb411a4
3 ha cambiato i file con 53 aggiunte e 10 eliminazioni
  1. 33 7
      common/admin.js
  2. 12 0
      pages.json
  3. 8 3
      pagesPointsBase/Points/Index.vue

+ 33 - 7
common/admin.js

@@ -4,15 +4,15 @@ const utils = require('../common/util.js');
 //服务接口访问配置
 var config = {
 	// sysweburl: "http://110.188.24.28:50300", // 开发
-	sysweburl: "http://110.188.24.28:50200", // 测试
+	// sysweburl: "http://110.188.24.28:50200", // 测试
 	// sysweburl: "http://171.94.154.2:50105/hl", // 正式
-	// sysweburl: "https://new.zg12345.cn/hl", // 正式
-	upfileurl: "http://110.188.24.28:50120/file/upload", // 测试
+	sysweburl: "https://new.zg12345.cn/hl", // 正式
+	// upfileurl: "http://110.188.24.28:50120/file/upload", // 测试
 	// upfileurl: "http://171.94.154.2:50105/hlfs/file/upload", // 正式
-	// upfileurl: "https://new.zg12345.cn/hlfs/file/upload", // 正式
-	getfileurl: "http://110.188.24.28:50120", // 测试
+	upfileurl: "https://new.zg12345.cn/hlfs/file/upload", // 正式
+	// getfileurl: "http://110.188.24.28:50120", // 测试
 	// getfileurl: "http://171.94.154.2:50105/hlfs", // 正式
-	// getfileurl: "https://new.zg12345.cn/hlfs", // 正式
+	getfileurl: "https://new.zg12345.cn/hlfs", // 正式
 }
 
 // 服务器返回字段
@@ -26,6 +26,7 @@ var response = { //自定义响应字段
 var statusCode = {
 	ok: 200, //数据状态一切正常的状态码
 	logout: 401, //登录状态失效的状态码
+	tokenErr: 403, // openID错误,后端生成不了token的状态码
 }
 
 //录音对象
@@ -57,6 +58,29 @@ const logErrTip = () => {
 	})
 }
 
+// 清除缓存,引导用户重新登录
+const tokenErrTip = () => {
+	uni.hideLoading();
+	// 清楚缓存
+	uni.removeStorageSync('userInfo');
+	uni.showModal({
+		title: '登录提示',
+		content: '登录失效,请您重新登录!',
+		showCancel: true,
+		confirmText: '确定',
+		success: (e) => {
+			if (e.confirm) {
+				// 获取微信登录授权
+				uni.switchTab({
+					url: "/pages/Index/Mine"
+				})
+			}
+		},
+		fail: () => {},
+		complete: () => {}
+	})
+}
+
 // 自动登录
 const autoLogin = (fun) => {
 	reqDirect({
@@ -77,7 +101,6 @@ const autoLogin = (fun) => {
 // 缓存登录用户信息
 const saveUserInfo = (data, fun) => {
 	_token = data.token;
-	console.log(data);
 	uni.setStorageSync('userInfo', {
 		openID: data.openId,
 		userName: data.userName || '',
@@ -167,6 +190,9 @@ const ajax = (resolve, reject, _options) => {
 			}else if (res.statusCode == statusCode.logout){
 				// 登录失效提示方法
 				logErrTip()
+			}else if (res.statusCode == statusCode.tokenErr){
+				// 清除缓存重新登录失效提示方法
+				tokenErrTip()
 			}else {
 				utils.msg("服务异常,请稍后重试");
 			}

+ 12 - 0
pages.json

@@ -252,6 +252,18 @@
 					"style": {
 						"navigationBarTitleText": "积分详情"
 					}
+				},
+				{
+					"path" : "Points/Describe",
+					"style" : {
+						"navigationBarTitleText" : "积分说明"
+					}
+				},
+				{
+					"path" : "Points/Publicize",
+					"style" : {
+						"navigationBarTitleText" : "通知公告"
+					}
 				}
 			]
 		}

+ 8 - 3
pagesPointsBase/Points/Index.vue

@@ -36,7 +36,7 @@
 							<view class="noticeInfoBtn" @tap="onNoticeTo">点击学习</view>
 						</view>
 						<view class="noticeInfoVedioBox">
-							<video class="noticeInfoVedio" src="https://www.bilibili.com/video/BV1MD4y1s7Yr/?spm_id_from=333.337.search-card.all.click&vd_source=c43d610aba47c5411d57d16a5dd7edd2"></video>
+							<video class="noticeInfoVedio" :src="noticeVideoSrc"></video>
 						</view>
 					</view>
 				</view>
@@ -102,6 +102,7 @@
 				bgImg: '../../static/img/home/noneImg.png',
 				pointShopBG: '/static/logo.png',
 				noticeBG: '/static/logo.png',
+				noticeVideoSrc: 'http://171.94.154.2:50105/hlfs//file/files_indefinitely?id=08dd7e3a-c12b-406a-8bbb-ab9db09f57f2&expires=1744958097&clientid=hotline&signature=BF5AD8DBEF553CDA6FD49AB9FEF1B6900177B1960682E722124EDFB8304556D64CC0040CC8DD796387EF704E8BD673ADE23E4D5CA32498CD',
 				publicizeBG: '/static/logo.png',
 				// pointShopBG: '../../static/img/home/noneImg.png',
 				// noticeBG: '../../static/img/home/noneImg.png',
@@ -177,7 +178,9 @@
 				})
 			},
 			onDescribeTo() {
-				that.$util.msg("功能即将上线,敬请期待!");
+				uni.navigateTo({
+					url: '/pagesPointsBase/Points/Describe'
+				})
 			},
 			onTapPointShop() {
 				that.$util.msg("功能即将上线,敬请期待!");
@@ -186,7 +189,9 @@
 				that.$util.msg("功能即将上线,敬请期待!");
 			},
 			onPublicizeTo() {
-				that.$util.msg("功能即将上线,敬请期待!");
+				uni.navigateTo({
+					url: '/pagesPointsBase/Points/Publicize'
+				})
 			},
 			// 返回按钮点击事件
 			onBackTo() {