mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 19:06:43 +08:00
ajax配置
This commit is contained in:
179
src/api/ajax.js
Normal file
179
src/api/ajax.js
Normal file
@@ -0,0 +1,179 @@
|
||||
import axios from 'axios'
|
||||
import qs from 'qs'
|
||||
import { Notification, MessageBox, Message } from 'element-ui'
|
||||
import store from '@/store'
|
||||
import { getToken } from '@/utils/token'
|
||||
import errorCode from '@/utils/errorCode'
|
||||
/**
|
||||
*request请求 axios.request(config)
|
||||
*requestJson请求 axios.request(config)
|
||||
*get请求 axios.get(url[, config])
|
||||
*post请求 axios.post(url[, data[, config]])
|
||||
*postJson请求 axios.post(url[, data[, config]])
|
||||
*put请求 axios.put(url[, data[, config]])
|
||||
*putJson请求 axios.put(url[, data[, config]])
|
||||
*patch请求 axios.patch(url[, data[, config]])
|
||||
*patchJson请求 axios.patch(url[, data[, config]])
|
||||
*delete请求 axios.delete(url[, config])
|
||||
*/
|
||||
|
||||
|
||||
// const ReLoginUrl=process.env.VUE_APP_LOGIN_URL;
|
||||
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({
|
||||
// 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 => {
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
return res.data
|
||||
}else{
|
||||
if(code === 401){
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = this.webBaseUrl + ReLoginUrl;
|
||||
})
|
||||
}else if(code===403){
|
||||
var msg='当前操作没有权限';
|
||||
Message({message: msg, type: 'error'});
|
||||
return Promise.reject(new Error(msg))
|
||||
}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;
|
||||
if (message == "Network Error") {
|
||||
message = "后端接口连接异常";
|
||||
}
|
||||
else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
}
|
||||
else if (message.includes("Request failed with status code")) {
|
||||
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
||||
}
|
||||
Message({
|
||||
message: message,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
})
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
/**
|
||||
* request请求,可以自定义参数
|
||||
*/
|
||||
const request=formRequest.request;
|
||||
|
||||
/**
|
||||
* get请求 ,只有url
|
||||
*/
|
||||
const get = function(baseURL,url){
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'get',
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* post请求
|
||||
* @param {Object} url
|
||||
* @param {Object} 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'}
|
||||
})
|
||||
}
|
||||
//post请求
|
||||
const postForm=function(baseURL,url,data){
|
||||
return request({
|
||||
baseURL,
|
||||
url,
|
||||
data,
|
||||
method: 'post',
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
});
|
||||
}
|
||||
// const postJson=jsonRequest.post;
|
||||
|
||||
const postJson=function(baseURL,url,postData){
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'post',
|
||||
data:postData,
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* put请求
|
||||
*/
|
||||
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'}
|
||||
})
|
||||
}
|
||||
|
||||
const putJson=function(baseURL,url,data){
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'put',
|
||||
data:data,
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
request,
|
||||
get,
|
||||
post,
|
||||
postJson,
|
||||
put,
|
||||
putJson,
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
// import ajax from '@/utils/xajax.js'
|
||||
import ajax from '../cesource/index.js';
|
||||
|
||||
|
||||
/**
|
||||
* 显示提取,一次性
|
||||
* */
|
||||
const list=function (){
|
||||
return ajax.get('/xboe/subgroup/m/guide/list');
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或编辑
|
||||
* */
|
||||
const save=function (data){
|
||||
return ajax.postJson('/xboe/subgroup/m/guide/save',data);
|
||||
}
|
||||
|
||||
|
||||
export default {
|
||||
list,
|
||||
save
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
// import ajax from '@/utils/xajax.js'
|
||||
import ajax from '../cesource/index.js';
|
||||
|
||||
|
||||
/**
|
||||
* 添加或编辑
|
||||
* @param 参数见设计文档
|
||||
* */
|
||||
const saveOrUpdate=function (data){
|
||||
return ajax.postJson('/xboe/subgroup/m/pageplace/saveOrUpdate',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据key获取资源信息
|
||||
* */
|
||||
|
||||
const detail=function (key){
|
||||
return ajax.get('/xboe/subgroup/m/pageplace/detail-key?key='+key);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
saveOrUpdate,
|
||||
detail
|
||||
}
|
||||
24
src/api/phase2/guide.js
Normal file
24
src/api/phase2/guide.js
Normal file
@@ -0,0 +1,24 @@
|
||||
// import ajax from '@/utils/xajax.js'
|
||||
import ajax from '../ajax';
|
||||
const baseURL = process.env.VUE_APP_CESOURCE_BASE_API;
|
||||
|
||||
|
||||
/**
|
||||
* 显示提取,一次性
|
||||
* */
|
||||
const list=function (){
|
||||
return ajax.get(baseURL,'/xboe/subgroup/m/guide/list');
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或编辑
|
||||
* */
|
||||
const save=function (data){
|
||||
return ajax.postJson(baseURL,'/xboe/subgroup/m/guide/save',data);
|
||||
}
|
||||
|
||||
|
||||
export default {
|
||||
list,
|
||||
save
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
// import ajax from '@/utils/xajax.js'
|
||||
import ajax from '../cesource/index.js';
|
||||
// import ajax from '../cesource/index.js';
|
||||
import ajax from '../ajax';
|
||||
const baseURL = process.env.VUE_APP_CESOURCE_BASE_API;
|
||||
|
||||
|
||||
/**
|
||||
@@ -7,21 +9,21 @@ import ajax from '../cesource/index.js';
|
||||
* @param 参数见设计文档
|
||||
* */
|
||||
const save=function (data){
|
||||
return ajax.postJson('/xboe/subgroup/m/noteinfo/save',data);
|
||||
return ajax.postJson(baseURL,'/xboe/subgroup/m/noteinfo/save',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
* */
|
||||
const detail=function (id){
|
||||
return ajax.get('/xboe/subgroup/m/noteinfo/detail?id='+id);
|
||||
return ajax.get(baseURL,'/xboe/subgroup/m/noteinfo/detail?id='+id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除笔记
|
||||
* */
|
||||
const del=function (id){
|
||||
return ajax.get('/xboe/subgroup/m/noteinfo/delete?id='+id);
|
||||
return ajax.get(baseURL,'/xboe/subgroup/m/noteinfo/delete?id='+id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -34,28 +36,28 @@ const del=function (id){
|
||||
* }
|
||||
* */
|
||||
const coursePage=function (query){
|
||||
return ajax.post('/xboe/subgroup/m/noteinfo/course',query);
|
||||
return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/course',query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我的指定课程笔记
|
||||
* */
|
||||
const myCourse=function (courseId){
|
||||
return ajax.get('/xboe/subgroup/m/noteinfo/mycourse?courseId='+courseId);
|
||||
return ajax.get(baseURL,'/xboe/subgroup/m/noteinfo/mycourse?courseId='+courseId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询笔记的修改历史
|
||||
* */
|
||||
const history=function (noteId){
|
||||
return ajax.get('/xboe/subgroup/m/noteinfo/modify/history?noteId='+noteId);
|
||||
return ajax.get(baseURL,'/xboe/subgroup/m/noteinfo/modify/history?noteId='+noteId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询我发布的,收藏的,点赞的笔记 弃用
|
||||
* */
|
||||
const pagelist=function (query){
|
||||
return ajax.get('/xboe/subgroup/m/noteinfo/pagelist',query);
|
||||
return ajax.get(baseURL,'/xboe/subgroup/m/noteinfo/pagelist',query);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,14 +68,14 @@ const pagelist=function (query){
|
||||
* courseId 课程id
|
||||
* */
|
||||
const query=function (data){
|
||||
return ajax.post('/xboe/subgroup/m/noteinfo/query',data);
|
||||
return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/query',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 课程列表 应该是当前用户记过笔记的课程
|
||||
* */
|
||||
const course=function (){
|
||||
return ajax.get('/xboe/subgroup/m/noteinfo/course');
|
||||
return ajax.get(baseURL,'/xboe/subgroup/m/noteinfo/course');
|
||||
}
|
||||
|
||||
export default {
|
||||
28
src/api/phase2/place.js
Normal file
28
src/api/phase2/place.js
Normal file
@@ -0,0 +1,28 @@
|
||||
// import ajax from '@/utils/xajax.js'
|
||||
// import ajax from '../cesource/index.js';
|
||||
import ajax from '../ajax'
|
||||
const baseURL = process.env.VUE_APP_CESOURCE_BASE_API;
|
||||
|
||||
|
||||
/**
|
||||
* 添加或编辑
|
||||
* @param 参数见设计文档
|
||||
* */
|
||||
const saveOrUpdate=function (data){
|
||||
return ajax.postJson(baseURL,'/xboe/subgroup/m/pageplace/saveOrUpdate',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据key获取资源信息
|
||||
* */
|
||||
|
||||
const detail=function (key){
|
||||
return ajax.get(baseURL,'/xboe/subgroup/m/pageplace/detail-key?key='+key);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
saveOrUpdate,
|
||||
detail
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
/**文章模块的相关处理*/
|
||||
import ajax from '@/utils/xajax.js'
|
||||
|
||||
// import ajax from '@/utils/xajax.js'
|
||||
import ajax from '../ajax'
|
||||
const baseURL = process.env.VUE_APP_STAT_BASE_API;
|
||||
/**
|
||||
* 发送事件,具体事件参考后台管理的事件查看
|
||||
*参数如下:
|
||||
@@ -19,7 +20,7 @@ import ajax from '@/utils/xajax.js'
|
||||
*
|
||||
*/
|
||||
const sendEvent = function(data) {
|
||||
return ajax.get('/xboe/m/stat/event/send');
|
||||
return ajax.get(baseURL,'/xboe/m/stat/event/send');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -28,7 +29,7 @@ const sendEvent = function(data) {
|
||||
* @param {Object} data 参数 []数组,10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数,空数组 返回用户的全部类型统计。
|
||||
*/
|
||||
const userTotal = function(aid,data) {
|
||||
return ajax.postJson('/xboe/m/stat/user/total/'+aid,data);
|
||||
return ajax.postJson(baseURL,'/xboe/m/stat/user/total/'+aid,data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,7 +44,7 @@ const userTotal = function(aid,data) {
|
||||
} data
|
||||
*/
|
||||
const userDynamicList = function(data) {
|
||||
return ajax.post('/xboe/m/stat/userdynamic/list',data);
|
||||
return ajax.post(baseURL,'/xboe/m/stat/userdynamic/list',data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,7 +53,7 @@ const userDynamicList = function(data) {
|
||||
* @param {Integer} days 整数,最近几天的记录
|
||||
*/
|
||||
const userCoinList = function(aid,days) {
|
||||
return ajax.get('xboe/m/stat/usercoinrecord/list?aid='+aid+'&days='+days);
|
||||
return ajax.get(baseURL,'xboe/m/stat/usercoinrecord/list?aid='+aid+'&days='+days);
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// import ajax from '@/utils/xajax.js'
|
||||
import ajax from '../cesource/index.js'
|
||||
// import ajax from '../cesource/index.js'
|
||||
import ajax from '../ajax';
|
||||
const baseURL = process.env.VUE_APP_CESOURCE_BASE_API;
|
||||
|
||||
|
||||
/**
|
||||
@@ -11,7 +13,7 @@ import ajax from '../cesource/index.js'
|
||||
* }
|
||||
* */
|
||||
const save=function (data){
|
||||
return ajax.postJson('/xboe/subgroup/m/userhobby/save',data);
|
||||
return ajax.postJson(baseURL,'/xboe/subgroup/m/userhobby/save',data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -19,14 +21,14 @@ const save=function (data){
|
||||
* 参数:下面那个接口的返回值直接传
|
||||
* */
|
||||
const list=function (data){
|
||||
return ajax.postJson('/xboe/subgroup/m/userhobby/list',data);
|
||||
return ajax.postJson(baseURL,'/xboe/subgroup/m/userhobby/list',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户兴趣关联的id
|
||||
* */
|
||||
const info=function (){
|
||||
return ajax.get('/xboe/subgroup/m/userhobby/info');
|
||||
return ajax.get(baseURL,'/xboe/subgroup/m/userhobby/info');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -34,14 +36,14 @@ const info=function (){
|
||||
* 参数是上一个接口 info查出来的返回值
|
||||
* */
|
||||
const update=function (data){
|
||||
return ajax.postJson('/xboe/subgroup/m/userhobby/update',data);
|
||||
return ajax.postJson(baseURL,'/xboe/subgroup/m/userhobby/update',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* */
|
||||
const del=function (id){
|
||||
return ajax.get('/xboe/subgroup/m/userhobby/delete?id='+id);
|
||||
return ajax.get(baseURL,'/xboe/subgroup/m/userhobby/delete?id='+id);
|
||||
}
|
||||
|
||||
export default {
|
||||
@@ -73,7 +73,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import apiNote from '@/api/modules/note.js';
|
||||
import apiNote from '@/api/phase2/note.js';
|
||||
import { mapGetters } from 'vuex';
|
||||
import {formatDate,formatSeconds} from '@/utils/datetime.js';
|
||||
import {testType,correctJudgment,numberToLetter} from '@/utils/tools.js';
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
<script>
|
||||
import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
||||
import { mapGetters } from 'vuex'
|
||||
import apiUserstart from '@/api/modules/userstart.js'
|
||||
// import apiUserstart from '@/api/modules/userstart.js'
|
||||
export default {
|
||||
name: 'UcHeader',
|
||||
computed:{
|
||||
|
||||
@@ -351,7 +351,7 @@ import courseImage from '@/components/Course/courseImage.vue';
|
||||
import articleImage from '@/components/Article/articleImage.vue';
|
||||
import { toScore,cutFullName} from '@/utils/tools.js';
|
||||
import { swiper, swiperSlide } from 'vue-awesome-swiper';
|
||||
import apiPlace from "@/api/modules/place.js"
|
||||
import apiPlace from "@/api/phase2/place.js"
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
|
||||
@@ -50,6 +50,28 @@
|
||||
<li>456</li>
|
||||
<li></li>
|
||||
</ul>
|
||||
<div>
|
||||
<p>TA的成就</p>
|
||||
<ul>
|
||||
<li>
|
||||
<img src="/images/medal.png" alt="">
|
||||
<p>跬步千里</p>
|
||||
<p>LV.1</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<p>可能感兴趣</p>
|
||||
<ul>
|
||||
<li>
|
||||
<img src="/images/Avatarwoman.png" />
|
||||
<div>
|
||||
<p>双子座</p>
|
||||
<p>你必须非常努力才能看起来毫不费力</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -120,7 +120,7 @@ import editItems from '@/components/Article/editItems.vue';
|
||||
import "quill/dist/quill.core.css";
|
||||
import "quill/dist/quill.snow.css";
|
||||
import "quill/dist/quill.bubble.css";
|
||||
import apiPlace from "@/api/modules/place.js"
|
||||
import apiPlace from "@/api/phase2/place.js"
|
||||
export default {
|
||||
components: { portalHeader, portalFooter,interactBar,comments,timeShow,author,editItems,portalFloatTools},
|
||||
computed: {
|
||||
|
||||
@@ -160,7 +160,7 @@ import apiUser from '@/api/system/user.js';
|
||||
import apiSearchterm from '@/api/modules/searchterm.js';
|
||||
import articleImage from '@/components/Article/articleImage.vue';
|
||||
import editItems from '@/components/Article/editItems.vue';
|
||||
import apiPlace from "@/api/modules/place.js"
|
||||
import apiPlace from "@/api/phase2/place.js"
|
||||
export default {
|
||||
name: 'index',
|
||||
components: { editItems,portalHeader, portalFooter,articleImage, portalFloatTools, interactBar, timeShow, author },
|
||||
|
||||
@@ -174,7 +174,7 @@ import apiDict from "@/api/modules/dict.js"
|
||||
import {encrypt} from '@/utils/jsencrypt.js';
|
||||
import cookies from 'vue-cookies'
|
||||
import {cutFullName} from "@/utils/tools.js";
|
||||
import apiPlace from "@/api/modules/place.js"
|
||||
import apiPlace from "@/api/phase2/place.js"
|
||||
import portalFloatTools from "@/components/PortalFloatTools.vue";
|
||||
export default {
|
||||
name: 'atticle',
|
||||
|
||||
@@ -230,7 +230,7 @@ import apiSearchterm from "@/api/modules/searchterm.js";
|
||||
import { deepClone } from "../../../utils";
|
||||
import apiDict from "@/api/modules/dict.js";
|
||||
import {cutFullName} from "@/utils/tools.js";
|
||||
import apiPlace from "@/api/modules/place.js"
|
||||
import apiPlace from "@/api/phase2/place.js"
|
||||
export default {
|
||||
name: "index",
|
||||
components: {
|
||||
|
||||
@@ -297,7 +297,7 @@ import courseImage from "@/components/Course/courseImage.vue";
|
||||
import { courseType, getType, toScore,formatDate } from "@/utils/tools.js";
|
||||
import { deepClone, param } from "../../../utils";
|
||||
import apiSearchterm from "@/api/modules/searchterm.js";
|
||||
import apiPlace from "@/api/modules/place.js"
|
||||
import apiPlace from "@/api/phase2/place.js"
|
||||
export default {
|
||||
name: "index",
|
||||
components: {
|
||||
|
||||
@@ -310,7 +310,7 @@ import apiUser from "@/api/system/user.js";
|
||||
import apiPraise from "@/api/modules/praises.js";
|
||||
import apiFavorites from "@/api/modules/favorites.js";
|
||||
import apiMessage from "@/api/system/message.js";
|
||||
import apiPlace from "@/api/modules/place.js"
|
||||
import apiPlace from "@/api/phase2/place.js"
|
||||
export default {
|
||||
name: "answer",
|
||||
components: {
|
||||
|
||||
@@ -224,7 +224,7 @@ import apiUser from "@/api/system/user.js";
|
||||
import apiPraise from "@/api/modules/praises.js";
|
||||
import apiFavorites from "@/api/modules/favorites.js";
|
||||
import apiMessage from "@/api/system/message.js";
|
||||
import apiPlace from "@/api/modules/place.js"
|
||||
import apiPlace from "@/api/phase2/place.js"
|
||||
export default {
|
||||
name: "answer",
|
||||
components: {
|
||||
|
||||
@@ -144,7 +144,7 @@ import addQuestion from '@/components/Qa/addQuestion.vue';
|
||||
import apiQa from '@/api/modules/qa.js';
|
||||
import apiUser from '@/api/system/user.js';
|
||||
import apiSearchterm from '@/api/modules/searchterm.js';
|
||||
import apiPlace from "@/api/modules/place.js"
|
||||
import apiPlace from "@/api/phase2/place.js"
|
||||
export default {
|
||||
name: 'qaindex',
|
||||
components: { portalHeader, portalFooter, portalFloatTools, WxEditor, addQuestion, author, interactBar, timeShow },
|
||||
|
||||
@@ -201,10 +201,8 @@ import apiStudy from '@/api/modules/courseStudy.js';
|
||||
import apiVideoStudy from "@/api/modules/videoStudy.js";
|
||||
import apiCourseGrade from '@/api/modules/courseGrade.js';
|
||||
import apiPraises from '@/api/modules/praises.js';
|
||||
import apiNote from '@/api/modules/note.js';
|
||||
import apiTrample from '@/api/modules/trample.js';
|
||||
import apiCoursePortal from '@/api/modules/coursePortal.js';
|
||||
import apiCourse from '@/api/modules/course.js';
|
||||
import apiUser from '@/api/system/user.js';
|
||||
import apiCourseFile from '@/api/modules/courseFile.js';
|
||||
import { resListMap, resOwnerListMap, courseType, getType, toScore,userAvatarText } from '@/utils/tools.js';
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
import accountApi from "@/api/account";
|
||||
import apiPassword from '@/api/boe/login.js'
|
||||
import imageUpload from '@/components/ImageUpload/index.vue';
|
||||
import apiUserhobby from "@/api/modules/userhobby.js"
|
||||
// import apiUserhobby from "@/api/modules/userhobby.js"
|
||||
const cityOptions = ['上海', '北京', '广州', '深圳'];
|
||||
export default{
|
||||
components:{imageUpload},
|
||||
@@ -215,12 +215,12 @@
|
||||
},
|
||||
methods:{
|
||||
getInfo() { //获取用户兴趣关联的id
|
||||
apiUserhobby.info().then(res=>{
|
||||
if(res.status == 200) {
|
||||
let data = res.result.map(item => item.refId);
|
||||
this.checkboxGroup = data;
|
||||
}
|
||||
})
|
||||
// apiUserhobby.info().then(res=>{
|
||||
// if(res.status == 200) {
|
||||
// let data = res.result.map(item => item.refId);
|
||||
// this.checkboxGroup = data;
|
||||
// }
|
||||
// })
|
||||
},
|
||||
handleClick(e){
|
||||
},
|
||||
@@ -236,13 +236,13 @@
|
||||
refId:item
|
||||
})
|
||||
})
|
||||
apiUserhobby.update(data).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.$message.success('更改成功!')
|
||||
} else {
|
||||
this.$message.error("更改失败!")
|
||||
}
|
||||
})
|
||||
// apiUserhobby.update(data).then(res=>{
|
||||
// if(res.status == 200) {
|
||||
// this.$message.success('更改成功!')
|
||||
// } else {
|
||||
// this.$message.error("更改失败!")
|
||||
// }
|
||||
// })
|
||||
},
|
||||
...mapActions({
|
||||
getResOwnerTree: 'resOwner/getResOwnerTree',
|
||||
|
||||
Reference in New Issue
Block a user