Merge branch 'master' into dev

This commit is contained in:
daihh
2022-12-12 17:29:33 +08:00
10 changed files with 181 additions and 48 deletions

View File

@@ -59,10 +59,20 @@ const delLearning = function(ms_timeline_kid) {
return ajax.post('/b1/system/user/ms-timeline-delete',{ms_timeline_kid}); return ajax.post('/b1/system/user/ms-timeline-delete',{ms_timeline_kid});
} }
/**
* 根据用户的kid获取用户的受众权限
*
* @param {Object} kid
*/
const audience = function(kid) {
return ajax.get('/b1/system/user/audience-by-user?userId='+kid);
}
export default { export default {
myLearning, myLearning,
cmtaskList, cmtaskList,
reportList, reportList,
courseList, courseList,
delLearning delLearning,
audience
} }

View File

@@ -0,0 +1,68 @@
<template>
<view>
<u-overlay :show="showGonggao">
<view class="warp">
<view class="gonggao">
<view class="gonggao-title">最新公告</view>
<view class="gonggao-text">
为了保障信息安全为您提供更优质的服务学习平台计划在2022年11月9日0点-11月9日早6点进行服务器升级
在此期间您无法登录学习给您带来不便还请谅解感谢您的理解与支持
</view>
</view>
</view>
</u-overlay>
</view>
</template>
<script>
export default {
data(){
return {
showGonggao:false
}
},
mounted() {
let now=new Date();
let min=new Date(2022,10,9,0,0,0);
let max=new Date(2022,10,9,6,0,0);
//console.log(now,min,max);
//console.log(now.getTime(),min.getTime(),max.getTime());
if(now.getTime()>min.getTime() && now.getTime()<max.getTime()){
//console.log('open')
this.showGonggao=true;
}
}
}
</script>
<style scoped lang="scss">
.warp {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.gonggao{
background: url("/mobile/static/images/gonggao/dlg_bg.png") no-repeat;
background-size: cover;
width:471upx;
height:495upx;
padding: 40upx;
}
.gonggao-title{
color: #333333;
font-size: 32upx;
margin-top: 190upx;
padding: 10upx 0px;
text-align: center;
font-weight: 900;
font-family: PingFangSC-Regular, sans-serif;
}
.gonggao-text{
color: #333333;
font-size: 22upx;
line-height: 35upx;
padding: 10upx 20upx;
}
</style>

View File

@@ -74,7 +74,7 @@
"https" : false, "https" : false,
"proxy" : { "proxy" : {
"/systemapi" : { "/systemapi" : {
"target" : "http://127.0.0.1:9090", "target" : "http://192.168.0.11:9090",
"changeOrigin" : true, "changeOrigin" : true,
"secure" : false, "secure" : false,
"pathRewrite" : { "pathRewrite" : {

View File

@@ -189,7 +189,7 @@
<view > <view >
<uni-load-more :status="loadStatus"></uni-load-more> <uni-load-more :status="loadStatus"></uni-load-more>
</view> </view>
<u-overlay :show="signInShow"> <!-- <u-overlay :show="signInShow">
<view style="padding-top: 180upx;"> <view style="padding-top: 180upx;">
<view style="margin-top: 180upx;width:624upx;margin: 0px auto;position: relative;"> <view style="margin-top: 180upx;width:624upx;margin: 0px auto;position: relative;">
<img usemap="#HotMap" src="/mobile/static/images/dlg.png" style="width:624upx;height: 864upx;"> <img usemap="#HotMap" src="/mobile/static/images/dlg.png" style="width:624upx;height: 864upx;">
@@ -197,7 +197,8 @@
<mapelement></mapelement> <mapelement></mapelement>
</view> </view>
</view> </view>
</u-overlay> </u-overlay> -->
<gonggao></gonggao>
</view> </view>
</template> </template>
<script> <script>
@@ -212,6 +213,7 @@
import apiMessage from '@/api/system/message.js' import apiMessage from '@/api/system/message.js'
import {toScore} from '@/utils/tools.js' import {toScore} from '@/utils/tools.js'
import apiBoeCourse from '@/api/boe/course.js' import apiBoeCourse from '@/api/boe/course.js'
import gonggao from '@/components/gonggao/index.vue'
export default { export default {
data(){ data(){
return { return {
@@ -281,6 +283,7 @@
this.countNoReadMsg(); this.countNoReadMsg();
}, },
components:{ components:{
gonggao,
'mapelement': { 'mapelement': {
render: function(createElement) { render: function(createElement) {

View File

@@ -30,38 +30,54 @@
window.open(this.$config.loginPath) window.open(this.$config.loginPath)
// #endif // #endif
}else{ }else{
console.log('获取用户信息');
apiLogin.boeLogin(token).then(rs=>{ apiLogin.boeLogin(token).then(rs=>{
if(rs.status==200){ if(rs.status==200){
console.log('获取用户信息成功');
//setToken(rs.result.access_token); //setToken(rs.result.access_token);
//加载用户信息 //加载用户信息
this.$store.dispatch("InitData").then(res => { this.$store.dispatch("InitData").then(res => {
//console.log(res) //console.log(res)
//this.$watermark.set(res.result.name + res.result.loginName); //this.$watermark.set(res.result.name + res.result.loginName);
// uni.switchTab({ // uni.switchTab({
// url:'/pages/index/index' // url:'/pages/index/index'
// }) // })
uni.setStorageSync("boe_new_login",1);//记录新登录 uni.setStorageSync("boe_new_login",1);//记录新登录
let openUrl=$this.toUrl; let openUrl=$this.toUrl;
if(openUrl){ if(openUrl){
if(openUrl.startsWith('http')){ console.log('跳转url='+openUrl);
location.href=openUrl if(openUrl.startsWith('http')){
}else{ //alert('跳转url0='+openUrl)
if(openUrl=='/pages/index/index' || openUrl=='/pages/study/index' || openUrl=='/pages/plus/index' || openUrl=='/pages/my/index'){ location.href=openUrl
uni.switchTab({
url:openUrl
})
}else{ }else{
uni.navigateTo({url:openUrl}) if(openUrl=='/pages/index/index' || openUrl=='/pages/study/index' || openUrl=='/pages/plus/index' || openUrl=='/pages/my/index'){
//alert('跳转url1='+openUrl)
uni.switchTab({
url:openUrl
})
}else{
//alert('跳转url2='+openUrl)
uni.navigateTo({url:openUrl})
}
} }
} }else{
}else{ console.log('跳转到首页');
uni.switchTab({ //alert('跳转到首页')
url:'/pages/index/index' uni.switchTab({
}) url:'/pages/index/index'
} })
}
});
}).catch(error => {
console.log('加载用户信息错误:',error);
//alert('加载用户信息错误')
uni.showModal({
title:'错误',
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组件打开
@@ -73,6 +89,7 @@
} }
}).catch(err=>{ }).catch(err=>{
// //
//alert('请求超时')
uni.showToast({ uni.showToast({
title:'请求超时' title:'请求超时'
}) })

View File

@@ -255,9 +255,12 @@
import apiOldCourse from '@/api/modules/course.js' import apiOldCourse from '@/api/modules/course.js'
import apiCoursePortal from '@/api/modules/coursePortal.js' import apiCoursePortal from '@/api/modules/coursePortal.js'
import apiUser from '@/api/system/user.js' import apiUser from '@/api/system/user.js'
import apiQa from '@/api/modules/qa.js'
import {toScore} from '@/utils/tools.js'
import apiArticle from '@/api/modules/article.js' import apiArticle from '@/api/modules/article.js'
import apiBoeCourse from '@/api/boe/course.js' import apiBoeCourse from '@/api/boe/course.js'
import apiUserGroup from "@/api/modules/usergroup.js"; import apiUserGroup from "@/api/modules/usergroup.js";
import { mapGetters } from 'vuex'
export default{ export default{
data(){ data(){
return{ return{
@@ -312,9 +315,33 @@
onLoad(options){ onLoad(options){
if(options.type){ if(options.type){
this.conType=parseInt(options.type); this.conType=parseInt(options.type);
}else{
this.conType=1;
}
this.loadSeachWords();
//let localKey="user_"+this.userInfo.sysId+"_gids";
if(this.audiences.length==0){
//let hasIds;
// let hasIds=sessionStorage.getItem(localKey);
// if(hasIds && hasIds.length>0){
// this.audiences=hasIds.split(",");
// this.search();
// }else{
console.log(this.userInfo,'this.userInfo')
Promise.all([apiBoeCourse.audience(this.userInfo.sysId),apiUserGroup.userGroupIds()]).then(rs=>{
//console.log(rs,'rs');
let aids=[];
if(rs[0].status==200){
aids.push(rs[0].result);
}
if(rs[1].status==200){
aids.push(rs[1].result);
}
this.audiences=aids;
//sessionStorage.setItem(localKey,this.audiences);
//this.search(); //this.search();
}) })
} //}
} }
}, },
computed:{ computed:{
@@ -526,6 +553,7 @@
}, },
async loadCourseData(){ async loadCourseData(){
uni.showLoading({title:'加载中...'}); uni.showLoading({title:'加载中...'});
this.course.params.keyword=this.keyword;
//查询课程 //查询课程
let $this=this; let $this=this;
let dataList = []; let dataList = [];

View File

@@ -179,6 +179,7 @@
//console.log(this.paper.items); //console.log(this.paper.items);
let totalScore=0; let totalScore=0;
this.paper.items.forEach(item => { this.paper.items.forEach(item => {
item.score=parseInt(item.score);
totalScore+=item.score;//加到总分中 totalScore+=item.score;//加到总分中
if(item.type != 102){ if(item.type != 102){
item.userAnswer=''; item.userAnswer='';
@@ -214,8 +215,14 @@
} }
let allRight = true; let allRight = true;
item.options.forEach(it =>{ item.options.forEach(it =>{
if(it.answer && item.userAnswer.indexOf(it.id)==-1) { if(it.answer){ //正确答案
if(item.userAnswer.indexOf(it.id)==-1){
allRight=false; allRight=false;
}
}else{
if(item.userAnswer.indexOf(it.id)>-1){
allRight=false;
}
} }
}); });
if(allRight){ if(allRight){

View File

@@ -292,20 +292,19 @@
</view> </view>
</view> </view>
</u-overlay> </u-overlay>
<gonggao></gonggao>
</view> </view>
</template> </template>
<script> <script>
import apicourseStudy from "../../api/modules/courseStudy.js" import apicourseStudy from "../../api/modules/courseStudy.js"
import apiCoursePortal from '@/api/modules/coursePortal.js' import apiCoursePortal from '@/api/modules/coursePortal.js'
import apiBoeCourse from '@/api/boe/course.js'; import apiBoeCourse from '@/api/boe/course.js';
import { import {formatDate} from '@/utils/tools.js';
formatDate
} from '@/utils/tools.js';
import apiUser from '@/api/system/user.js' import apiUser from '@/api/system/user.js'
import { import {mapGetters} from 'vuex'
mapGetters import gonggao from '@/components/gonggao/index.vue'
} from 'vuex'
export default { export default {
components:{gonggao},
computed: { computed: {
...mapGetters(['userInfo', 'isOneStady']) ...mapGetters(['userInfo', 'isOneStady'])
}, },

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

View File

@@ -87,17 +87,18 @@ const user = {
} }
const user = { const user = {
aid: res.result.aid, aid: res.result.aid,
name: res.result.name, name: res.result.name,
avatar: res.result.avatar, avatar: res.result.avatar,
loginName: res.result.loginName, loginName: res.result.loginName,
userNo: res.result.userNo, userNo: res.result.userNo,
code:res.result.userNo, code:res.result.userNo,
departId: res.result.departId, departId: res.result.departId,
departName: res.result.departName, departName: res.result.departName,
departFullName: res.result.departFullName, departFullName: res.result.departFullName,
studyTotal: res.result.studyTotal, studyTotal: res.result.studyTotal,
studyTotalH:studyTotalH, studyTotalH:studyTotalH,
sex:res.result.sex sex:res.result.sex,
sysId:res.result.sysId
}; };
user.avatar = user.avatar == "" ? "" : config.fileUrl + user.avatar; user.avatar = user.avatar == "" ? "" : config.fileUrl + user.avatar;
commit('SET_UserInfo', user); commit('SET_UserInfo', user);