|
@@ -7,17 +7,16 @@
|
|
|
</p>
|
|
|
<div class="verify-status">
|
|
|
<!-- 如果是大陆站需要验证是否完成手机号认证 -->
|
|
|
- <div class="verify-status-box" v-if="$store.state.userInfo.hasVerify">
|
|
|
+ <div v-show="srvAdr == 'China'" class="verify-status-box" v-if="!hasVerify">
|
|
|
<Icon custom="iconfont icon-phone-unverify" class="tips-icon" />
|
|
|
<b class="verify-title">{{$t('home.verifyPh')}}</b>
|
|
|
<router-link to="/regist" class="to-verify">{{$t('home.toPhone')}}</router-link>
|
|
|
</div>
|
|
|
- <div class="verify-status-box" v-else>
|
|
|
+ <div v-show="srvAdr == 'China'" class="verify-status-box" v-else>
|
|
|
<Icon type="md-checkmark-circle-outline" class="tips-icon" color="#19be6b" />
|
|
|
<p class="phone-tips">
|
|
|
<span style="font-size:16px;color:white">{{$t('home.phoneSuccess')}}</span>
|
|
|
<br />
|
|
|
- <span style="font-size:12px">(暂未对接API)</span>
|
|
|
</p>
|
|
|
<span class="has-verify">{{$t('home.hasBanding')}}</span>
|
|
|
</div>
|
|
@@ -323,6 +322,7 @@ import AcCountPie from "./AcCountPie.vue"
|
|
|
import TechScore from "./TechScore.vue"
|
|
|
import TeachScore from "./TeachScore.vue"
|
|
|
import MinTable from "./MinTable.vue"
|
|
|
+import jwtDecode from 'jwt-decode'
|
|
|
export default {
|
|
|
components: {
|
|
|
AcCountPie, TechScore, TeachScore, MinTable
|
|
@@ -333,7 +333,9 @@ export default {
|
|
|
split2: 0.5,
|
|
|
split3: 0.5,
|
|
|
itemCount: 10,
|
|
|
- tmwCus: []
|
|
|
+ tmwCus: [],
|
|
|
+ srvAdr:'China',
|
|
|
+ hasVerify: false, //是否完成手机号验证
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -375,15 +377,49 @@ export default {
|
|
|
this.$router.push({
|
|
|
path: '/home/settings'
|
|
|
})
|
|
|
+ },
|
|
|
+ // 获取账号详细信息,用来验证大陆站用户是否完成手机号绑定
|
|
|
+ getIdInfo() {
|
|
|
+ let host = this.$store.state.config.China.coreAPIUrl
|
|
|
+ let clientId = this.$store.state.config.China.clientID
|
|
|
+ let idToken = localStorage.getItem('id_token')
|
|
|
+ let tokenData = jwtDecode(idToken)
|
|
|
+ let nonce = tokenData ? tokenData.nonce : ''
|
|
|
+ let params = {
|
|
|
+ "grant_type": "get",
|
|
|
+ "nonce": nonce,
|
|
|
+ "client_id": clientId,
|
|
|
+ "id_token": idToken
|
|
|
+ }
|
|
|
+ this.$api.service.getIdProfile(host, params).then(
|
|
|
+ res => {
|
|
|
+ console.log(res)
|
|
|
+ if(!res.error){
|
|
|
+ if(res.mobile) this.hasVerify = true
|
|
|
+ }else{
|
|
|
+ this.$Message.error('API Error')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ console.log(err)
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ this.srvAdr = this.$store.state.config.srvAdr
|
|
|
+ //只有大陆站才验证手机号
|
|
|
+ if (this.srvAdr == 'China'){
|
|
|
+ this.getIdInfo()
|
|
|
+ }else{
|
|
|
+ this.hasVerify = true
|
|
|
+ }
|
|
|
},
|
|
|
computed: {
|
|
|
//暂时只验证加入学校, 手机号需要对接API
|
|
|
isComplete() {
|
|
|
- // return this.$store.state.userInfo.hasSchool && this.$store.state.userInfo.hasVerify
|
|
|
- return this.$store.state.userInfo.hasSchool
|
|
|
+ return this.$store.state.userInfo.hasSchool && this.hasVerify
|
|
|
}
|
|
|
}
|
|
|
}
|