wangguoyu 1 tháng trước cách đây
mục cha
commit
b2269f846f
3 tập tin đã thay đổi với 44 bổ sung9 xóa
  1. 11 0
      api/login.js
  2. 2 2
      pages/login/index.vue
  3. 31 7
      pages/login/login.vue

+ 11 - 0
api/login.js

@@ -76,4 +76,15 @@ export function getVersion(data = {}) {
     data,
     timeout: 20000
   })
+}
+export function banbenImpinfo(data = {}) {
+  return request({
+    'url': '/app/chanpin/tongyong/banben/impinfo',
+    headers: {
+      isToken: false
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
 }

+ 2 - 2
pages/login/index.vue

@@ -28,10 +28,10 @@
 						<icon></icon>
 						<view>微信登录</view>
 					</view>
-					<view class="yk-btn" @click="ykBtn">
+		<!-- 			<view class="yk-btn" @click="ykBtn">
 						<icon></icon>
 						<view>游客登录</view>
-					</view>
+					</view> -->
 					<view class="apple-btn" v-if="showAppleLogin" @click="appleLoginClick">
 						<icon></icon>
 						<view>苹果登录</view>

+ 31 - 7
pages/login/login.vue

@@ -30,13 +30,15 @@
 	} from "vue"
 	import {
 		login,
-		sendCode
+		sendCode,
+		banbenImpinfo
 	} from "@/api/login.js"
 	import cacheManager from "@/utils/cacheManager.js";
 	import captcha from "../../components/captcha4/index.vue";
 	import {
-		toast
-	} from "../../utils/common";
+		toast,
+		getUserIdentity
+	} from "@/utils/common";
 	export default {
 		data() {
 			return {
@@ -55,6 +57,8 @@
 				config: {
 					captchaId: "9d5837b0807b8de44da0de310a0b2813",
 				},
+				banbenId: '',
+				typeId: ''
 
 			}
 		},
@@ -75,8 +79,8 @@
 
 			},
 			captchaError(e) {
-				// app端的回调、
-				console.log('error',JSON.stringify(e));
+				// app端的回调、
+				console.log('error', JSON.stringify(e));
 				toast(JSON.stringify(e))
 			},
 			captchaReady() {
@@ -116,8 +120,28 @@
 				login(req).then(res => {
 					if (res.code == 0) {
 						cacheManager.set('auth', res.data)
-						uni.redirectTo({
-							url: `/pages/chanpinXuanze/index`
+						setTimeout(() => {
+							banbenImpinfo({}).then(res => {
+								if (res.code == 0) {
+									debugger
+									this.banbenId = res.data.banbenId
+									this.typeId = res.data.typeId
+									if(this.typeId ==1){
+										// 没学过
+										uni.redirectTo({
+											url: `/pages/chanpinXuanze/index`
+										})
+									}else{
+										// 学过直接到学习页面
+										uni.redirectTo({
+											url: `/pages/chanpinneirong/index`
+										})
+									}
+								}
+							}).catch(() => {
+								toast('banbenImpinfo出错')
+								return false
+							})
 						})
 					}
 				})