|
|
@@ -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
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
})
|