mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 02:46:44 +08:00
Compare commits
25 Commits
20251124-f
...
release_20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
738add6f18 | ||
|
|
a7763057c4 | ||
|
|
421e2b2c51 | ||
|
|
12e91854fe | ||
|
|
3852a92ab3 | ||
|
|
56103bbdf6 | ||
|
|
d2f3b2d79c | ||
|
|
4e1940b36f | ||
|
|
3e344a8374 | ||
|
|
82598dd5e0 | ||
|
|
f731bb425f | ||
|
|
f16c6eb157 | ||
|
|
6016e00ae8 | ||
|
|
7155976f31 | ||
|
|
4ca01ba233 | ||
|
|
7368fa7a8c | ||
|
|
d09cbfac5f | ||
|
|
fd903d0974 | ||
|
|
42885e0d61 | ||
|
|
052ab0be6f | ||
|
|
4c453e3974 | ||
|
|
47dde458de | ||
|
|
3701605f7a | ||
|
|
b021be2f6f | ||
|
|
11e34ca335 |
12
src/App.vue
12
src/App.vue
@@ -87,4 +87,16 @@
|
||||
border: 1px solid #e7e7e7 !important;
|
||||
box-shadow: 0px 1px 5px 1px rgba(92,98,111,.3);
|
||||
}
|
||||
|
||||
#app {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#app > *:not(.case-expert-dialog) {
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.case-expert-dialog {
|
||||
pointer-events: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -19,52 +19,57 @@ import errorCode from '@/utils/errorCode'
|
||||
|
||||
|
||||
// const ReLoginUrl=process.env.VUE_APP_LOGIN_URL;
|
||||
const TokenName='XBOE-Access-Token';
|
||||
const TokenName = 'XBOE-Access-Token';
|
||||
/**axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'**/
|
||||
//只是用于发送json对象数据时使用post,put,patch
|
||||
/**axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'**/
|
||||
//只是用于发送json对象数据时使用post,put,patch
|
||||
//用于普通的发送请求
|
||||
const formRequest=axios.create({
|
||||
const formRequest = axios.create({
|
||||
// headers:{'Content-Type':'application/x-www-form-urlencoded'},
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
// baseURL: process.env.VUE_APP_CESOURCE_BASE_API,
|
||||
//超时
|
||||
timeout: 60000,
|
||||
})
|
||||
//发送json对象的拦截器
|
||||
formRequest.interceptors.request.use(config => {
|
||||
})
|
||||
//发送json对象的拦截器
|
||||
formRequest.interceptors.request.use(config => {
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code === 401){
|
||||
} else {
|
||||
if (code === 401) {
|
||||
//Message({message: msg, type: 'error'});
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = this.webBaseUrl + ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
// location.href = this.webBaseUrl + ReLoginUrl;
|
||||
})
|
||||
}else if(code===403){
|
||||
var msg='当前操作没有权限';
|
||||
Message({message: msg, type: 'error'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
}else{
|
||||
} else {
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err' + res.data.error);
|
||||
return res.data
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
@@ -84,22 +89,22 @@ const formRequest=axios.create({
|
||||
})
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* request请求,可以自定义参数
|
||||
*/
|
||||
const request=formRequest.request;
|
||||
const request = formRequest.request;
|
||||
|
||||
/**
|
||||
* get请求 ,只有url
|
||||
*/
|
||||
const get = function(baseURL,url){
|
||||
const get = function (baseURL, url) {
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'get',
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
})
|
||||
}
|
||||
|
||||
@@ -108,60 +113,60 @@ const get = function(baseURL,url){
|
||||
* @param {Object} url
|
||||
* @param {Object} postData
|
||||
*/
|
||||
const post=function(baseURL,url,postData){
|
||||
if(postData){
|
||||
postData=qs.stringify(postData);
|
||||
const post = function (baseURL, url, postData) {
|
||||
if (postData) {
|
||||
postData = qs.stringify(postData);
|
||||
}
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'post',
|
||||
data:postData,
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
data: postData,
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
})
|
||||
}
|
||||
//post请求
|
||||
const postForm=function(baseURL,url,data){
|
||||
const postForm = function (baseURL, url, data) {
|
||||
return request({
|
||||
baseURL,
|
||||
url,
|
||||
data,
|
||||
method: 'post',
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
});
|
||||
}
|
||||
}
|
||||
// const postJson=jsonRequest.post;
|
||||
|
||||
const postJson=function(baseURL,url,postData){
|
||||
const postJson = function (baseURL, url, postData) {
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'post',
|
||||
data:postData,
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
data: postData,
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const postPdf=function(baseURL,url,postData){
|
||||
const postPdf = function (baseURL, url, postData) {
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
responseType: 'blob',
|
||||
method: 'post',
|
||||
data:postData,
|
||||
headers:{'Content-Type':'application/pdf'},
|
||||
data: postData,
|
||||
headers: { 'Content-Type': 'application/pdf' },
|
||||
})
|
||||
}
|
||||
|
||||
// 导出文件请求定义
|
||||
const postJsonToFile=function(baseURL,url,postData){
|
||||
const postJsonToFile = function (baseURL, url, postData) {
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'post',
|
||||
data:postData,
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
data: postData,
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -170,33 +175,33 @@ const postJsonToFile=function(baseURL,url,postData){
|
||||
/**
|
||||
* put请求
|
||||
*/
|
||||
const put=function(baseURL,url,data){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
const put = function (baseURL, url, data) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
}
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'put',
|
||||
data:data,
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
data: data,
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
})
|
||||
}
|
||||
|
||||
const putJson=function(baseURL,url,data){
|
||||
const putJson = function (baseURL, url, data) {
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'put',
|
||||
data:data,
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
data: data,
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
tokenName:TokenName,
|
||||
tokenName: TokenName,
|
||||
request,
|
||||
get,
|
||||
post,
|
||||
|
||||
@@ -19,56 +19,61 @@ import errorCode from '@/utils/errorCode'
|
||||
|
||||
|
||||
// const ReLoginUrl=process.env.VUE_APP_LOGIN_URL;
|
||||
const TokenName='token';
|
||||
const TokenName = 'token';
|
||||
/**axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'**/
|
||||
//只是用于发送json对象数据时使用post,put,patch
|
||||
/**axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'**/
|
||||
//只是用于发送json对象数据时使用post,put,patch
|
||||
//用于普通的发送请求
|
||||
const formRequest=axios.create({
|
||||
const formRequest = axios.create({
|
||||
// headers:{'Content-Type':'application/x-www-form-urlencoded'},
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
// baseURL: process.env.VUE_APP_CESOURCE_BASE_API,
|
||||
//超时
|
||||
timeout: 10000,
|
||||
})
|
||||
//发送json对象的拦截器
|
||||
formRequest.interceptors.request.use(config => {
|
||||
})
|
||||
//发送json对象的拦截器
|
||||
formRequest.interceptors.request.use(config => {
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
let curToken=getToken();
|
||||
let curToken = getToken();
|
||||
//curToken='eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2NzIzMTE2MTIsImV4cCI6MTY3MjMxODgxMiwiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjZCMDQ5RkFGLUMzMTQtN0NDRi0wRDI4LTBEMjNGNEM0MjUzMSIsInVJZCI6Ijk2NTM0MjAyNzQ5NzYwNzE2OCIsInBlcm1pc3Npb24iOiIifQ==.a4f41376e994c5fcd3ab537ce17572ef4c633863f87785cf7b6ffa353e2ed51c';
|
||||
if (curToken && !isToken) {
|
||||
config.headers[TokenName] = curToken // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
//console.log(res);
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code === 401){
|
||||
} else {
|
||||
if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = this.webBaseUrl + ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
// location.href = this.webBaseUrl + ReLoginUrl;
|
||||
})
|
||||
}else if(code===403){
|
||||
var msg='当前操作没有权限';
|
||||
Message({message: msg, type: 'error'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
}else{
|
||||
} else {
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err' + res.data.error);
|
||||
return res.data
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
error => {
|
||||
console.log('err',error)
|
||||
console.log('err', error)
|
||||
let { message } = error;
|
||||
if (message == "Network Error") {
|
||||
message = "网络异常,请稍后重试";
|
||||
@@ -86,22 +91,22 @@ const formRequest=axios.create({
|
||||
})
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* request请求,可以自定义参数
|
||||
*/
|
||||
const request=formRequest.request;
|
||||
const request = formRequest.request;
|
||||
|
||||
/**
|
||||
* get请求 ,只有url
|
||||
*/
|
||||
const get = function(baseURL,url){
|
||||
const get = function (baseURL, url) {
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'get',
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
})
|
||||
}
|
||||
|
||||
@@ -110,48 +115,48 @@ const get = function(baseURL,url){
|
||||
* @param {Object} url
|
||||
* @param {Object} postData
|
||||
*/
|
||||
const post=function(baseURL,url,postData){
|
||||
if(postData){
|
||||
postData=qs.stringify(postData);
|
||||
const post = function (baseURL, url, postData) {
|
||||
if (postData) {
|
||||
postData = qs.stringify(postData);
|
||||
}
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'post',
|
||||
data:postData,
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
data: postData,
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
})
|
||||
}
|
||||
//post请求
|
||||
const postForm=function(baseURL,url,data){
|
||||
const postForm = function (baseURL, url, data) {
|
||||
return request({
|
||||
baseURL,
|
||||
url,
|
||||
data,
|
||||
method: 'post',
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
});
|
||||
}
|
||||
}
|
||||
// const postJson=jsonRequest.post;
|
||||
|
||||
const postJson=function(baseURL,url,postData){
|
||||
const postJson = function (baseURL, url, postData) {
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'post',
|
||||
data:postData,
|
||||
headers:{'Content-Type':'application/json'},
|
||||
data: postData,
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
})
|
||||
}
|
||||
|
||||
// 导出文件请求定义
|
||||
const postJsonToFile=function(baseURL,url,postData){
|
||||
const postJsonToFile = function (baseURL, url, postData) {
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'post',
|
||||
data:postData,
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
data: postData,
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -160,33 +165,33 @@ const postJsonToFile=function(baseURL,url,postData){
|
||||
/**
|
||||
* put请求
|
||||
*/
|
||||
const put=function(baseURL,url,data){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
const put = function (baseURL, url, data) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
}
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'put',
|
||||
data:data,
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
data: data,
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
})
|
||||
}
|
||||
|
||||
const putJson=function(baseURL,url,data){
|
||||
const putJson = function (baseURL, url, data) {
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'put',
|
||||
data:data,
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
data: data,
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
tokenName:TokenName,
|
||||
tokenName: TokenName,
|
||||
request,
|
||||
get,
|
||||
post,
|
||||
|
||||
@@ -18,13 +18,13 @@ import errorCode from '@/utils/errorCode'
|
||||
*delete请求 axios.delete(url[, config])
|
||||
*/
|
||||
|
||||
const ReLoginUrl=process.env.VUE_APP_LOGIN_URL;
|
||||
const TokenName='token';
|
||||
const ReLoginUrl = process.env.VUE_APP_LOGIN_URL;
|
||||
const TokenName = 'token';
|
||||
|
||||
/**axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'**/
|
||||
//只是用于发送json对象数据时使用post,put,patch
|
||||
const jsonRequest=axios.create({
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
const jsonRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BOE_BASE_API,
|
||||
//超时
|
||||
@@ -47,27 +47,32 @@ jsonRequest.interceptors.request.use(config => {
|
||||
jsonRequest.interceptors.response.use(res => {
|
||||
|
||||
const code1 = res.data.status || 200;
|
||||
const code=parseInt(code1);
|
||||
if(code===200){
|
||||
const code = parseInt(code1);
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code == 6001){ //对方是字符串,所以这里不要使用三个等号
|
||||
} else {
|
||||
if (code == 6001) { //对方是字符串,所以这里不要使用三个等号
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code===403){
|
||||
var msg='当前操作没有权限';
|
||||
Message({message: msg, type: 'error'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
//return res.data;
|
||||
}else{
|
||||
} else {
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err:' + res.data.error);
|
||||
//return Promise.reject(new Error(res.data.message))
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
@@ -91,8 +96,8 @@ jsonRequest.interceptors.response.use(res => {
|
||||
)
|
||||
|
||||
//用于普通的发送请求
|
||||
const formRequest=axios.create({
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'},
|
||||
const formRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BOE_BASE_API,
|
||||
//超时
|
||||
@@ -112,25 +117,30 @@ formRequest.interceptors.request.use(config => {
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code == 6001){ //对方是字符串,所以这里不要使用三个等号
|
||||
} else {
|
||||
if (code == 6001) { //对方是字符串,所以这里不要使用三个等号
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code===403){
|
||||
var msg='当前操作没有权限';
|
||||
Message({message: msg, type: 'error'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
}else{
|
||||
} else {
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err' + res.data.error);
|
||||
//return Promise.reject(new Error(res.data.message))
|
||||
return res.data;//返回给用户做业务处理
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
@@ -154,44 +164,44 @@ formRequest.interceptors.response.use(res => {
|
||||
)
|
||||
|
||||
//request请求
|
||||
const request=function(cfg){
|
||||
if(cfg.data){
|
||||
cfg.data=qs.stringify(cfg.data);
|
||||
const request = function (cfg) {
|
||||
if (cfg.data) {
|
||||
cfg.data = qs.stringify(cfg.data);
|
||||
}
|
||||
};
|
||||
//requestJson请求
|
||||
const requestJson=jsonRequest.request;
|
||||
const requestJson = jsonRequest.request;
|
||||
//get请求
|
||||
const get=formRequest.request;
|
||||
const get = formRequest.request;
|
||||
//post请求
|
||||
const post=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
const post = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
}
|
||||
return formRequest.post(url,data,config);
|
||||
return formRequest.post(url, data, config);
|
||||
}
|
||||
//postJson请求
|
||||
const postJson=jsonRequest.post;
|
||||
const postJson = jsonRequest.post;
|
||||
//put请求
|
||||
const put=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
const put = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
}
|
||||
return formRequest.put(url,data,config);
|
||||
return formRequest.put(url, data, config);
|
||||
}
|
||||
//putJson请求
|
||||
const putJson=jsonRequest.put;
|
||||
const putJson = jsonRequest.put;
|
||||
//patch请求
|
||||
const patch=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
const patch = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
}
|
||||
return formRequest.patch(url,data,config);
|
||||
return formRequest.patch(url, data, config);
|
||||
}
|
||||
//patchJson请求
|
||||
const patchJson=jsonRequest.patch;
|
||||
const patchJson = jsonRequest.patch;
|
||||
//delete请求
|
||||
const del=formRequest.delete;
|
||||
const del = formRequest.delete;
|
||||
|
||||
|
||||
export default {
|
||||
|
||||
@@ -17,12 +17,12 @@ import errorCode from '@/utils/errorCode'
|
||||
*delete请求 axios.delete(url[, config])
|
||||
*/
|
||||
|
||||
const ReLoginUrl="/login";
|
||||
const TokenName='XBOE-Access-Token';
|
||||
const ReLoginUrl = "/login";
|
||||
const TokenName = 'XBOE-Access-Token';
|
||||
/**axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'**/
|
||||
//只是用于发送json对象数据时使用post,put,patch
|
||||
const jsonRequest=axios.create({
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
const jsonRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_CESOURCE_BASE_API,
|
||||
//超时
|
||||
@@ -45,25 +45,30 @@ jsonRequest.interceptors.request.use(config => {
|
||||
jsonRequest.interceptors.response.use(res => {
|
||||
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code === 401){
|
||||
} else {
|
||||
if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = this.webBaseUrl + ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
// location.href = this.webBaseUrl + ReLoginUrl;
|
||||
})
|
||||
}else if(code===403){
|
||||
var msg='当前操作没有权限';
|
||||
Message({message: msg, type: 'error'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
}else{
|
||||
} else {
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err:' + res.data.error);
|
||||
return res.data;
|
||||
//return Promise.reject(new Error(res.data.message))
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
@@ -86,8 +91,8 @@ jsonRequest.interceptors.response.use(res => {
|
||||
)
|
||||
|
||||
//用于普通的发送请求
|
||||
const formRequest=axios.create({
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'},
|
||||
const formRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_CESOURCE_BASE_API,
|
||||
//超时
|
||||
@@ -107,24 +112,29 @@ formRequest.interceptors.request.use(config => {
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code === 401){
|
||||
} else {
|
||||
if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = this.webBaseUrl + ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
// location.href = this.webBaseUrl + ReLoginUrl;
|
||||
})
|
||||
}else if(code===403){
|
||||
var msg='当前操作没有权限';
|
||||
Message({message: msg, type: 'error'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
}else{
|
||||
} else {
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err' + res.data.error);
|
||||
return res.data
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
@@ -147,44 +157,44 @@ formRequest.interceptors.response.use(res => {
|
||||
)
|
||||
|
||||
//request请求
|
||||
const request=function(cfg){
|
||||
if(cfg.data){
|
||||
cfg.data=qs.stringify(cfg.data);
|
||||
const request = function (cfg) {
|
||||
if (cfg.data) {
|
||||
cfg.data = qs.stringify(cfg.data);
|
||||
}
|
||||
};
|
||||
//requestJson请求
|
||||
const requestJson=jsonRequest.request;
|
||||
const requestJson = jsonRequest.request;
|
||||
//get请求
|
||||
const get=formRequest.request;
|
||||
const get = formRequest.request;
|
||||
//post请求
|
||||
const post=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
const post = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
}
|
||||
return formRequest.post(url,data,config);
|
||||
return formRequest.post(url, data, config);
|
||||
}
|
||||
//postJson请求
|
||||
const postJson=jsonRequest.post;
|
||||
const postJson = jsonRequest.post;
|
||||
//put请求
|
||||
const put=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
const put = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
}
|
||||
return formRequest.put(url,data,config);
|
||||
return formRequest.put(url, data, config);
|
||||
}
|
||||
//putJson请求
|
||||
const putJson=jsonRequest.put;
|
||||
const putJson = jsonRequest.put;
|
||||
//patch请求
|
||||
const patch=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
const patch = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
}
|
||||
return formRequest.patch(url,data,config);
|
||||
return formRequest.patch(url, data, config);
|
||||
}
|
||||
//patchJson请求
|
||||
const patchJson=jsonRequest.patch;
|
||||
const patchJson = jsonRequest.patch;
|
||||
//delete请求
|
||||
const del=formRequest.delete;
|
||||
const del = formRequest.delete;
|
||||
|
||||
|
||||
export default {
|
||||
|
||||
@@ -17,12 +17,12 @@ import errorCode from '@/utils/errorCode'
|
||||
*delete请求 axios.delete(url[, config])
|
||||
*/
|
||||
|
||||
const ReLoginUrl="/login";
|
||||
const TokenName='XBOE-Access-Token';
|
||||
const ReLoginUrl = "/login";
|
||||
const TokenName = 'XBOE-Access-Token';
|
||||
/**axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'**/
|
||||
//只是用于发送json对象数据时使用post,put,patch
|
||||
const jsonRequest=axios.create({
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
const jsonRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_STAT_BASE_API,
|
||||
//超时
|
||||
@@ -45,25 +45,30 @@ jsonRequest.interceptors.request.use(config => {
|
||||
jsonRequest.interceptors.response.use(res => {
|
||||
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code === 401){
|
||||
} else {
|
||||
if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = this.webBaseUrl + ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
// location.href = this.webBaseUrl + ReLoginUrl;
|
||||
})
|
||||
}else if(code===403){
|
||||
var msg='当前操作没有权限';
|
||||
Message({message: msg, type: 'error'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
}else{
|
||||
} else {
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err:' + res.data.error);
|
||||
return res.data;
|
||||
//return Promise.reject(new Error(res.data.message))
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
@@ -86,8 +91,8 @@ jsonRequest.interceptors.response.use(res => {
|
||||
)
|
||||
|
||||
//用于普通的发送请求
|
||||
const formRequest=axios.create({
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'},
|
||||
const formRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_STAT_BASE_API,
|
||||
//超时
|
||||
@@ -107,24 +112,29 @@ formRequest.interceptors.request.use(config => {
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code === 401){
|
||||
} else {
|
||||
if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = this.webBaseUrl + ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
// location.href = this.webBaseUrl + ReLoginUrl;
|
||||
})
|
||||
}else if(code===403){
|
||||
var msg='当前操作没有权限';
|
||||
Message({message: msg, type: 'error'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
}else{
|
||||
} else {
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err' + res.data.error);
|
||||
return res.data
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
@@ -147,44 +157,44 @@ formRequest.interceptors.response.use(res => {
|
||||
)
|
||||
|
||||
//request请求
|
||||
const request=function(cfg){
|
||||
if(cfg.data){
|
||||
cfg.data=qs.stringify(cfg.data);
|
||||
const request = function (cfg) {
|
||||
if (cfg.data) {
|
||||
cfg.data = qs.stringify(cfg.data);
|
||||
}
|
||||
};
|
||||
//requestJson请求
|
||||
const requestJson=jsonRequest.request;
|
||||
const requestJson = jsonRequest.request;
|
||||
//get请求
|
||||
const get=formRequest.request;
|
||||
const get = formRequest.request;
|
||||
//post请求
|
||||
const post=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
const post = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
}
|
||||
return formRequest.post(url,data,config);
|
||||
return formRequest.post(url, data, config);
|
||||
}
|
||||
//postJson请求
|
||||
const postJson=jsonRequest.post;
|
||||
const postJson = jsonRequest.post;
|
||||
//put请求
|
||||
const put=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
const put = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
}
|
||||
return formRequest.put(url,data,config);
|
||||
return formRequest.put(url, data, config);
|
||||
}
|
||||
//putJson请求
|
||||
const putJson=jsonRequest.put;
|
||||
const putJson = jsonRequest.put;
|
||||
//patch请求
|
||||
const patch=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
const patch = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
}
|
||||
return formRequest.patch(url,data,config);
|
||||
return formRequest.patch(url, data, config);
|
||||
}
|
||||
//patchJson请求
|
||||
const patchJson=jsonRequest.patch;
|
||||
const patchJson = jsonRequest.patch;
|
||||
//delete请求
|
||||
const del=formRequest.delete;
|
||||
const del = formRequest.delete;
|
||||
|
||||
|
||||
export default {
|
||||
|
||||
@@ -1,55 +1,110 @@
|
||||
<template>
|
||||
<div class="portal-header">
|
||||
<div class="portal-top" :style="{color:textColor}">
|
||||
<div class="portal-top" :style="{ color: textColor }">
|
||||
<div class="portal-top-left">
|
||||
<div class="portal-top-logo">
|
||||
<img src="../assets/logo/logo-white.png" v-if="textColor == '#fff' || textColor == '#ffffff'" style="width:160px;height: 27px;" />
|
||||
<img src="../assets/logo/logo.png" v-else style="width:160px;height: 27px;" />
|
||||
<img
|
||||
src="../assets/logo/logo-white.png"
|
||||
v-if="textColor == '#fff' || textColor == '#ffffff'"
|
||||
style="width: 160px; height: 27px"
|
||||
/>
|
||||
<img
|
||||
src="../assets/logo/logo.png"
|
||||
v-else
|
||||
style="width: 160px; height: 27px"
|
||||
/>
|
||||
</div>
|
||||
<div class="portal-top-nav" v-if="userInfo.role === 1">
|
||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'index' ? activeNav : ''">
|
||||
<router-link to="/index" >首页
|
||||
<div
|
||||
class="top-nav"
|
||||
:style="{ color: textColor }"
|
||||
:class="current == 'index' ? activeNav : ''"
|
||||
>
|
||||
<router-link to="/index"
|
||||
>首页
|
||||
<div :class="current == 'index' ? 'nav-bottbor' : ''"></div>
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'course' ? activeNav : ''">
|
||||
<a @click="handleChangeCourse">课程
|
||||
<div
|
||||
class="top-nav"
|
||||
:style="{ color: textColor }"
|
||||
:class="current == 'course' ? activeNav : ''"
|
||||
>
|
||||
<a @click="handleChangeCourse"
|
||||
>课程
|
||||
<div :class="current == 'course' ? 'nav-bottbor' : ''"></div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'case' ? activeNav : ''">
|
||||
<router-link to="/case">案例
|
||||
<div
|
||||
class="top-nav"
|
||||
:style="{ color: textColor }"
|
||||
:class="current == 'case' ? activeNav : ''"
|
||||
>
|
||||
<router-link to="/case"
|
||||
>案例
|
||||
<div :class="current == 'case' ? 'nav-bottbor' : ''"></div>
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'article' ? activeNav : ''">
|
||||
<router-link to="/article">文章
|
||||
<div
|
||||
class="top-nav"
|
||||
:style="{ color: textColor }"
|
||||
:class="current == 'article' ? activeNav : ''"
|
||||
>
|
||||
<router-link to="/article"
|
||||
>文章
|
||||
<div :class="current == 'article' ? 'nav-bottbor' : ''"></div>
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'qa' ? activeNav : ''">
|
||||
<router-link to="/qa" >问答
|
||||
<div
|
||||
class="top-nav"
|
||||
:style="{ color: textColor }"
|
||||
:class="current == 'qa' ? activeNav : ''"
|
||||
>
|
||||
<router-link to="/qa"
|
||||
>问答
|
||||
<div :class="current == 'qa' ? 'nav-bottbor' : ''"></div>
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="top-nav">
|
||||
<el-dropdown placement="bottom" @command="handleCommand">
|
||||
<span class="el-dropdown-link" style="font-size:16px;cursor: pointer;" :style="{color:textColor}">专区</span>
|
||||
<span
|
||||
class="el-dropdown-link"
|
||||
style="font-size: 16px; cursor: pointer"
|
||||
:style="{ color: textColor }"
|
||||
>专区</span
|
||||
>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="zero">热点论坛</el-dropdown-item>
|
||||
<el-dropdown-item command="one" divided>BOE系列公开课</el-dropdown-item>
|
||||
<el-dropdown-item command="two" divided>Grow180</el-dropdown-item>
|
||||
<el-dropdown-item command="three" divided>管理者进阶</el-dropdown-item>
|
||||
<el-dropdown-item command="four" divided>U选小课堂</el-dropdown-item>
|
||||
<el-dropdown-item command="five" divided>社招新员工</el-dropdown-item>
|
||||
<el-dropdown-item command="one" divided
|
||||
>BOE系列公开课</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item command="two" divided
|
||||
>Grow180</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item command="three" divided
|
||||
>管理者进阶</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item command="four" divided
|
||||
>U选小课堂</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item command="five" divided
|
||||
>社招新员工</el-dropdown-item
|
||||
>
|
||||
<!-- <el-dropdown-item command="six" divided>贡献者专区</el-dropdown-item> -->
|
||||
<el-dropdown-item command="seven" divided>教师专区</el-dropdown-item>
|
||||
<el-dropdown-item command="seven" divided
|
||||
>教师专区</el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="top-nav">
|
||||
<el-dropdown placement="bottom" @command="handleContributor">
|
||||
<span class="el-dropdown-link" style="font-size:16px;cursor: pointer;" :style="{color:textColor}">贡献者大会</span>
|
||||
<span
|
||||
class="el-dropdown-link"
|
||||
style="font-size: 16px; cursor: pointer"
|
||||
:style="{ color: textColor }"
|
||||
>贡献者大会</span
|
||||
>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="three">2024</el-dropdown-item>
|
||||
<el-dropdown-item command="one" divided>2023</el-dropdown-item>
|
||||
@@ -58,18 +113,40 @@
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'follow' ? activeNav : ''">
|
||||
<router-link to="/follow">我的关注
|
||||
<div
|
||||
class="top-nav"
|
||||
:style="{ color: textColor }"
|
||||
:class="current == 'follow' ? activeNav : ''"
|
||||
>
|
||||
<router-link to="/follow"
|
||||
>我的关注
|
||||
<div :class="current == 'follow' ? 'nav-bottbor' : ''"></div>
|
||||
</router-link>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="portal-top-right">
|
||||
<div v-if="goSearch !=10 && userInfo.role === 1" style="position: relative;">
|
||||
<el-input class="portal-input" v-show="!hideSearch" placeholder="搜索全部" style="border-radius: 20px !important; " @keyup.enter.native="searchJump()" clearable maxlength="50" v-model="keyword" >
|
||||
<el-select v-if="current == 'index'" v-model="findType" style="width: 75px; border-radius:20px !important;" slot="prepend" placeholder="请选择">
|
||||
<div
|
||||
v-if="goSearch != 10 && userInfo.role === 1"
|
||||
style="position: relative"
|
||||
>
|
||||
<el-input
|
||||
class="portal-input"
|
||||
v-show="!hideSearch"
|
||||
placeholder="搜索全部"
|
||||
style="border-radius: 20px !important"
|
||||
@keyup.enter.native="searchJump()"
|
||||
clearable
|
||||
maxlength="50"
|
||||
v-model="keyword"
|
||||
>
|
||||
<el-select
|
||||
v-if="current == 'index'"
|
||||
v-model="findType"
|
||||
style="width: 75px; border-radius: 20px !important"
|
||||
slot="prepend"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option label="课程" value="1"></el-option>
|
||||
<el-option label="案例" value="2"></el-option>
|
||||
<el-option label="文章" value="3"></el-option>
|
||||
@@ -77,7 +154,14 @@
|
||||
<!-- <el-option label="专区" value="5"></el-option> -->
|
||||
</el-select>
|
||||
</el-input>
|
||||
<el-button v-show="!hideSearch" class="sear-but" @click="searchJump()" type="primary" size="mini">搜索</el-button>
|
||||
<el-button
|
||||
v-show="!hideSearch"
|
||||
class="sear-but"
|
||||
@click="searchJump()"
|
||||
type="primary"
|
||||
size="mini"
|
||||
>搜索</el-button
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="person-action">
|
||||
@@ -86,11 +170,25 @@
|
||||
<el-link v-else class="person-action-index" type="primary" style="margin-right:10px; color:#fff;" :href="`${webBaseUrl}${isTiao ? '/uc/study/task' : '/uc/study/courses'}`" :underline="false">个人中心</el-link> -->
|
||||
<!-- <el-link type="primary" @click="logout()" icon="el-icon-switch-button" :underline="false">退出</el-link> -->
|
||||
<div class="person-action-item">
|
||||
<el-badge class="person-action-index" :value="userMsg" :hidden="userMsg == 0">
|
||||
<el-tooltip content="消息" placement="bottom" effect="light" :visible-arrow="false" popper-class="text-tooltip">
|
||||
<el-badge
|
||||
class="person-action-index"
|
||||
:value="userMsg"
|
||||
:hidden="userMsg == 0"
|
||||
>
|
||||
<el-tooltip
|
||||
content="消息"
|
||||
placement="bottom"
|
||||
effect="light"
|
||||
:visible-arrow="false"
|
||||
popper-class="text-tooltip"
|
||||
>
|
||||
<!-- <el-link type="primary" :href="`${webBaseUrl}/message/center/index`" :underline="false"> -->
|
||||
<router-link to="/message/center/index">
|
||||
<svg-icon :style="{color:textColor}" style="margin-right: 0;font-size:22px;" icon-class="messfff"></svg-icon>
|
||||
<svg-icon
|
||||
:style="{ color: textColor }"
|
||||
style="margin-right: 0; font-size: 22px"
|
||||
icon-class="messfff"
|
||||
></svg-icon>
|
||||
</router-link>
|
||||
<!-- </el-link> -->
|
||||
</el-tooltip>
|
||||
@@ -99,40 +197,94 @@
|
||||
<div class="person-action-item">
|
||||
<el-dropdown class="person-action-index">
|
||||
<span class="el-dropdown-link">
|
||||
<span :style="{color:textColor}">学员</span>
|
||||
<i :style="{color:textColor}" class="el-icon-arrow-down el-icon--right"></i>
|
||||
<span :style="{ color: textColor }">学员</span>
|
||||
<i
|
||||
:style="{ color: textColor }"
|
||||
class="el-icon-arrow-down el-icon--right"
|
||||
></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item><router-link to="/index">学员</router-link></el-dropdown-item>
|
||||
<el-dropdown-item v-if="identity == 2 || identity == 5" @click.native="setCurIdentity(2)"><router-link to="/need/waitaudit">教师</router-link></el-dropdown-item>
|
||||
<el-dropdown-item v-if="identity == 3 || identity == 5" ><a :href="managerPath+'/learningpath'">管理员</a></el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
><router-link to="/index">学员</router-link></el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item
|
||||
v-if="identity == 2 || identity == 5"
|
||||
@click.native="setCurIdentity(2)"
|
||||
><router-link to="/need/waitaudit"
|
||||
>教师</router-link
|
||||
></el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item v-if="identity == 3 || identity == 5"
|
||||
><a :href="managerPath + '/learningpath'"
|
||||
>管理员</a
|
||||
></el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="person-action-item">
|
||||
<el-dropdown>
|
||||
<div class="el-dropdown-link" style="display:flex" :style="{color:textColor}">
|
||||
<div
|
||||
class="el-dropdown-link"
|
||||
style="display: flex"
|
||||
:style="{ color: textColor }"
|
||||
>
|
||||
<div class="person-action-index">
|
||||
<div v-if="userInfo.avatar !== '' " class="user-avatar">
|
||||
<img :src="userInfo.avatar" style="width: 35px;height: 35px;"/>
|
||||
<div v-if="userInfo.avatar !== ''" class="user-avatar">
|
||||
<img
|
||||
:src="userInfo.avatar"
|
||||
style="width: 35px; height: 35px"
|
||||
/>
|
||||
</div>
|
||||
<div v-else class="uavatar">
|
||||
<div v-if="sex === 1 "><img src="../../public/images/Avatarman.png" alt="" style="width: 30px;height: 30px;"></div>
|
||||
<div v-else><img src="../../public/images/Avatarwoman.png" alt="" style="width: 30px;height: 30px;"></div>
|
||||
<div v-if="sex === 1">
|
||||
<img
|
||||
src="../../public/images/Avatarman.png"
|
||||
alt=""
|
||||
style="width: 30px; height: 30px"
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
<img
|
||||
src="../../public/images/Avatarwoman.png"
|
||||
alt=""
|
||||
style="width: 30px; height: 30px"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div style="font-weight: 400;font-size: 16px; margin-top: 8px;">{{userInfo.name}}</div>
|
||||
</div>
|
||||
<div style="font-weight: 400; font-size: 16px; margin-top: 8px">
|
||||
{{ userInfo.name }}
|
||||
</div>
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="setCurIdentity(1)"><a :href="`${webBaseUrl}${isTiao ? '/uc/study/task' : '/uc/study/courses'}`">个人中心</a></el-dropdown-item>
|
||||
<el-dropdown-item><router-link :to="'/home/'+userInfo.aid">个人主页</router-link></el-dropdown-item>
|
||||
<el-dropdown-item @click.native="setCurIdentity(1)"
|
||||
><a
|
||||
:href="`${webBaseUrl}${
|
||||
isTiao ? '/uc/study/task' : '/uc/study/courses'
|
||||
}`"
|
||||
>个人中心</a
|
||||
></el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item
|
||||
><router-link :to="'/home/' + userInfo.aid"
|
||||
>个人主页</router-link
|
||||
></el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="person-action-item">
|
||||
|
||||
<div class="person-action-index pointer" :style="{color:textColor}" @click="logout()">
|
||||
<svg-icon style="margin-right: 4px;font-size:16px;" icon-class="white-out"></svg-icon>登出
|
||||
<div
|
||||
class="person-action-index pointer"
|
||||
:style="{ color: textColor }"
|
||||
@click="logout()"
|
||||
>
|
||||
<svg-icon
|
||||
style="margin-right: 4px; font-size: 16px"
|
||||
icon-class="white-out"
|
||||
></svg-icon
|
||||
>登出
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -142,95 +294,110 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters, mapActions } from 'vuex';
|
||||
import apiMessage from '@/api/system/message.js';
|
||||
import popup from '@/components/AlertPopup.vue';
|
||||
import yearMedal from '@/components/Popup/China2023.vue';
|
||||
import apiBoeCourse from '@/api/boe/course.js';
|
||||
import {userAvatarText} from "@/utils/tools.js";
|
||||
import { mapGetters, mapActions } from "vuex";
|
||||
import apiMessage from "@/api/system/message.js";
|
||||
import popup from "@/components/AlertPopup.vue";
|
||||
import yearMedal from "@/components/Popup/China2023.vue";
|
||||
import apiBoeCourse from "@/api/boe/course.js";
|
||||
import { userAvatarText } from "@/utils/tools.js";
|
||||
import apiCase from "@/api/modules/cases.js";
|
||||
export default {
|
||||
props: {
|
||||
current: {
|
||||
type: String,
|
||||
default: '',
|
||||
default: "",
|
||||
},
|
||||
hideSearch:{
|
||||
hideSearch: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
textColor:{
|
||||
textColor: {
|
||||
type: String,
|
||||
default: '',
|
||||
default: "",
|
||||
},
|
||||
goSearch:{
|
||||
goSearch: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
keywords:{
|
||||
type:String,
|
||||
default:''
|
||||
keywords: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
},
|
||||
components:{popup,yearMedal},
|
||||
components: { popup, yearMedal },
|
||||
computed: {
|
||||
...mapGetters(['userInfo','curIdentity', 'userMsg','identity','studyTaskCount']),
|
||||
...mapGetters([
|
||||
"userInfo",
|
||||
"curIdentity",
|
||||
"userMsg",
|
||||
"identity",
|
||||
"studyTaskCount",
|
||||
]),
|
||||
|
||||
avatarText(){
|
||||
avatarText() {
|
||||
return userAvatarText(this.userInfo.name);
|
||||
},
|
||||
activeNav(){
|
||||
activeNav() {
|
||||
return {
|
||||
'top-nav-active-blue': this.textColor=='#000000',
|
||||
'top-nav-active-white': this.textColor=='#fff' || this.textColor=='#ffffff',
|
||||
}
|
||||
"top-nav-active-blue": this.textColor == "#000000",
|
||||
"top-nav-active-white":
|
||||
this.textColor == "#fff" || this.textColor == "#ffffff",
|
||||
};
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
keywords(newval) {
|
||||
console.log(newval, 9999);
|
||||
if (this.findType == "1") {
|
||||
this.keyword = newval;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
keywords(newval){
|
||||
console.log(newval,9999);
|
||||
if(this.findType == '1'){
|
||||
this.keyword = newval
|
||||
}
|
||||
"$route.query.keyword": {
|
||||
handler(newval) {
|
||||
if (newval && this.current == "case") {
|
||||
this.keyword = newval;
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
popupConfig:{},
|
||||
ctx:process.env.VUE_APP_PUBLIC_PATH,
|
||||
managerPath:process.env.VUE_APP_MANAGER_PATH,
|
||||
popupConfig: {},
|
||||
ctx: process.env.VUE_APP_PUBLIC_PATH,
|
||||
managerPath: process.env.VUE_APP_MANAGER_PATH,
|
||||
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
|
||||
findType: '1',
|
||||
keyword: '',
|
||||
findType: "1",
|
||||
keyword: "",
|
||||
isTiao: false,
|
||||
sex:'',
|
||||
sex: "",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.sex = this.userInfo.sex;
|
||||
this.$store.dispatch('refrashMsg');
|
||||
this.$store.dispatch("refrashMsg");
|
||||
this.loadBoeData();
|
||||
// console.log('this.userInfo::',this.userInfo)
|
||||
//this.loadPopupConfig();
|
||||
},
|
||||
methods: {
|
||||
handleChangeCourse() {
|
||||
const paths = ["/course","/qualityCourse"]
|
||||
const paths = ["/course", "/qualityCourse"];
|
||||
// 如果是 课程 和 精品课程, 那么就不再重定向
|
||||
const needReload = paths.findIndex(e=> e === this.$route.path) === -1
|
||||
if (needReload) this.$router.push({path: paths[0]})
|
||||
const needReload = paths.findIndex((e) => e === this.$route.path) === -1;
|
||||
if (needReload) this.$router.push({ path: paths[0] });
|
||||
},
|
||||
|
||||
setCurIdentity(iden){
|
||||
this.$store.dispatch('SetCurIdentity',iden);
|
||||
setCurIdentity(iden) {
|
||||
this.$store.dispatch("SetCurIdentity", iden);
|
||||
},
|
||||
tomy(){
|
||||
console.log('lll')
|
||||
tomy() {
|
||||
console.log("lll");
|
||||
},
|
||||
loadBoeData() {
|
||||
if(this.studyTaskCount>0){
|
||||
if (this.studyTaskCount > 0) {
|
||||
this.isTiao = true;
|
||||
}else{
|
||||
} else {
|
||||
this.isTiao = false;
|
||||
}
|
||||
// let params = {
|
||||
@@ -248,18 +415,18 @@ export default {
|
||||
// }
|
||||
// });
|
||||
},
|
||||
handleContributor(val){
|
||||
handleContributor(val) {
|
||||
let urlPre = window.location.protocol + "//" + window.location.host;
|
||||
let obj = {
|
||||
one: urlPre + "/web/contributornew/index",
|
||||
two: urlPre + "/web/contributor/index",
|
||||
three: urlPre + "/web/contributor_2024/index"
|
||||
three: urlPre + "/web/contributor_2024/index",
|
||||
};
|
||||
window.open(obj[val]);
|
||||
},
|
||||
handleCommand(val) {
|
||||
if (val === "four") {
|
||||
window.open("https://m.qingxuetang.com/x/?appId=qxtcorp306130")
|
||||
window.open("https://m.qingxuetang.com/x/?appId=qxtcorp306130");
|
||||
// this.$emit('showClass',true)
|
||||
} else {
|
||||
let urlPre = window.location.protocol + "//" + window.location.host;
|
||||
@@ -272,83 +439,104 @@ export default {
|
||||
// four: 'https://m.qingxuetang.com/x/?appId=qxtcorp306130',
|
||||
five: urlPre + "/boe/new-employee/index.html",
|
||||
six: urlPre + "/web/contributor/index",
|
||||
seven: this.webBaseUrl + '/grateful/index'
|
||||
seven: this.webBaseUrl + "/grateful/index",
|
||||
};
|
||||
window.open(obj[val]);
|
||||
}
|
||||
},
|
||||
handleUcCommand(val) {
|
||||
if (val == 'uc') {
|
||||
window.location.href = `${this.webBaseUrl}${this.isTiao ? '/uc/study/task' : '/uc/study/courses'}`;
|
||||
} else if (val == 'logout') {
|
||||
if (val == "uc") {
|
||||
window.location.href = `${this.webBaseUrl}${
|
||||
this.isTiao ? "/uc/study/task" : "/uc/study/courses"
|
||||
}`;
|
||||
} else if (val == "logout") {
|
||||
this.logout();
|
||||
}
|
||||
},
|
||||
searchJump() {
|
||||
this.$emit('type1', '')
|
||||
if(this.current == 'index') {
|
||||
if (this.findType == '1') {
|
||||
if(this.keyword==''){return;}
|
||||
this.$emit("type1", "");
|
||||
if (this.current == "index") {
|
||||
if (this.findType == "1") {
|
||||
if (this.keyword == "") {
|
||||
return;
|
||||
}
|
||||
// 课程
|
||||
location.href=`${this.webBaseUrl}/course?keyword=${this.keyword}`;
|
||||
location.href = `${this.webBaseUrl}/course?keyword=${this.keyword}`;
|
||||
//window.open(`${this.webBaseUrl}/course?keyword=${this.keyword}`);
|
||||
} else if (this.findType == '2') {
|
||||
if(this.keyword==''){return;}
|
||||
} else if (this.findType == "2") {
|
||||
if (this.keyword == "") {
|
||||
return;
|
||||
}
|
||||
// 案例
|
||||
location.href=`${this.webBaseUrl}/case?keyword=${this.keyword}`;
|
||||
location.href = `${this.webBaseUrl}/case?keyword=${this.keyword}`;
|
||||
//window.open(`${this.webBaseUrl}/case?keyword=${this.keyword}`);
|
||||
} else if (this.findType == '3') {
|
||||
if(this.keyword==''){return;}
|
||||
} else if (this.findType == "3") {
|
||||
if (this.keyword == "") {
|
||||
return;
|
||||
}
|
||||
//文章
|
||||
location.href=`${this.webBaseUrl}/article?keyword=${this.keyword}`;
|
||||
location.href = `${this.webBaseUrl}/article?keyword=${this.keyword}`;
|
||||
//window.open(`${this.webBaseUrl}/article?keyword=${this.keyword}`);
|
||||
} else if (this.findType == '4') {
|
||||
if(this.keyword==''){return;}
|
||||
} else if (this.findType == "4") {
|
||||
if (this.keyword == "") {
|
||||
return;
|
||||
}
|
||||
// 问答
|
||||
location.href=`${this.webBaseUrl}/qa?keyword=${this.keyword}`;
|
||||
location.href = `${this.webBaseUrl}/qa?keyword=${this.keyword}`;
|
||||
//window.open(`${this.webBaseUrl}/qa?keyword=${this.keyword}`);
|
||||
} else if (this.findType == '5') {
|
||||
} else if (this.findType == "5") {
|
||||
// 专区,专区要单独的写,因为不是一个系统呀
|
||||
window.open(`${this.webBaseUrl}/zone?keyword=${this.keyword}`);
|
||||
}
|
||||
} else {
|
||||
this.$emit('emitInput',this.keyword)
|
||||
if(this.goSearch == 1) {
|
||||
if(this.keyword==''){return;}
|
||||
} else {
|
||||
this.$emit("emitInput", this.keyword);
|
||||
if (this.goSearch == 1) {
|
||||
if (this.keyword == "") {
|
||||
return;
|
||||
}
|
||||
// 课程
|
||||
location.href=`${this.webBaseUrl}/course?keyword=${this.keyword}`;
|
||||
location.href = `${this.webBaseUrl}/course?keyword=${this.keyword}`;
|
||||
} else if (this.goSearch == 2) {
|
||||
if(this.keyword==''){return;}
|
||||
if (this.keyword == "") {
|
||||
return;
|
||||
}
|
||||
// 案例
|
||||
// location.href=`${this.webBaseUrl}/case?keyword=${this.keyword}`;
|
||||
this.$router.push(`/case?keyword=${this.keyword}`)
|
||||
this.$router.push(`/case?keyword=${this.keyword}`);
|
||||
//window.open(`${this.webBaseUrl}/case?keyword=${this.keyword}`);
|
||||
} else if (this.goSearch == 3) {
|
||||
if(this.keyword==''){return;}
|
||||
if (this.keyword == "") {
|
||||
return;
|
||||
}
|
||||
//文章
|
||||
location.href=`${this.webBaseUrl}/article?keyword=${this.keyword}`;
|
||||
location.href = `${this.webBaseUrl}/article?keyword=${this.keyword}`;
|
||||
//window.open(`${this.webBaseUrl}/article?keyword=${this.keyword}`);
|
||||
} else if (this.goSearch == 4) {
|
||||
if(this.keyword==''){return;}
|
||||
if (this.keyword == "") {
|
||||
return;
|
||||
}
|
||||
// 问答
|
||||
location.href=`${this.webBaseUrl}/qa?keyword=${this.keyword}`;
|
||||
location.href = `${this.webBaseUrl}/qa?keyword=${this.keyword}`;
|
||||
//window.open(`${this.webBaseUrl}/qa?keyword=${this.keyword}`);
|
||||
} else if (this.goSearch == 5) {
|
||||
// 专区,专区要单独的写,因为不是一个系统呀
|
||||
window.open(`${this.webBaseUrl}/zone?keyword=${this.keyword}`);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
logout() {
|
||||
this.$confirm('您确定要退出系统吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
this.$confirm("您确定要退出系统吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$store.dispatch("LogOut").then(() => {
|
||||
//location.href = this.webBaseUrl + '/login';
|
||||
sessionStorage.setItem('dialog_session_show'+this.userInfo.aid,null); // 清除兴趣采集的"关闭"缓存
|
||||
sessionStorage.setItem(
|
||||
"dialog_session_show" + this.userInfo.aid,
|
||||
null
|
||||
); // 清除兴趣采集的"关闭"缓存
|
||||
location.href = process.env.VUE_APP_LOGIN_URL;
|
||||
});
|
||||
})
|
||||
@@ -356,49 +544,52 @@ export default {
|
||||
},
|
||||
//获取未读消息数量
|
||||
getMsgNum() {
|
||||
apiMessage.isRead().then(res => {
|
||||
apiMessage.isRead().then((res) => {
|
||||
if (res.status == 200) {
|
||||
this.msgNum = res.result;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped rel="stylesheet/scss" lang="scss">
|
||||
|
||||
::v-deep .el-dropdown-menu__item:not(.is-disabled):hover{
|
||||
::v-deep .el-dropdown-menu__item:not(.is-disabled):hover {
|
||||
background-color: #fff !important;
|
||||
color: #0059FF !important;
|
||||
color: #0059ff !important;
|
||||
}
|
||||
::v-deep.el-dropdown-menu {
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
border: none !important;
|
||||
}
|
||||
//定义消息的图标的样式,按ui,未完成
|
||||
.msg-icon{
|
||||
font-size:16px;
|
||||
background-color:#fff;
|
||||
border-radius:50%;
|
||||
//定义消息的图标的样式,按ui,未完成
|
||||
.msg-icon {
|
||||
font-size: 16px;
|
||||
background-color: #fff;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.top-nav-active-blue{
|
||||
color: #387DF7;
|
||||
a{color:#387DF7;}
|
||||
div{
|
||||
.top-nav-active-blue {
|
||||
color: #387df7;
|
||||
a {
|
||||
color: #387df7;
|
||||
}
|
||||
div {
|
||||
width: 75%;
|
||||
height: 4px;
|
||||
top: 75%;
|
||||
left: 13%;
|
||||
background: #387DF7;
|
||||
background: #387df7;
|
||||
border-radius: 5px;
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
.top-nav-active-white{
|
||||
.top-nav-active-white {
|
||||
color: #fff;
|
||||
a{color:#fff;}
|
||||
div{
|
||||
a {
|
||||
color: #fff;
|
||||
}
|
||||
div {
|
||||
width: 75%;
|
||||
height: 4px;
|
||||
top: 75%;
|
||||
@@ -409,15 +600,15 @@ text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.sear-but{
|
||||
.sear-but {
|
||||
position: absolute;
|
||||
bottom: 10%;
|
||||
right: 5px;
|
||||
}
|
||||
::v-deep .el-input__inner{
|
||||
::v-deep .el-input__inner {
|
||||
border-radius: 6px;
|
||||
border-right: none;
|
||||
}
|
||||
}
|
||||
::v-deep .el-badge__content.is-fixed {
|
||||
right: 10px;
|
||||
}
|
||||
@@ -426,42 +617,41 @@ text-align: center;
|
||||
// margin: 0 87px;
|
||||
height: 72px;
|
||||
display: flex;
|
||||
background: rgba(255,255,255,0.1);
|
||||
border: 1px solid rgba(61,61,61,0.15);
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid rgba(61, 61, 61, 0.15);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
.portal-top{
|
||||
.portal-top {
|
||||
width: 100%;
|
||||
margin: 0px 40px;
|
||||
display: flex;
|
||||
justify-content:space-between;
|
||||
.portal-top-left{
|
||||
justify-content: space-between;
|
||||
.portal-top-left {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
.portal-top-logo{
|
||||
|
||||
.portal-top-logo {
|
||||
}
|
||||
.portal-top-nav{
|
||||
.portal-top-nav {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
.portal-top-right{
|
||||
flex:1;
|
||||
.portal-top-right {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
//width: 1050px;
|
||||
.person-action{
|
||||
.person-action {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
margin-left: 10px;
|
||||
|
||||
.person-action-index{
|
||||
.person-action-index {
|
||||
//margin-left: 40px;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
@@ -476,20 +666,20 @@ text-align: center;
|
||||
// // right: 48px;
|
||||
// // }
|
||||
// }
|
||||
::v-deep.el-avatar{
|
||||
::v-deep.el-avatar {
|
||||
margin-right: 8px;
|
||||
img{
|
||||
img {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
.el-button{
|
||||
.el-button {
|
||||
margin-left: 15px;
|
||||
margin-top: 1px;
|
||||
// font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.person-action-item{
|
||||
.person-action-item {
|
||||
margin-left: 30px;
|
||||
}
|
||||
.top-nav {
|
||||
@@ -499,42 +689,42 @@ text-align: center;
|
||||
color: #000000;
|
||||
line-height: 72px;
|
||||
padding: 0px 10px;
|
||||
white-space:nowrap;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
//此处理应该移到单独的一个样式中比较好
|
||||
|
||||
@media screen and (max-width: 1366px){
|
||||
@media screen and (max-width: 1366px) {
|
||||
.top-nav {
|
||||
padding: 0px 10px;
|
||||
}
|
||||
.person-action-item{
|
||||
.person-action-item {
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1680px) and (min-width:1367px){
|
||||
@media screen and (max-width: 1680px) and (min-width: 1367px) {
|
||||
.top-nav {
|
||||
padding: 0px 15px;
|
||||
}
|
||||
.person-action-item{
|
||||
.person-action-item {
|
||||
margin-left: 30px;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1920px) and (min-width: 1681px){
|
||||
@media screen and (max-width: 1920px) and (min-width: 1681px) {
|
||||
.top-nav {
|
||||
padding: 0px 30px;
|
||||
}
|
||||
.person-action-item{
|
||||
.person-action-item {
|
||||
margin-left: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1921px){
|
||||
@media screen and (min-width: 1921px) {
|
||||
.top-nav {
|
||||
padding: 0px 40px;
|
||||
}
|
||||
.person-action-item{
|
||||
.person-action-item {
|
||||
margin-left: 45px;
|
||||
}
|
||||
}
|
||||
@@ -542,7 +732,6 @@ text-align: center;
|
||||
::v-deep .el-badge {
|
||||
.el-badge__content {
|
||||
top: 0px;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -553,7 +742,7 @@ text-align: center;
|
||||
// border: 1px solid #333333;
|
||||
border-radius: 0 20px 20px 0;
|
||||
border-left: none;
|
||||
background: rgba(255,255,255,0.12);
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
.message-count a {
|
||||
@@ -563,7 +752,6 @@ text-align: center;
|
||||
}
|
||||
::v-deep .el-badge {
|
||||
margin-top: 0 !important;
|
||||
|
||||
}
|
||||
::v-deep .el-link.el-link--primary:hover {
|
||||
color: #588afc;
|
||||
@@ -572,10 +760,10 @@ text-align: center;
|
||||
cursor: pointer;
|
||||
color: #000000;
|
||||
}
|
||||
.uavatar{
|
||||
div{
|
||||
.uavatar {
|
||||
div {
|
||||
border-radius: 50%;
|
||||
img{
|
||||
img {
|
||||
border-radius: 50%;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
@@ -587,11 +775,11 @@ text-align: center;
|
||||
font-size: 14px;
|
||||
margin-right: 8px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.user-avatar{
|
||||
}
|
||||
.user-avatar {
|
||||
display: inline-block;
|
||||
border-radius: 50%;
|
||||
img{
|
||||
img {
|
||||
border-radius: 50%;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
@@ -603,5 +791,5 @@ text-align: center;
|
||||
font-size: 14px;
|
||||
margin-right: 8px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -11,16 +11,16 @@ import xpage from '@/utils/xpage'
|
||||
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
||||
const whiteList = ['/login','/logout','/loading','/pc/loading','/500','/auth-redirect','/forget','/reset/password']
|
||||
const whiteList = ['/login', '/logout', '/loading', '/pc/loading', '/500', '/auth-redirect', '/forget', '/reset/password']
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
watermark.set("");
|
||||
//动态计算文件的路径
|
||||
let configPath=process.env.VUE_APP_FILE_RELATIVE_PATH;
|
||||
if(configPath.startsWith('http')){
|
||||
xpage.constants.fileBaseUrl=configPath;
|
||||
}else{
|
||||
xpage.constants.fileBaseUrl=window.location.protocol+'//'+window.location.host+configPath;
|
||||
let configPath = process.env.VUE_APP_FILE_RELATIVE_PATH;
|
||||
if (configPath.startsWith('http')) {
|
||||
xpage.constants.fileBaseUrl = configPath;
|
||||
} else {
|
||||
xpage.constants.fileBaseUrl = window.location.protocol + '//' + window.location.host + configPath;
|
||||
}
|
||||
|
||||
NProgress.start();
|
||||
@@ -28,21 +28,21 @@ router.beforeEach((to, from, next) => {
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
// 在免登录白名单,直接进入
|
||||
next()
|
||||
}else{
|
||||
if(getToken()){
|
||||
if(to.path === '/login'){
|
||||
} else {
|
||||
if (getToken()) {
|
||||
if (to.path === '/login') {
|
||||
// 如果是外部用户,把配置的路由跳转到个人中心
|
||||
if(store.getters.userInfo.role === 2){
|
||||
next({ path: process.env.VUE_APP_PUBLIC_PATH+'/uc/study/courses' })
|
||||
}else{
|
||||
next({ path: process.env.VUE_APP_PUBLIC_PATH+'/index' })
|
||||
if (store.getters.userInfo.role === 2) {
|
||||
next({ path: process.env.VUE_APP_PUBLIC_PATH + '/uc/study/courses' })
|
||||
} else {
|
||||
next({ path: process.env.VUE_APP_PUBLIC_PATH + '/index' })
|
||||
}
|
||||
NProgress.done();
|
||||
} else {
|
||||
//console.log('store.getters.userInfo:',store.getters.userInfo.role)
|
||||
// 如果是外部用户,把配置的路由跳转到个人中心
|
||||
if(store.getters.userInfo.role === 2){
|
||||
if(to.path === '/index' || to.path === '/course' || to.path === '/case' || to.path === '/article' ) location.href = '/pc/uc/study/task'
|
||||
if (store.getters.userInfo.role === 2) {
|
||||
if (to.path === '/index' || to.path === '/course' || to.path === '/case' || to.path === '/article') location.href = '/pc/uc/study/task'
|
||||
}
|
||||
//后续这里需要增加一定的控制
|
||||
if (!store.getters.init) {
|
||||
@@ -56,17 +56,17 @@ router.beforeEach((to, from, next) => {
|
||||
store.dispatch('resOwner/loadResOwners');
|
||||
store.dispatch('sysType/loadSysTypes');
|
||||
|
||||
store.commit('app/SET_INITDATA',true);
|
||||
store.commit('app/SET_INITDATA', true);
|
||||
//routers数据先使用固定的,以后在初始化接口中返回
|
||||
let myRouters=routers();
|
||||
store.dispatch('GenerateRoutes',{routers:myRouters}).then(accessRoutes=>{
|
||||
let myRouters = routers();
|
||||
store.dispatch('GenerateRoutes', { routers: myRouters }).then(accessRoutes => {
|
||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
||||
});
|
||||
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
store.commit('app/SET_INITDATA',false);
|
||||
store.commit('app/SET_INITDATA', false);
|
||||
//如果初始化错误,就不再执行了,不然会一直循环下去
|
||||
next({ path: '/500' })
|
||||
//NProgress.done();
|
||||
@@ -78,7 +78,7 @@ router.beforeEach((to, from, next) => {
|
||||
|
||||
}
|
||||
//next();
|
||||
}else{
|
||||
} else {
|
||||
|
||||
//next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
//设置之前的路径
|
||||
@@ -86,7 +86,12 @@ router.beforeEach((to, from, next) => {
|
||||
//console.log(location.href,'location.href');
|
||||
//let urlPre=window.location.protocol+'//'+window.location.host;
|
||||
//let backUrl=location.href.substring(urlPre.length); encodeURIComponent()
|
||||
location.href=process.env.VUE_APP_LOGIN_URL+"?returnUrl="+encodeURIComponent(location.href);
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = process.env.VUE_APP_LOGIN_URL + "?returnUrl=" + encodeURIComponent(location.href);
|
||||
} else {
|
||||
window.location.href = process.env.VUE_APP_LOGIN_URL + "?returnUrl=" + encodeURIComponent(location.href);
|
||||
}
|
||||
// location.href=process.env.VUE_APP_LOGIN_URL+"?returnUrl="+encodeURIComponent(location.href);
|
||||
NProgress.done()
|
||||
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ import errorCode from '@/utils/errorCode'
|
||||
|
||||
//const ReLoginUrl="/login";
|
||||
|
||||
const ReLoginUrl=process.env.VUE_APP_LOGIN_URL;
|
||||
const ReLoginUrl = process.env.VUE_APP_LOGIN_URL;
|
||||
|
||||
const TokenName='XBOE-Access-Token';
|
||||
const TokenName = 'XBOE-Access-Token';
|
||||
/**axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'**/
|
||||
//只是用于发送json对象数据时使用post,put,patch
|
||||
const jsonRequest=axios.create({
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
const jsonRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
//超时
|
||||
@@ -48,36 +48,56 @@ jsonRequest.interceptors.request.use(config => {
|
||||
jsonRequest.interceptors.response.use(res => {
|
||||
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code == 6001){ //针对于老系统的处理
|
||||
} else {
|
||||
if (code == 6001) { //针对于老系统的处理
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code === 401){
|
||||
} else if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code === 402){
|
||||
} else if (code === 402) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code===403){
|
||||
var msg='当前操作没有权限';
|
||||
Message({message: msg, type: 'error'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
//return res.data;
|
||||
}else if(code===302){
|
||||
location.href = ReLoginUrl;
|
||||
}else{
|
||||
} else if (code === 302) {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
} else {
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err:' + res.data.error);
|
||||
//return Promise.reject(new Error(res.data.message))
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
@@ -101,8 +121,8 @@ jsonRequest.interceptors.response.use(res => {
|
||||
)
|
||||
|
||||
//用于普通的发送请求
|
||||
const formRequest=axios.create({
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'},
|
||||
const formRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
//超时
|
||||
@@ -122,35 +142,55 @@ formRequest.interceptors.request.use(config => {
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code == 6001){ //针对于老系统的处理,因为老系统是字符串,所以这里不使用三等于号
|
||||
} else {
|
||||
if (code == 6001) { //针对于老系统的处理,因为老系统是字符串,所以这里不使用三等于号
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code === 401){
|
||||
} else if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code === 402){
|
||||
} else if (code === 402) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code===403){
|
||||
var msg='当前操作没有权限';
|
||||
Message({message: msg, type: 'error'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
}else if(code===302){
|
||||
location.href = ReLoginUrl;
|
||||
}else{
|
||||
} else if (code === 302) {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
} else {
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err' + res.data.error);
|
||||
//return Promise.reject(new Error(res.data.message))
|
||||
return res.data;//返回给用户做业务处理
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
@@ -174,48 +214,48 @@ formRequest.interceptors.response.use(res => {
|
||||
)
|
||||
|
||||
//request请求
|
||||
const request=function(cfg){
|
||||
if(cfg.data){
|
||||
cfg.data=qs.stringify(cfg.data);
|
||||
const request = function (cfg) {
|
||||
if (cfg.data) {
|
||||
cfg.data = qs.stringify(cfg.data);
|
||||
}
|
||||
};
|
||||
//requestJson请求
|
||||
const requestJson=jsonRequest.request;
|
||||
const requestJson = jsonRequest.request;
|
||||
//get请求
|
||||
const get=formRequest.request;
|
||||
const get = formRequest.request;
|
||||
//post请求
|
||||
const post=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
const post = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
}
|
||||
return formRequest.post(url,data,config);
|
||||
return formRequest.post(url, data, config);
|
||||
}
|
||||
//post请求
|
||||
const postForm=function(url,data,config){
|
||||
return formRequest.post(url,data,config);
|
||||
const postForm = function (url, data, config) {
|
||||
return formRequest.post(url, data, config);
|
||||
}
|
||||
//postJson请求
|
||||
const postJson=jsonRequest.post;
|
||||
const postJson = jsonRequest.post;
|
||||
//put请求
|
||||
const put=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
const put = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
}
|
||||
return formRequest.put(url,data,config);
|
||||
return formRequest.put(url, data, config);
|
||||
}
|
||||
//putJson请求
|
||||
const putJson=jsonRequest.put;
|
||||
const putJson = jsonRequest.put;
|
||||
//patch请求
|
||||
const patch=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
const patch = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
}
|
||||
return formRequest.patch(url,data,config);
|
||||
return formRequest.patch(url, data, config);
|
||||
}
|
||||
//patchJson请求
|
||||
const patchJson=jsonRequest.patch;
|
||||
const patchJson = jsonRequest.patch;
|
||||
//delete请求
|
||||
const del=formRequest.delete;
|
||||
const del = formRequest.delete;
|
||||
|
||||
|
||||
export default {
|
||||
|
||||
@@ -163,11 +163,12 @@
|
||||
<!-- 精品课模块 -->
|
||||
<div class="xcontent2-main">
|
||||
<div class="modules-title xindex-main" v-if="this.qusisityList.list.length > 0">
|
||||
<!-- <span class="modules-text" style="color: #3D86F4;">精品课</span> -->
|
||||
<!-- <span class="jin-text">精品课</span> -->
|
||||
<div class="jin-zhe"></div>
|
||||
<span class="quyer-tag" style="margin-left: 0px;">
|
||||
<!-- <img src="../assets/images/tutoring1.pn" alt=""> -->
|
||||
<img class="modules-text" style="height: 28px;" src="../assets/images/course/courseTitle.png" alt="">
|
||||
</span>
|
||||
|
||||
<span class="more">
|
||||
<router-link to="/qualityCourse">查看更多>></router-link>
|
||||
</span>
|
||||
@@ -2826,6 +2827,15 @@ export default {
|
||||
display: flex;
|
||||
|
||||
.modules-title {
|
||||
position: relative;
|
||||
.jin-zhe{
|
||||
width: 410px;
|
||||
height: 30px;
|
||||
background: #f7f7f9;
|
||||
position: absolute;
|
||||
left: 86px;
|
||||
|
||||
}
|
||||
.modules-text {
|
||||
height: 28px;
|
||||
font-size: 20px;
|
||||
@@ -3136,4 +3146,13 @@ export default {
|
||||
border: 1px solid #d9edf7;
|
||||
//overflow: hidden;
|
||||
}
|
||||
.jin-text{
|
||||
font-family: "Source Han Sans CN", "SourceHanSansCN", sans-serif !important;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
color: #3E87F5;
|
||||
// line-height: 29px;/
|
||||
text-align: justify;
|
||||
font-style: normal;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -5,56 +5,61 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Cookies from 'vue-cookies'
|
||||
import apiLogin from '@/api/login.js'
|
||||
import { getToken,setToken } from '@/utils/token'
|
||||
export default{
|
||||
mounted(){
|
||||
this.toUrl=this.$route.query.returnUrl;
|
||||
let token=getToken();
|
||||
let $this=this;
|
||||
if(!token){
|
||||
import Cookies from "vue-cookies";
|
||||
import apiLogin from "@/api/login.js";
|
||||
import { getToken, setToken } from "@/utils/token";
|
||||
export default {
|
||||
mounted() {
|
||||
this.toUrl = this.$route.query.returnUrl;
|
||||
let token = getToken();
|
||||
let $this = this;
|
||||
if (!token) {
|
||||
//console.log(token,'未获取token');
|
||||
setTimeout(function(){
|
||||
$this.curToken=getToken();
|
||||
if(!$this.curToken){
|
||||
setTimeout(function () {
|
||||
$this.curToken = getToken();
|
||||
if (!$this.curToken) {
|
||||
//console.log(token,'第二次未获取token');
|
||||
location.href = process.env.VUE_APP_LOGIN_URL;
|
||||
}else{
|
||||
if (top !== window) {
|
||||
// 判断当前是否在iframe内
|
||||
top.location.href = process.env.VUE_APP_LOGIN_URL;
|
||||
} else {
|
||||
window.location.href = process.env.VUE_APP_LOGIN_URL;
|
||||
}
|
||||
// location.href = process.env.VUE_APP_LOGIN_URL;
|
||||
} else {
|
||||
$this.boeLogin();
|
||||
}
|
||||
|
||||
},500);
|
||||
}else{
|
||||
this.curToken=token;
|
||||
}, 500);
|
||||
} else {
|
||||
this.curToken = token;
|
||||
this.boeLogin();
|
||||
}
|
||||
},
|
||||
data(){
|
||||
data() {
|
||||
return {
|
||||
curToken:'',
|
||||
toUrl:''
|
||||
}
|
||||
curToken: "",
|
||||
toUrl: "",
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
boeLogin(){
|
||||
apiLogin.boeLogin(this.curToken).then(rs=>{
|
||||
if(rs.status==200){
|
||||
methods: {
|
||||
boeLogin() {
|
||||
apiLogin.boeLogin(this.curToken).then((rs) => {
|
||||
if (rs.status == 200) {
|
||||
//setToken(rs.result.access_token);
|
||||
localStorage.setItem(this.$xpage.constants.newLoginKey,1);
|
||||
if(this.toUrl){
|
||||
location.href=this.toUrl;
|
||||
}else{
|
||||
this.$router.push({ path: "/index" })
|
||||
localStorage.setItem(this.$xpage.constants.newLoginKey, 1);
|
||||
if (this.toUrl) {
|
||||
location.href = this.toUrl;
|
||||
} else {
|
||||
this.$router.push({ path: "/index" });
|
||||
}
|
||||
//this.$router.push({ path: "/index" })
|
||||
}else{
|
||||
this.$message.error("登录失败:"+rs.message);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$message.error("登录失败:" + rs.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -2,17 +2,15 @@
|
||||
<div>
|
||||
<!-- 最大化状态的弹窗 -->
|
||||
<el-dialog
|
||||
v-show=" windowState === 'maximized'"
|
||||
v-if="dialogVisible"
|
||||
v-if="dialogVisible && windowState === 'maximized'"
|
||||
:visible="true"
|
||||
:close-on-click-modal="false"
|
||||
:show-close="true"
|
||||
@close="onClose"
|
||||
class="case-expert-dialog"
|
||||
:modal="false"
|
||||
:append-to-body="true"
|
||||
:fullscreen="false"
|
||||
top="10vh"
|
||||
top="0"
|
||||
v-resizeable
|
||||
v-draggable
|
||||
>
|
||||
@@ -35,6 +33,7 @@
|
||||
class="welcome-message"
|
||||
ref="messageContainer"
|
||||
@scroll="handleScroll"
|
||||
@wheel="handleWheel"
|
||||
>
|
||||
<div class="message-text" v-for="(item, index) in messageList" :key="index">
|
||||
<messages :messageData="item" :suggestions="suggestions" @getMinWindow="minimizeWindow"></messages>
|
||||
@@ -193,7 +192,7 @@ export default {
|
||||
left: parseInt(dialogEl.style.left),
|
||||
top: parseInt(dialogEl.style.top)
|
||||
};
|
||||
sessionStorage.setItem('aiCallDialogPosition', JSON.stringify(currentPosition));
|
||||
// sessionStorage.setItem('aiCallDialogPosition', JSON.stringify(currentPosition));
|
||||
|
||||
// 移除全局事件监听
|
||||
document.removeEventListener('mousemove', handleMouseMove);
|
||||
@@ -498,6 +497,9 @@ export default {
|
||||
watch: {
|
||||
dialogVisible: {
|
||||
handler(newVal) {
|
||||
console.log('dialogVisible发生变化');
|
||||
console.log(newVal);
|
||||
console.log(this.windowState);
|
||||
if (newVal) {
|
||||
this.$nextTick(() => {
|
||||
// 获取对话框元素
|
||||
@@ -514,12 +516,12 @@ export default {
|
||||
}
|
||||
|
||||
// 检查是否有保存的位置状态
|
||||
const savedPosition = sessionStorage.getItem('aiCallDialogPosition');
|
||||
if (savedPosition) {
|
||||
const { left, top } = JSON.parse(savedPosition);
|
||||
dialogEl.style.left = left + 'px';
|
||||
dialogEl.style.top = top + 'px';
|
||||
}
|
||||
// const savedPosition = sessionStorage.getItem('aiCallDialogPosition');
|
||||
// if (savedPosition) {
|
||||
// const { left, top } = JSON.parse(savedPosition);
|
||||
// dialogEl.style.left = left + 'px';
|
||||
// dialogEl.style.top = top + 'px';
|
||||
// }
|
||||
}
|
||||
|
||||
let doc = document.querySelector('.welcome-message')
|
||||
@@ -566,7 +568,7 @@ closeMinimizedWindow() {
|
||||
console.log('关闭弹窗')
|
||||
// 清除保存的状态
|
||||
sessionStorage.removeItem('aiCallDialogSize');
|
||||
sessionStorage.removeItem('aiCallDialogPosition');
|
||||
// sessionStorage.removeItem('aiCallDialogPosition');
|
||||
this.$emit('close')
|
||||
// 可以在这里执行其他逻辑
|
||||
},
|
||||
@@ -595,6 +597,7 @@ closeMinimizedWindow() {
|
||||
|
||||
// 处理加载状态
|
||||
handleLoading(status) {
|
||||
console.log('handleLoading---'+status);
|
||||
this.isLoading = status;
|
||||
},
|
||||
|
||||
@@ -655,6 +658,31 @@ closeMinimizedWindow() {
|
||||
}
|
||||
},
|
||||
|
||||
// 处理鼠标滚轮事件
|
||||
handleWheel(event) {
|
||||
const element = this.$refs.messageContainer;
|
||||
if (!element) return;
|
||||
|
||||
// 阻止事件冒泡,防止滚动底层页面
|
||||
event.stopPropagation();
|
||||
|
||||
// 计算滚动方向和距离
|
||||
const delta = event.deltaY || event.detail || event.wheelDelta;
|
||||
|
||||
// 检查是否可以继续滚动
|
||||
if (delta < 0 && element.scrollTop === 0) {
|
||||
// 向上滚动且已在顶部,阻止默认行为
|
||||
event.preventDefault();
|
||||
} else if (delta > 0 && element.scrollHeight - element.scrollTop <= element.clientHeight) {
|
||||
// 向下滚动且已在底部,阻止默认行为
|
||||
event.preventDefault();
|
||||
} else {
|
||||
// 允许在容器内滚动
|
||||
element.scrollTop += delta;
|
||||
event.preventDefault();
|
||||
}
|
||||
},
|
||||
|
||||
// 最小化窗口的点击事件处理方法
|
||||
onMinimizedWindowClick() {
|
||||
// 当点击最小化窗口时,如果dialogVisible为false,则通过事件通知父组件显示对话框
|
||||
@@ -669,6 +697,9 @@ closeMinimizedWindow() {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .el-dialog__wrapper{
|
||||
position: unset!important;
|
||||
}
|
||||
.case-expert-dialog {
|
||||
::v-deep .el-dialog{
|
||||
background: url("./components/u762.svg") no-repeat ;
|
||||
@@ -677,6 +708,8 @@ closeMinimizedWindow() {
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
pointer-events: auto;
|
||||
z-index: 2000;
|
||||
|
||||
//background-color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@
|
||||
type="textarea"
|
||||
class="input-placeholder"
|
||||
placeholder="有问题,尽管问"
|
||||
@keyup.enter.native="handleSend"
|
||||
@keyup.enter.native.prevent="handleSend"
|
||||
:disabled="disabled"
|
||||
:autosize="{ minRows: 2, maxRows: 4}"
|
||||
resize="none"
|
||||
@@ -56,7 +56,14 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSend() {
|
||||
handleSend(event) {
|
||||
// 阻止事件的默认行为和冒泡
|
||||
if (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
console.log('preventDefault');
|
||||
}
|
||||
console.log('handleSend');
|
||||
if (!this.inputContent.trim() || this.disabled) return
|
||||
// 添加用户消息到列表
|
||||
const userMessage = {
|
||||
|
||||
@@ -2590,7 +2590,7 @@ a.custom2 {
|
||||
}
|
||||
|
||||
.course-tags {
|
||||
margin: 5px 0;
|
||||
margin: 10px 0 0;
|
||||
min-height: 20px;
|
||||
}
|
||||
|
||||
|
||||
@@ -2477,6 +2477,10 @@ export default {
|
||||
background-color: #f4f4f5;
|
||||
border-color: #e9e9eb;
|
||||
}
|
||||
.course-tags {
|
||||
margin: 10px 0 0;
|
||||
min-height: 20px;
|
||||
}
|
||||
.course-tags ::v-deep .el-tag .keyword-highlight,
|
||||
.course-tags ::v-deep .el-tag .exact-match-highlight {
|
||||
color: #387DF7 !important;
|
||||
|
||||
Reference in New Issue
Block a user