Преглед на файлове

修改题目和token获取

ZXP преди 1 година
родител
ревизия
733a59b252
променени са 2 файла, в които са добавени 15 реда и са изтрити 3 реда
  1. 5 1
      Assets/Scripts/Login.cs
  2. 10 2
      Assets/Scripts/SelectPrefab.cs

+ 5 - 1
Assets/Scripts/Login.cs

@@ -86,6 +86,7 @@ public class Login : SingletonBaseMono<Login>
         string jsonValue = JsonConvert.SerializeObject(arrays);
         SaveLog("·¢Ëͳɼ¨");
         SaveLog("·¢Ëͳɼ¨Êý¾Ý" + jsonValue);
+        Debug.Log(jsonValue);
         StartCoroutine(SendListCoroutine(jsonValue));
     }
     public IEnumerator SendListCoroutine(string jsonValue)
@@ -178,7 +179,10 @@ public class Login : SingletonBaseMono<Login>
         using (var hmac = new HMACSHA256(keyBytes))
         {
             var hash = hmac.ComputeHash(messageBytes);
-            return Convert.ToBase64String(hash);
+            string code = Convert.ToBase64String(hash);
+            code = Regex.Replace(code, "\\+", "-");
+            Debug.Log(code);
+            return code;
         }
     }
 

+ 10 - 2
Assets/Scripts/SelectPrefab.cs

@@ -189,11 +189,19 @@ public class SelectPrefab : MonoBehaviour
         {
             if (i == 0)
             {
-                questionData.selectIndex = answerPrefabList[i].isOn.ToString();
+                if (answerPrefabList[i].isOn)
+                {
+                    questionData.selectIndex = answerTexts[i];
+                }
+                
             }
             else
             {
-                questionData.selectIndex += "," + answerPrefabList[i].isOn.ToString();
+                if (answerPrefabList[i].isOn)
+                {
+                    questionData.selectIndex += "," + answerTexts[i];
+                }
+             
             }
 
         }

粤ICP备19079148号