game.js 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. // 导入BoleMbti脚本
  2. // 引用Parse JS SDK
  3. const Parse = require("parse/node");
  4. Parse.initialize("dev"); // 设置applicationId
  5. Parse.serverURL = "http://web2023.fmode.cn:9999/parse"; // 设置serverURL
  6. let game= [
  7. {
  8. "name": "王者荣耀",
  9. "image": "assets/image/WangZhiRongYao.webp",
  10. "detail": "一款由腾讯游戏开发的多人在线战术竞技游戏,玩家分为两支对抗的队伍,在地图上展开战斗,每个玩家控制一个英雄,通过策略和技能展开战斗。",
  11. "rating": 9.3
  12. },
  13. {
  14. "name": "和平精英",
  15. "image": "assets/image/HePinJinYing.webp",
  16. "detail": "一款由腾讯游戏开发的大逃杀游戏,玩家需要在庞大的地图上收集资源、武器和装备,与其他玩家展开生存竞争,最终成为最后生存的玩家。",
  17. "rating": 9.3
  18. },
  19. {
  20. "name": "我的世界",
  21. "image": "assets/image/WoDeShiJie.webp",
  22. "detail": "一款沙盒游戏,玩家可以在一个由方块构建的世界中自由创造和探索,可以建造各种建筑、挖掘资源、与怪物战斗等。",
  23. "rating": 9.6
  24. },
  25. {
  26. "name": "迷你世界",
  27. "image": "assets/image/MiNiShiJie.png",
  28. "detail": "一款类似于我的世界的沙盒游戏,玩家可以在游戏中创造自己的世界,进行建筑、探险和社交。",
  29. "rating": 9.4
  30. },
  31. {
  32. "name": "绝区零",
  33. "image": "assets/image/JueQuLing.png",
  34. "detail": "一款射击游戏,玩家需要在大型地图上与其他玩家展开战斗,通过收集装备和展现枪法来获得胜利。",
  35. "rating": 9.1
  36. },
  37. {
  38. "name": "星穹铁道",
  39. "image": "assets/image/XingQuTieDao.jpg",
  40. "detail": "一款太空题材的建造游戏,玩家可以建造自己的太空站和铁路系统,探索宇宙并经营资源",
  41. "rating": 9.2
  42. },
  43. {
  44. "name": "原神",
  45. "image": "assets/image/YuanShen.png",
  46. "detail": "一款开放世界动作角色扮演游戏,玩家可以在广阔的世界中探索、战斗、解谜,并收集各种角色和装备。",
  47. "rating": 9.3
  48. },
  49. {
  50. "name": "极品飞车",
  51. "image": "assets/image/JiPinFeiChe.jpg",
  52. "detail": "一款经典的赛车游戏系列,玩家可以驾驶各种豪车在城市街道或赛道上展开竞速。",
  53. "rating": 9.5
  54. },
  55. {
  56. "name": "植物大战僵尸",
  57. "image": "assets/image/ZhiWuDaZhanJiangShi.jpg",
  58. "detail": "一款塔防游戏,玩家需要通过种植各种植物来抵御僵尸的进攻,保卫自己的花园。",
  59. "rating": 9.6
  60. },
  61. {
  62. "name": "火影忍者",
  63. "image": "assets/image/HuoYingRenZhe.jpg",
  64. "detail": "以日本漫画《火影忍者》为题材的动作格斗游戏,玩家可以扮演各种火影忍者中的角色展开战斗。",
  65. "rating": 9.6
  66. },
  67. {
  68. "name": "光遇",
  69. "image": "assets/image/GuangYu.webp",
  70. "detail": "一款探索冒险游戏,玩家扮演一只可爱的生物,在神秘的世界中探索、解谜和与其他玩家互动。",
  71. "rating": 9.7
  72. },
  73. {
  74. "name": "第五人格",
  75. "image": "assets/image/DiWuRenGe.png",
  76. "detail": "一款对抗式对称竞技游戏,玩家分为求生者和猎人两个阵营,在特定地图上展开战斗。",
  77. "rating": 9.0
  78. },
  79. {
  80. "name": "金铲铲",
  81. "image": "assets/image/JinChuanChuan.jpg",
  82. "detail": "一款模拟经营游戏,玩家扮演矿工,在地下挖掘宝藏、经营矿山并发展自己的挖矿帝国。",
  83. "rating": 9.0
  84. },
  85. {
  86. "name": "荣耀战魂",
  87. "detail": "一款热血战斗类游戏,挑战无尽的敌人,成为最强战士!",
  88. "rating": 8.5,
  89. "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.GtA5Cqk96Z6vJQJ1GfmS3AHaEo?w=270&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
  90. },
  91. {
  92. "name": "未来之战",
  93. "detail": "探索未知的星际世界,解开宇宙的秘密,战胜外星入侵者!",
  94. "rating": 9.0,
  95. "image": "https://tse1-mm.cn.bing.net/th/id/OIP-C.xFMW3-PBF4PLh--FNbM_NgHaLH?rs=1&pid=ImgDetMain"
  96. },
  97. {
  98. "name": "幻想之旅",
  99. "detail": "踏上奇幻冒险之旅,与精灵、巨龙共同征服魔法世界!",
  100. "rating": 8.0,
  101. "image": "https://img.zcool.cn/community/031f6cf58edd65ba8012049ef8b0c09.jpg"
  102. },
  103. {
  104. "name": "机械战争",
  105. "detail": "操控强大的机甲,与机器人对抗,保卫人类的未来!",
  106. "rating": 8.8,
  107. "image": "https://img.zcool.cn/community/01ebca5544f20c0000019ae90d1897.jpg@1280w_1l_2o_100sh.jpg"
  108. },
  109. {
  110. "name": "魔法学院",
  111. "detail": "学习魔法,拯救魔法学院,成为最强大法师!",
  112. "rating": 9.2,
  113. "image": "https://tse3-mm.cn.bing.net/th/id/OIP-C.YPQO8Zw6Gm6PY5MH0ACqywHaEK?rs=1&pid=ImgDetMain"
  114. },
  115. {
  116. "name": "未来之城",
  117. "detail": "建设未来之城,发展科技,引领人类文明的新时代!",
  118. "rating": 8.7,
  119. "image": "https://x0.ifengimg.com/ucms/2023_42/95176231911BD26060B4A8880FF34A1B7B58D2DC_size302_w1920_h1080.jpg"
  120. },
  121. {
  122. "name": "神秘遗迹",
  123. "detail": "探索神秘遗迹,解开古老谜团,获得无尽宝藏!",
  124. "rating": 9.5,
  125. "image": "https://tse3-mm.cn.bing.net/th/id/OIP-C.Kwd17FuPInfoA8Lj8-_ibAFNC7?w=273&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7g"
  126. },
  127. {
  128. "name": "魔幻冒险",
  129. "detail": "穿越魔幻世界,与精灵、巫师展开冒险之旅!",
  130. "rating": 8.3,
  131. "image": "https://tse2-mm.cn.bing.net/th/id/OIP-C.g2_hsuoPD9tPa_hkaMJuzQHaEL?w=255&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
  132. },
  133. {
  134. "name": "宇宙探险",
  135. "detail": "乘坐飞船探索宇宙,发现新星球,迎接未知挑战!",
  136. "rating": 8.9,
  137. "image": "https://tse2-mm.cn.bing.net/th/id/OIP-C.xEOiLpMk1BoyDrA6vABo-QAAAA?w=234&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
  138. },
  139. {
  140. "name": "魔法战争",
  141. "detail": "魔法与科技的战争,选择你的阵营,改变世界的命运!",
  142. "rating": 9.1,
  143. "image": "https://tse2-mm.cn.bing.net/th/id/OIP-C.ExIXu-NcDFJZnc1mSoGBlQHaEK?w=331&h=186&c=7&r=0&o=5&dpr=1.8&pid=1.7"
  144. },
  145. {
  146. "name": "神秘之门",
  147. "detail": "穿越神秘之门,探索古老文明,解开宇宙之谜!",
  148. "rating": 9.3,
  149. "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.hnVlYEIVfosbC-Y6VVBmswHaEj?w=263&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
  150. },
  151. {
  152. "name": "魔法学堂",
  153. "detail": "进入魔法学堂,学习魔法技能,成为顶尖法师!",
  154. "rating": 8.6,
  155. "image": "https://tse2-mm.cn.bing.net/th/id/OIP-C.PoR7whHmHNI9oSK-820PBAHaEH?w=311&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
  156. },
  157. {
  158. "name": "未来战争",
  159. "detail": "投身未来战争,驾驶高科技战机,改变战局!",
  160. "rating": 9.0,
  161. "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.9JjRXloW6NgnRnuYElk12QHaD4?w=331&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
  162. },
  163. {
  164. "name": "魔幻王国",
  165. "detail": "建立属于你的魔幻王国,统治整个魔法世界!",
  166. "rating": 8.8,
  167. "image": "https://tse2-mm.cn.bing.net/th/id/OIP-C.Hc1WCGyGHFT3Zxo6KLGDsgHaHa?w=170&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
  168. },
  169. {
  170. "name": "星际探索",
  171. "detail": "探索星际宇宙,发现新星球,迎接星际冒险!",
  172. "rating": 9.2,
  173. "image": "https://tse2-mm.cn.bing.net/th/id/OIP-C.TRZd41t7CzD9kcdl2uXCswHaE3?w=282&h=186&c=7&r=0&o=5&dpr=1.8&pid=1.7"
  174. },
  175. {
  176. "name": "未知之境",
  177. "detail": "探索未知之境,挑战神秘力量,解锁隐藏的秘密!",
  178. "rating": 9.4,
  179. "image": "https://tse2-mm.cn.bing.net/th/id/OIP-C.RDsooGjNtcjThT3JwxPA3gHaEK?w=268&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
  180. },
  181. {
  182. "name": "魔法传说",
  183. "detail": "传说中的魔法世界,英雄与魔法共存,开启传奇之旅!",
  184. "rating": 8.9,
  185. "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.7VeAlbRM-KxeGwsS-YymOwAAAA?w=187&h=333&c=7&r=0&o=5&dpr=1.8&pid=1.7"
  186. },
  187. {
  188. "name": "未来之旅",
  189. "detail": "穿越时空,踏上未来之旅,改变历史的走向!",
  190. "rating": 9.1,
  191. "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.ScDPIUG5rZo7wffi3-B49QHaEK?w=288&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
  192. },
  193. {
  194. "name": "神秘之夜",
  195. "detail": "夜幕降临,揭开神秘之夜的面纱,迎接挑战与冒险!",
  196. "rating": 8.7,
  197. "image": "https://tse2-mm.cn.bing.net/th/id/OIP-C.mw6-eCoPb6KLjNi9XlCeuAHaEX?w=293&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
  198. },
  199. {
  200. "name": "魔法之战",
  201. "detail": "魔法与剑术的较量,决定魔法世界的未来命运!",
  202. "rating": 9.3,
  203. "image": "https://tse2-mm.cn.bing.net/th/id/OIP-C.BRj8r1RuaxC1gbwebXS21gAAAA?w=127&h=188&c=7&r=0&o=5&dpr=1.8&pid=1.7"
  204. }
  205. ]
  206. function importAll(){
  207. let LQLGame= []
  208. Object.keys(game).forEach(key=>{
  209. LQLGame.push({
  210. // result:key,
  211. name:game[key]?.name,
  212. detail:game[key]?.detail,
  213. rating:game[key]?.rating,
  214. image:game[key]?.image,
  215. })
  216. })
  217. console.log(LQLGame)
  218. LQLGame.forEach(async mbti => {
  219. // 查重
  220. let exists = await checkExists(mbti)
  221. if(exists?.id) return;
  222. // 新增
  223. let LQLGame = Parse.Object.extend("LQLGame");
  224. let bm = new LQLGame();
  225. bm.set(mbti);
  226. bm.save();
  227. });
  228. }
  229. async function checkExists(mbti){
  230. let query = new Parse.Query("LQLGame");
  231. //query.equalTo("result",mbti?.result);
  232. query.equalTo("name",mbti?.name);
  233. await query.first();
  234. return await query.first();
  235. }
  236. importAll()