mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-10 19:36:47 +08:00
加提示
This commit is contained in:
@@ -30,18 +30,10 @@
|
|||||||
window.open(this.$config.loginPath)
|
window.open(this.$config.loginPath)
|
||||||
// #endif
|
// #endif
|
||||||
}else{
|
}else{
|
||||||
uni.showModal({
|
|
||||||
title:'获取用户信息',
|
|
||||||
content:''
|
|
||||||
})
|
|
||||||
console.log('获取用户信息');
|
console.log('获取用户信息');
|
||||||
apiLogin.boeLogin(token).then(rs=>{
|
apiLogin.boeLogin(token).then(rs=>{
|
||||||
if(rs.status==200){
|
if(rs.status==200){
|
||||||
console.log('获取用户信息成功');
|
console.log('获取用户信息成功');
|
||||||
uni.showModal({
|
|
||||||
title:'获取用户成功',
|
|
||||||
content:rs.status
|
|
||||||
})
|
|
||||||
//setToken(rs.result.access_token);
|
//setToken(rs.result.access_token);
|
||||||
//加载用户信息
|
//加载用户信息
|
||||||
this.$store.dispatch("InitData").then(res => {
|
this.$store.dispatch("InitData").then(res => {
|
||||||
@@ -55,21 +47,22 @@
|
|||||||
if(openUrl){
|
if(openUrl){
|
||||||
console.log('跳转url='+openUrl);
|
console.log('跳转url='+openUrl);
|
||||||
if(openUrl.startsWith('http')){
|
if(openUrl.startsWith('http')){
|
||||||
alert('跳转url0='+openUrl)
|
//alert('跳转url0='+openUrl)
|
||||||
location.href=openUrl
|
location.href=openUrl
|
||||||
}else{
|
}else{
|
||||||
if(openUrl=='/pages/index/index' || openUrl=='/pages/study/index' || openUrl=='/pages/plus/index' || openUrl=='/pages/my/index'){
|
if(openUrl=='/pages/index/index' || openUrl=='/pages/study/index' || openUrl=='/pages/plus/index' || openUrl=='/pages/my/index'){
|
||||||
alert('跳转url1='+openUrl)
|
//alert('跳转url1='+openUrl)
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url:openUrl
|
url:openUrl
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
alert('跳转url2='+openUrl)
|
//alert('跳转url2='+openUrl)
|
||||||
uni.navigateTo({url:openUrl})
|
uni.navigateTo({url:openUrl})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
console.log('跳转到首页');
|
console.log('跳转到首页');
|
||||||
|
alert('跳转到首页')
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url:'/pages/index/index'
|
url:'/pages/index/index'
|
||||||
})
|
})
|
||||||
@@ -77,12 +70,14 @@
|
|||||||
|
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.log('加载用户信息错误:',error);
|
console.log('加载用户信息错误:',error);
|
||||||
|
alert('加载用户信息错误')
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title:'错误',
|
title:'错误',
|
||||||
content:error
|
content:error
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
|
alert('加载用户错误')
|
||||||
console.log(rs.message+','+rs.error);
|
console.log(rs.message+','+rs.error);
|
||||||
//#ifdef APP-PLUS
|
//#ifdef APP-PLUS
|
||||||
plus.runtime.openURL(this.$config.loginPath) //这里默认使用外部浏览器打开而不是内部web-view组件打开
|
plus.runtime.openURL(this.$config.loginPath) //这里默认使用外部浏览器打开而不是内部web-view组件打开
|
||||||
@@ -94,6 +89,7 @@
|
|||||||
}
|
}
|
||||||
}).catch(err=>{
|
}).catch(err=>{
|
||||||
//
|
//
|
||||||
|
alert('请求超时')
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:'请求超时'
|
title:'请求超时'
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user