Forráskód Böngészése

feature:增加授权页的调试日志

zeng.chen 15 órája
szülő
commit
c823d81e43

+ 1 - 1
pages/pageB/authWeb/authWeb.js

@@ -108,7 +108,7 @@ Page({
     });
   },
 
-  webChannel(e) {
+  handleWebviewMessage(e) {
     // e.detail.data 是网页 postMessage 发送的数据数组
     console.log('收到 web-view 消息:', e);
     var that = this;

+ 1 - 1
pages/pageB/authWeb/authWeb.wxml

@@ -4,4 +4,4 @@
     <web-view class="web-view" src="{{qrcodeUrl}}" bindmessage="webChannel"></web-view>
 </view> -->
 <!-- style="height: calc(100vh - {{navBarHeight}}px); width:100%; margin-top:{{navBarHeight}}px" -->
-<web-view src="{{qrcodeUrl}}" bindmessage="webChannel"></web-view>
+<web-view src="{{qrcodeUrl}}" bindmessage="handleWebviewMessage"></web-view>

+ 2 - 3
utils/auth/auth_util.js

@@ -1,5 +1,6 @@
 const requestUtil = require('../requestUtil');
 const routePath = require('../routePath');
+const constant = require('../../utils/constant.js');
 
 // 定义授权平台的枚举
 const EnumPlatformId = {
@@ -75,9 +76,7 @@ async function autoAuth(platformId, device) {
 		if (loginUrl) {
 			// 跳转到授权页面
 			var path = routePath.authWeb + "?url=" + encodeURIComponent(loginUrl);
-			wx.navigateTo({
-				url: path
-			});
+			constant.routeUtil.jump(path);
 			return null
 		} else {
 			return false;