mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 19:36:46 +08:00
修改课程分类全局接口
This commit is contained in:
28
src/main.js
28
src/main.js
@@ -21,7 +21,8 @@ import {USER_INFO, USER_PERMISSION, VALIDATE_TOKEN} from "@/api/apis";
|
|||||||
import * as api1 from "@/api/index1";
|
import * as api1 from "@/api/index1";
|
||||||
import {getCookieForName} from "@/api/method";
|
import {getCookieForName} from "@/api/method";
|
||||||
import components from './components'
|
import components from './components'
|
||||||
// import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import Cookies from "vue-cookies";
|
||||||
// axios.defaults.withCredentials = true;
|
// axios.defaults.withCredentials = true;
|
||||||
// import zhCN from 'ant-design-vue/es/locale/zh_CN';
|
// import zhCN from 'ant-design-vue/es/locale/zh_CN';
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
@@ -69,9 +70,32 @@ async function initDict(key) {
|
|||||||
store.commit("SET_DICT", {key, data: list});
|
store.commit("SET_DICT", {key, data: list});
|
||||||
}
|
}
|
||||||
const getDictList = (param) => api1.getDictTree({code: param,}).then((res) => res.data.data);
|
const getDictList = (param) => api1.getDictTree({code: param,}).then((res) => res.data.data);
|
||||||
|
const initDictTree = (key) => {
|
||||||
|
axios({
|
||||||
|
method: "get",
|
||||||
|
url: "/systemapi/xboe/type/tree-list",
|
||||||
|
params: {
|
||||||
|
sysResType: "1",
|
||||||
|
status: "1",
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
"XBOR-Access-token": Cookies.get("token"),
|
||||||
|
},
|
||||||
|
}).then(
|
||||||
|
(res) => {
|
||||||
|
console.log(res.data.result,'课程分类接口')
|
||||||
|
store.commit("SET_DICT", {key, data: res.data.result});
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
message.error(err);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
initDict("content_type"); //内容分类
|
|
||||||
|
// initDict("content_type"); //内容分类
|
||||||
|
initDictTree("content_type"); //内容分类,换成type/tree-list接口
|
||||||
initDict("project_level"); //项目级别
|
initDict("project_level"); //项目级别
|
||||||
initDict("project_sys"); //培训分类
|
initDict("project_sys"); //培训分类
|
||||||
initDict("project_pic"); //项目封面
|
initDict("project_pic"); //项目封面
|
||||||
|
|||||||
Reference in New Issue
Block a user