|
@@ -19,6 +19,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import $http from '@/utils/request.js'
|
|
import $http from '@/utils/request.js'
|
|
|
|
+ import log from '@/common/log.js'
|
|
import Auth from '../../components/auth/auth.vue'
|
|
import Auth from '../../components/auth/auth.vue'
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
@@ -33,42 +34,66 @@
|
|
methods: {
|
|
methods: {
|
|
getPhoneNumber(e) {
|
|
getPhoneNumber(e) {
|
|
let _this = this
|
|
let _this = this
|
|
- uni.showLoading({
|
|
|
|
- title: '登录中'
|
|
|
|
- });
|
|
|
|
- if (e.detail & e.detail.code) {
|
|
|
|
- $http.post('/api/v1/mp/user/wxauth/mobile', {
|
|
|
|
- ...e.detail,
|
|
|
|
- identity: 1,
|
|
|
|
- noToken: true
|
|
|
|
- }).then(res => {
|
|
|
|
- uni.hideLoading();
|
|
|
|
- if (res.code == 0) {
|
|
|
|
- uni.setStorageSync('token', res.token)
|
|
|
|
- _this.getBaseInfo()
|
|
|
|
- }
|
|
|
|
- }).catch(() => {
|
|
|
|
- uni.hideLoading();
|
|
|
|
- })
|
|
|
|
- }else{
|
|
|
|
- uni.login({
|
|
|
|
- success(res) {
|
|
|
|
- $http.post('/api/v1/mp/user/wxauth/mobile', {
|
|
|
|
- ...e.detail,
|
|
|
|
- loginCode: res.code,
|
|
|
|
- identity: 1,
|
|
|
|
- noToken: true
|
|
|
|
- }).then(res => {
|
|
|
|
- uni.hideLoading();
|
|
|
|
- if (res.code == 0) {
|
|
|
|
- uni.setStorageSync('token', res.token)
|
|
|
|
- _this.getBaseInfo()
|
|
|
|
- }
|
|
|
|
- }).catch(() => {
|
|
|
|
- uni.hideLoading();
|
|
|
|
|
|
+ if(e.detail.errMsg == 'getPhoneNumber:ok'){
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: '登录中'
|
|
|
|
+ });
|
|
|
|
+ if (e.detail & e.detail.code) {
|
|
|
|
+ $http.post('/api/v1/mp/user/wxauth/mobile', {
|
|
|
|
+ ...e.detail,
|
|
|
|
+ identity: 1,
|
|
|
|
+ noToken: true
|
|
|
|
+ }).then(res => {
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
+ uni.setStorageSync('token', res.token)
|
|
|
|
+ _this.getBaseInfo()
|
|
|
|
+ }else{
|
|
|
|
+ uni.getSystemInfo({
|
|
|
|
+ success (res) {
|
|
|
|
+ log.info(`错误信息:===基础库:${ res.SDKVersion },设备:${ res.model }-${ res.system }.===`)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ uni.getSystemInfo({
|
|
|
|
+ success (res) {
|
|
|
|
+ log.info(`错误信息:===基础库:${ res.SDKVersion },设备:${ res.model }-${ res.system }.===`)
|
|
|
|
+ }
|
|
})
|
|
})
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ uni.login({
|
|
|
|
+ success(res) {
|
|
|
|
+ $http.post('/api/v1/mp/user/wxauth/mobile', {
|
|
|
|
+ ...e.detail,
|
|
|
|
+ loginCode: res.code,
|
|
|
|
+ identity: 1,
|
|
|
|
+ noToken: true
|
|
|
|
+ }).then(res => {
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
+ uni.setStorageSync('token', res.token)
|
|
|
|
+ _this.getBaseInfo()
|
|
|
|
+ }else{
|
|
|
|
+ uni.getSystemInfo({
|
|
|
|
+ success (res) {
|
|
|
|
+ log.info(`错误信息:===基础库:${ res.SDKVersion },设备:${ res.model }-${ res.system }.===`)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ uni.getSystemInfo({
|
|
|
|
+ success (res) {
|
|
|
|
+ log.info(`错误信息:===基础库:${ res.SDKVersion },设备:${ res.model }-${ res.system }.===`)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|