ソースを参照

修复获取渠道问题

XSXS 1 ヶ月 前
コミット
3c087defc3
2 ファイル変更7 行追加3 行削除
  1. 2 2
      App.vue
  2. 5 1
      uniCloud-aliyun/cloudfunctions/smsVerification/index.js

+ 2 - 2
App.vue

@@ -75,7 +75,7 @@ export default {
             // 请求成功,停止检查
             this.globalData.needStatusCheck = false;
             // 清除定时器
-            if (this.globalData.statusCheckTimer) {
+            if (this.globalData.statusCheckTimer && this.globalData.uuid) {
               clearInterval(this.globalData.statusCheckTimer);
               this.globalData.statusCheckTimer = null;
             }
@@ -88,7 +88,7 @@ export default {
     };
 
     // 每10秒执行一次状态检查,并保存定时器引用
-    checkStatus()
+    // checkStatus()
     this.globalData.statusCheckTimer = setInterval(checkStatus, 10000);
 
 

+ 5 - 1
uniCloud-aliyun/cloudfunctions/smsVerification/index.js

@@ -2,7 +2,11 @@
 'use strict';
 exports.main = async (event, context) => {
 	// event里包含着客户端提交的参数
-	console.log("event:"+event);
+	console.log("event:"+JSON.stringify(event));
+	console.log("context:"+JSON.stringify(context));
+	if(!event.templateId){
+		event=event.queryStringParameters
+	}
   try {
     const res = await uniCloud.sendSms({
       appid: '__UNI__00BD11F',