Browse Source

接口修改

fenggang 5 years ago
parent
commit
6ee19425f5

+ 2 - 4
2019专题/云顶之弈模拟器/src/API/index.js

@@ -88,14 +88,12 @@ export const operateTeam = operation => {
   })
 }
 
-export const getUserInfo = uid => {
-  if(!uid) {return}
+export const getUserInfo = () => {
   return new Promise((resolve, reject) => {
     $.ajax(
       {
-        url: baseURL + '/user/nickname',
+        url: baseURL + '/user/detail',
         dataType: 'jsonp',
-        data: {yyuid: uid},
         success: resolve,
         fail: reject
       })

+ 1 - 5
2019专题/云顶之弈模拟器/src/components/index.vue

@@ -306,7 +306,6 @@ const MAX_HEROES_COUNT = 21 // 棋盘所能容纳的最大英雄上限
 const MAX_PLAYER_LEVEL = 9 // 玩家最大等级
 const MIN_PLAYER_LEVEL = 1 // 玩家最小等级
 const LOCALSTORAGE_KEY = '__ydzySimulatorUserInfo'
-let UID = ''
 
 let fetters
 const original = {}
@@ -577,10 +576,9 @@ export default {
     login(){
       if(!this.isLogin) {
         dwUDBProxy.multiLogin(() => {
-          UID = dwUDBProxy.getUid()
           this.isLogin = true
           if(!localStorage.getItem(LOCALSTORAGE_KEY)) {
-            getUserInfo(UID).then(res => {
+            getUserInfo().then(res => {
               localStorage.setItem(LOCALSTORAGE_KEY, JSON.stringify(res.data))
               this.nickname = res.data.nickname
             })
@@ -768,8 +766,6 @@ export default {
       this.heroes = data.hero.data
       this.littleHeroes = data.littleHero.data
 
-
-      console.log(data)
     })
 
   }

+ 1 - 3
2019专题/云顶之弈模拟器/src/components/m-index.vue

@@ -203,7 +203,6 @@ const HERO_MAX_EUIPMENT = 3 // 英雄最大装备上限
 const INITIAL_MAX_POPULATION = 9 // 初始最大英雄上限
 const MAX_HEROES_COUNT = 21 // 棋盘所能容纳的最大英雄上限
 const LOCALSTORAGE_KEY = '__ydzySimulatorUserInfo'
-let UID = ''
 
 let fetters
 const original = {}
@@ -450,10 +449,9 @@ export default {
     login() {
       if (!this.isLogin) {
         dwUDBProxy.multiLogin(() => {
-          UID = dwUDBProxy.getUid()
           this.isLogin = true
           if (!localStorage.getItem(LOCALSTORAGE_KEY)) {
-            getUserInfo(UID).then(res => {
+            getUserInfo().then(res => {
               localStorage.setItem(LOCALSTORAGE_KEY, JSON.stringify(res.data))
               this.nickname = res.data.nickname
             })