mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-07 18:06:47 +08:00
Revert "Merge remote-tracking branch 'origin/master'"
This reverts commit9e16ad6913, reversing changes made to4b3b6cdf16.
This commit is contained in:
14
App.vue
14
App.vue
@@ -1,6 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import apiUserbasic from '@/api/boe/userbasic.js'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
@@ -19,21 +18,22 @@
|
|||||||
//console.log(this.$width,'$width');
|
//console.log(this.$width,'$width');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//获取或加载一次用户信息
|
||||||
|
//console.log('App Launch');
|
||||||
|
//登录页面不需要,此页面用于本地测试
|
||||||
|
//console.log(location.href,'location.href');
|
||||||
var href=location.href;
|
var href=location.href;
|
||||||
//不包含登录页和加载页
|
if(href.indexOf('/pages/login/login')==-1){
|
||||||
if(href.indexOf('/pages/login/login')==-1 && href.indexOf('/pages/login/loading')==-1){
|
|
||||||
//先做登录校验
|
|
||||||
//每次加载,增加一次对token的验证,直接调用用户中心的接口,如果token不对,这里会直接返回登录
|
|
||||||
apiUserbasic.getUserInfo();
|
|
||||||
this.$store.dispatch('GetUserInfo');
|
this.$store.dispatch('GetUserInfo');
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onHide: function() {
|
onHide: function() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import config from '@/config/index.js'
|
import config from '@/config/index.js'
|
||||||
import {toLogin} from '@/utils/tologin.js'
|
|
||||||
import {getToken,removeToken} from '@/utils/token.js'
|
import {getToken,removeToken} from '@/utils/token.js'
|
||||||
import qs from 'qs'
|
import qs from 'qs'
|
||||||
|
|
||||||
@@ -36,22 +35,21 @@ const formRequest=function(method,url,data){
|
|||||||
if(rs.data.status==6001){
|
if(rs.data.status==6001){
|
||||||
//uni.removeStorageSync('userInfo');
|
//uni.removeStorageSync('userInfo');
|
||||||
removeToken();
|
removeToken();
|
||||||
toLogin(reUrl);
|
let loginPath=config.loginPath;
|
||||||
// let loginPath=config.loginPath;
|
if(loginPath.startsWith('http')){
|
||||||
// if(loginPath.startsWith('http')){
|
// #ifdef APP-PLUS
|
||||||
// // #ifdef APP-PLUS
|
plus.runtime.openURL(loginPath) //这里默认使用外部浏览器打开而不是内部web-view组件打开
|
||||||
// plus.runtime.openURL(loginPath) //这里默认使用外部浏览器打开而不是内部web-view组件打开
|
// #endif
|
||||||
// // #endif
|
// #ifdef H5
|
||||||
// // #ifdef H5
|
//window.open(loginPath)
|
||||||
// //window.open(loginPath)
|
let returnUrl=window.location.protocol+'//'+window.location.host+config.context;
|
||||||
// let returnUrl=window.location.protocol+'//'+window.location.host+config.context;
|
location.href=config.loginPath+"?returnUrl="+encodeURIComponent(returnUrl+'/pages/login/loading');
|
||||||
// location.href=config.loginPath+"?returnUrl="+encodeURIComponent(returnUrl+'/pages/login/loading');
|
// #endif
|
||||||
// // #endif
|
}else{
|
||||||
// }else{
|
uni.redirectTo({
|
||||||
// uni.redirectTo({
|
url:loginPath
|
||||||
// url:loginPath
|
})
|
||||||
// })
|
}
|
||||||
// }
|
|
||||||
}else{
|
}else{
|
||||||
resolve(rs.data);
|
resolve(rs.data);
|
||||||
}
|
}
|
||||||
@@ -87,22 +85,21 @@ const jsonRequest=function(method,url,data){
|
|||||||
if(rs.statusCode==200){
|
if(rs.statusCode==200){
|
||||||
if(rs.data.status==6001){
|
if(rs.data.status==6001){
|
||||||
removeToken();
|
removeToken();
|
||||||
toLogin(reUrl);
|
let loginPath=config.loginPath;
|
||||||
// let loginPath=config.loginPath;
|
if(loginPath.startsWith('http')){
|
||||||
// if(loginPath.startsWith('http')){
|
// #ifdef APP-PLUS
|
||||||
// // #ifdef APP-PLUS
|
plus.runtime.openURL(loginPath) //这里默认使用外部浏览器打开而不是内部web-view组件打开
|
||||||
// plus.runtime.openURL(loginPath) //这里默认使用外部浏览器打开而不是内部web-view组件打开
|
// #endif
|
||||||
// // #endif
|
// #ifdef H5
|
||||||
// // #ifdef H5
|
//window.open(loginPath)
|
||||||
// //window.open(loginPath)
|
let returnUrl=window.location.protocol+'//'+window.location.host+config.context;
|
||||||
// let returnUrl=window.location.protocol+'//'+window.location.host+config.context;
|
location.href=config.loginPath+"?returnUrl="+encodeURIComponent(returnUrl+'/pages/login/loading');
|
||||||
// location.href=config.loginPath+"?returnUrl="+encodeURIComponent(returnUrl+'/pages/login/loading');
|
// #endif
|
||||||
// // #endif
|
}else{
|
||||||
// }else{
|
uni.redirectTo({
|
||||||
// uni.redirectTo({
|
url:loginPath
|
||||||
// url:loginPath
|
})
|
||||||
// })
|
}
|
||||||
// }
|
|
||||||
}else{
|
}else{
|
||||||
resolve(rs.data);
|
resolve(rs.data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,11 +31,6 @@ const getUserInfoById = function(id) {
|
|||||||
return ajax.postJson('/user/list',{id});
|
return ajax.postJson('/user/list',{id});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**获取当前登录用户的信息*/
|
|
||||||
const getUserInfo = function() {
|
|
||||||
return ajax.postJson('/user/info',{});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* https://u-pre.boe.com/userbasic/audience/userAudiences
|
* https://u-pre.boe.com/userbasic/audience/userAudiences
|
||||||
* 获取当前用户受众信息
|
* 获取当前用户受众信息
|
||||||
@@ -86,7 +81,6 @@ export default {
|
|||||||
getOrgInfo,
|
getOrgInfo,
|
||||||
findOrgTreeByOrgId,
|
findOrgTreeByOrgId,
|
||||||
getUserInfoById,
|
getUserInfoById,
|
||||||
getUserInfo,
|
|
||||||
getUserCrowds,
|
getUserCrowds,
|
||||||
getOrgHrbpInfo,
|
getOrgHrbpInfo,
|
||||||
modifyPassword,
|
modifyPassword,
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import apiLogin from '@/api/login.js'
|
import apiLogin from '@/api/login.js'
|
||||||
import {toLogin} from '@/utils/tologin.js'
|
|
||||||
import { getToken,setToken } from '@/utils/token'
|
import { getToken,setToken } from '@/utils/token'
|
||||||
export default{
|
export default{
|
||||||
data(){
|
data(){
|
||||||
@@ -29,7 +28,7 @@
|
|||||||
});
|
});
|
||||||
this.toUrl=this.toUrl+params;
|
this.toUrl=this.toUrl+params;
|
||||||
}
|
}
|
||||||
//console.log(this.toUrl,'options.returnUrl');
|
console.log(this.toUrl,'options.returnUrl');
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
let token=getToken();
|
let token=getToken();
|
||||||
|
|||||||
@@ -863,20 +863,21 @@
|
|||||||
// console.log(con,'con');
|
// console.log(con,'con');
|
||||||
this.playerBoxShow=false;
|
this.playerBoxShow=false;
|
||||||
if(con.contentType==40){
|
if(con.contentType==40){
|
||||||
//如果是文档,需要再次加载pdf,之所以不直接判断 con.contentRefId 是为了兼容一期老版本的
|
//如果是文档,需要再次加载pdf
|
||||||
if(con.content!='' && con.content.indexOf('.pdf')==-1){
|
if(con.content!='' && con.content.indexOf('.pdf')==-1){
|
||||||
// 先置空,否则会有延迟
|
// 先置空,否则会有延迟
|
||||||
con.content = '';
|
con.content = '';
|
||||||
|
apiCourseFile.detail(con.contentRefId).then(cfrs=>{
|
||||||
|
if(cfrs.status==200){
|
||||||
|
con.content=cfrs.result.previewFilePath;
|
||||||
|
//console.log(r.content);
|
||||||
|
}else{
|
||||||
|
$this.$refs.messager.show({message:'加载pdf课件文件失败',type:'error'});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
apiCourseFile.detail(con.contentRefId).then(cfrs=>{
|
|
||||||
if(cfrs.status==200){
|
|
||||||
con.content=cfrs.result.previewFilePath;
|
|
||||||
//console.log(r.content);
|
|
||||||
}else{
|
|
||||||
$this.$refs.messager.show({message:'加载pdf课件文件失败',type:'error'});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}else if(con.contentType==50){ //scorm课件的内容
|
}else if(con.contentType==50){ //scorm课件的内容
|
||||||
|
|
||||||
apiCourseFile.detail(con.contentRefId).then(cfrs => {
|
apiCourseFile.detail(con.contentRefId).then(cfrs => {
|
||||||
if(cfrs.status==200){
|
if(cfrs.status==200){
|
||||||
//this.curCFile = cfrs.result;
|
//this.curCFile = cfrs.result;
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ import config from '@/config/index.js'
|
|||||||
|
|
||||||
export function toLogin(ajaxUrl) {
|
export function toLogin(ajaxUrl) {
|
||||||
let pageUrl=location.href;
|
let pageUrl=location.href;
|
||||||
//console.log(pageUrl,'pageUrl');
|
console.log(pageUrl,'pageUrl');
|
||||||
let urlPre=window.location.protocol+'//'+window.location.host;
|
let urlPre=window.location.protocol+'//'+window.location.host;
|
||||||
//console.log(urlPre,'urlPre');
|
console.log(urlPre,'urlPre');
|
||||||
let urlContext=config.context;
|
let urlContext=config.context;
|
||||||
//console.log(urlContext,'urlContext');
|
console.log(urlContext,'urlContext');
|
||||||
let returnPage=pageUrl.substring((urlPre+urlContext).length);
|
let returnPage=pageUrl.substring((urlPre+urlContext).length);
|
||||||
//console.log(returnPage,'returnPage');
|
console.log(returnPage,'returnPage');
|
||||||
//console.log(config.loginPath+"?returnUrl="+urlPre+urlContext+'/pages/login/loading?returnUrl='+returnPage,'生成的url');
|
console.log(config.loginPath+"?returnUrl="+urlPre+urlContext+'/pages/login/loading?returnUrl='+returnPage,'生成的url');
|
||||||
|
|
||||||
if(ajaxUrl && ajaxUrl.indexOf('/xboe/portal/init')>-1){
|
if(ajaxUrl && ajaxUrl.indexOf('/xboe/portal/init')>-1){
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user