mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 11:26:45 +08:00
--demand 字典修改
This commit is contained in:
30
src/App.vue
30
src/App.vue
@@ -52,17 +52,14 @@ function beforeunloadHandler() {
|
||||
|
||||
function init() {
|
||||
getUserInfo();
|
||||
initDict("faceclassPic");
|
||||
initDict("faceclassClass");
|
||||
initDict("faceclassScene");
|
||||
initDict("projectLevel");
|
||||
initDict("projectSys");
|
||||
initDict("pathmapPic");
|
||||
initDict("projectClass");
|
||||
initDict("projectPic");
|
||||
initDict("sysType");
|
||||
getMemberInfo();
|
||||
getUserPermission();
|
||||
initDict("content_type"); //内容分类
|
||||
initDict("project_level"); //项目级别
|
||||
initDict("project_sys"); //培训分类
|
||||
initDict("project_pic"); //项目封面
|
||||
initDict("router_pic"); //路径图封面
|
||||
initDict("course_pic"); //课程封面
|
||||
}
|
||||
|
||||
function unloadHandler() {
|
||||
@@ -91,17 +88,8 @@ async function getUserInfo() {
|
||||
store.commit("SET_USER", userInfo.data.data);
|
||||
}
|
||||
|
||||
async function initDict(key, localStory = false) {
|
||||
let list;
|
||||
if (localStory) {
|
||||
list = localStorage.getItem(key);
|
||||
if (list) {
|
||||
store.commit("SET_DICT", {key, data: JSON.parse(list)});
|
||||
return;
|
||||
}
|
||||
}
|
||||
list = await getDictList(key);
|
||||
localStory && localStorage.setItem(key, JSON.stringify(list));
|
||||
async function initDict(key) {
|
||||
const list = await getDictList(key);
|
||||
store.commit("SET_DICT", {key, data: list});
|
||||
}
|
||||
|
||||
@@ -111,7 +99,7 @@ function getUserPermission(){
|
||||
})
|
||||
}
|
||||
|
||||
const getDictList = (param) => api1.getDictTree({setCode: param,}).then((res) => res.data.data);
|
||||
const getDictList = (param) => api1.getDictTree({code: param,}).then((res) => res.data.data);
|
||||
</script>
|
||||
<style lang="scss">
|
||||
#app {
|
||||
|
||||
Reference in New Issue
Block a user