|
@@ -12,10 +12,8 @@
|
|
|
</transition>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <pastDue></pastDue>
|
|
|
</div>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
@@ -23,12 +21,7 @@
|
|
|
import axios from 'axios'
|
|
|
import pastDue from "@/views/common/pastDue.vue"
|
|
|
import QRCode from "qrcodejs2"
|
|
|
- import {isvalidUsername} from '@/utils/validate'
|
|
|
import {getToken, setToken, getUser, getPasw, setUser, setPasw,} from '@/utils/auth' // getToken from cookie
|
|
|
- import requests from '@/utils/request-user'
|
|
|
- import { constants } from 'fs'
|
|
|
- import { timestamps } from '@/utils/index'
|
|
|
- import {allocation} from '@/api/configget'
|
|
|
import { wxAuth } from '@/utils/wx-auth-two.js';
|
|
|
import {withoutCodeLoad} from '@/utils/wxconfiguration.js'
|
|
|
|
|
@@ -44,14 +37,14 @@
|
|
|
watch:{
|
|
|
},
|
|
|
created() {
|
|
|
- if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
|
|
|
- this.appPC = "手机"
|
|
|
- window.alert("手机")
|
|
|
- window.location.href = process.env.BASE_API+'/m'
|
|
|
- } else {
|
|
|
- this.appPC = "PC端"
|
|
|
- // window.alert("PC端")
|
|
|
- }
|
|
|
+ // if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
|
|
|
+ // this.appPC = "手机"
|
|
|
+ // window.alert("手机")
|
|
|
+ // window.location.href = process.env.BASE_API+'/m'
|
|
|
+ // } else {
|
|
|
+ // this.appPC = "PC端"
|
|
|
+ // // window.alert("PC端")
|
|
|
+ // }
|
|
|
this.$store.dispatch('setLanguage', 'zh')
|
|
|
localStorage.setItem('login_code','0')
|
|
|
|
|
@@ -77,29 +70,39 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(!codesif){//url没有code就放出登录按钮
|
|
|
+ if(!codesif){
|
|
|
this.logImage = true
|
|
|
this.loginButton = true
|
|
|
}else{
|
|
|
- let params = { code: codes }
|
|
|
- axios.get(process.env.BASE_API+'/api/wechat/minAuth', { params: params })
|
|
|
- .then(res => {
|
|
|
- if(res.data.code == 1){
|
|
|
- if(res.data.data.user.is_official == 1){
|
|
|
- setToken(res.data.data.token)
|
|
|
- this.$store.commit('SET_TOKEN', res.data.data.token)
|
|
|
- localStorage.setItem('Experience_data',JSON.stringify({if:false,name:''}))
|
|
|
- console.log(getToken())
|
|
|
- wxAuth(true)
|
|
|
- }else if(res.data.data.user.is_official == 0){
|
|
|
- this.$router.push({path: '/noAccess'})
|
|
|
+ if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
|
|
|
+ window.location.href = 'http://wechatgdym.vaiwan.com?code='+codes+'&';
|
|
|
+ } else {
|
|
|
+ let params = { code: codes }
|
|
|
+ axios.get(process.env.BASE_API+'/api/wechat/minAuth', { params: params })
|
|
|
+ .then(res => {
|
|
|
+ if(res.data.code == 1){
|
|
|
+ if(res.data.data.user.is_official == 1){
|
|
|
+ setToken(res.data.data.token)
|
|
|
+ this.$store.commit('SET_TOKEN', res.data.data.token)
|
|
|
+ localStorage.setItem('Experience_data',JSON.stringify({if:false,name:''}))
|
|
|
+ console.log(getToken())
|
|
|
+ wxAuth(true)
|
|
|
+ }else if(res.data.data.user.is_official == 0){
|
|
|
+ this.$router.push({path: '/noAccess'})
|
|
|
+ }
|
|
|
+ }else if(res.data.code == 4444){
|
|
|
+ this.$store.state.user.pastDue = true
|
|
|
+ this.logButText = '重新登录'
|
|
|
+ this.loginButton = true
|
|
|
+ this.logImage = true
|
|
|
+ }else{
|
|
|
+ this.logButText = '重新登录'
|
|
|
+ this.loginButton = true
|
|
|
+ this.logImage = true
|
|
|
}
|
|
|
- }else{
|
|
|
- this.logButText = '重新登录'
|
|
|
- this.loginButton = true
|
|
|
- this.logImage = true
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
mounted(){
|