Compare commits

...

8 Commits

Author SHA1 Message Date
sunhonglai
ffbc4ef808 增加乐享强制走sso 2025-04-15 16:20:23 +08:00
sunhonglai
5936183912 增加乐享转向 2025-04-15 09:12:11 +08:00
sunhonglai
702881c100 修改排行榜展示数据不对问题 2025-04-09 14:28:42 +08:00
670788339
b0229f6cde 测试 2025-04-03 16:36:38 +08:00
670788339
9c6c1708fc 测试 2025-04-03 16:33:42 +08:00
670788339
b67d7f4311 测试 2025-04-03 16:24:13 +08:00
670788339
c5e54f0170 测试 2025-04-03 16:17:04 +08:00
670788339
5c5a71ec55 测试 2025-04-03 15:21:51 +08:00
3 changed files with 103 additions and 17 deletions

View File

@@ -341,6 +341,13 @@ export const constantRoutes = [{
name: 'hotforum',
meta: {title: '热点论坛', icon: 'dashboard', noCache: true, affix: true},
},
{
path: '/lexiang',
hidden: true,
component: (resolve) => require(['@/views/sso/lexiang'], resolve),
name: 'lexiang',
meta: {title: '单点登录', icon: 'dashboard', noCache: true, affix: true},
},
{
path: '/404',
component: (resolve) => require(['@/views/error/404'], resolve),

53
src/views/sso/lexiang.vue Normal file
View File

@@ -0,0 +1,53 @@
<template>
<div>
<p v-if="loading">正在跳转请稍候...</p>
<p v-if="error" class="error">{{ errorMessage }}</p>
</div>
</template>
<script>
import axios from 'axios'
export default {
data() {
return {
loading: true,
error: false,
errorMessage: ''
}
},
created() {
this.fetchCode()
},
methods: {
async fetchCode() {
try {
// 替换为你的实际API地址
const response = await axios.post('/userbasic/sso/getCode', {})
const code = response.data.result
if (code) {
// 替换为你的目标外部链接,并确保参数名称正确
const redirectUrl = `https://lexiangla.com?company_from=d1f3b156e9ed11ef9dc9720f77c5afa9&login_way=sso&sso_auth_code=${encodeURIComponent(code)}`
window.location.href = redirectUrl
} else {
this.handleError('未获取到有效code')
}
} catch (error) {
this.handleError(`请求失败: ${error.message}`)
}
},
handleError(message) {
this.loading = false
this.error = true
this.errorMessage = message
}
}
}
</script>
<style>
.error {
color: red;
font-weight: bold;
}
</style>

View File

@@ -380,15 +380,19 @@ export default {
getExperience() {//经验值
let data = {
aid:this.userInfo.aid,// #用户id
statType:21, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数
statType:20, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数
field:this.experience.field,// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计
num:10,// #显示的条数
}
if(data.field == 'now'){
data.statType = 20
data.field = 'years'
this.experience.field = 'years'
this.isNow = true
}else{
data.statType = 20
data.field = 'total'
this.experience.field = 'total'
this.isNow = true
}
apiStat.getRanking(data).then(res=>{
if(res.status==200){
@@ -402,12 +406,15 @@ export default {
}
this.getUserData([res.result.currentUserRankingData.aid],[res.result.currentUserRankingData])
this.experience.data = res.result.currentUserRankingData;
if(this.experience.field == 'total') {
this.currentUserRankingTotalData.rankNo = res.result.currentUserRankingData.rankingNo;
this.currentUserRankingTotalData.endValue = this.current.endValue;
if(data.field == 'total') {
this.current = this.experienceValue(res.result.currentUserRankingData.total);
this.currentUserRankingTotalData.rankNo = res.result.currentUserRankingData.rankingNo;
this.currentUserRankingTotalData.rankValue = res.result.currentUserRankingData.total;
this.currentUserRankingTotalData.endValue = this.current.endValue;
}else if(data.field == 'years'){
this.currentUserRankingTotalData.rankValue = res.result.currentUserRankingData.years;
}
}
this.current.total=res.result.currentUserRankingData.total;//当前用户的经验值是固定的
const ids= [];
@@ -434,9 +441,15 @@ export default {
}
});
});
this.experience.list = listData.sort((a,b)=>{
return b.total-a.total
}).slice(0,5);
if(data.field == 'total') {
this.experience.list = listData.sort((a,b)=>{
return b.total-a.total
}).slice(0,5);
}else if(data.field == 'years'){
this.experience.list = listData.sort((a,b)=>{
return b.years-a.years
}).slice(0,5);
}
} else {
this.$message.error(res.message);
}
@@ -447,15 +460,19 @@ export default {
getDuration() {//学习时长
let data = {
aid:this.userInfo.aid,// #用户id
statType:12, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数
statType:10, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数
field:this.learningDuration.field,// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计
num:10,// #显示的条数
}
if(data.field == 'now'){
data.statType = 10
data.field = 'total'
this.learningDuration.field = 'total'
this.isStudyTime = true
data.statType = 10;
data.field = 'years';
this.learningDuration.field = 'years';
this.isStudyTime = true;
}else{
data.statType = 10;
data.field = 'total';
this.learningDuration.field = 'total';
}
apiStat.getRanking(data).then(res=>{
if(res.status==200){
@@ -469,9 +486,11 @@ export default {
}
this.getUserData([res.result.currentUserRankingData.aid],[res.result.currentUserRankingData])
this.learningDuration.data = res.result.currentUserRankingData;
this.learningDurationTotalData.rankNo = res.result.currentUserRankingData.rankingNo;
if(data.field == 'total'){
this.learningDurationTotalData.rankNo = res.result.currentUserRankingData.rankingNo;
this.learningDurationTotalData.rankValue = res.result.currentUserRankingData.total;
} else if(data.field == 'years'){
this.learningDurationTotalData.rankValue = res.result.currentUserRankingData.years;
}
}
@@ -500,9 +519,16 @@ export default {
}
});
});
this.learningDuration.list = listData.sort((a,b)=>{
return b.total-a.total
}).slice(0,5);
if(data.field == 'total'){
this.learningDuration.list = listData.sort((a,b)=>{
return b.total-a.total
}).slice(0,5)
} else if(data.field == 'years'){
this.learningDuration.list = listData.sort((a,b)=>{
return b.years-a.years
}).slice(0,5)
}
;
} else {
this.$message.error(res.message);
}