Commit 0c0fbd3b by 程彤

json数据 项目请求引用

parent 9bb503a4
import { getAction,} from '@/api/manage'
import { getAction,getJons} from '@/api/manage'
//组件事例专用,请无视
const getUserList = (params)=>getAction("/sys/user/list",params);
......@@ -6,7 +6,7 @@ const queryDepartTreeList = (params)=>getAction("/sysdepart/sysDepart/queryTreeL
export const ajaxGetDictItems = (code, params)=>getAction(`/sys/dict/getDictItems/${code}`,params);
const queryUserByDepId = (params)=>getAction("/sys/user/queryUserByDepId",params);
const queryUserRoleMap = (params)=>getAction("/sys/user/queryUserRoleMap",params);
const getJonslist =()=>getJons('/json/school-center-ui.json')
export {
......@@ -14,6 +14,7 @@ export {
queryDepartTreeList,
queryUserByDepId,
queryUserRoleMap,
getJonslist
}
......
......@@ -9,7 +9,12 @@ const api = {
}
export default api
export function getJons(url) {
return axios({
url: url,
method:'get' ,
})
}
//post
export function postAction(url,parameter) {
return axios({
......
......@@ -87,6 +87,9 @@ const err = (error) => {
// request interceptor
service.interceptors.request.use(config => {
if(config.url.indexOf('school-center-ui.json')!= -1){
config.baseURL =''
}
const token = Vue.ls.get(ACCESS_TOKEN)
if (token) {
config.headers[ 'Authorization' ] = token // 让每个请求携带自定义 token 请根据实际情况自行修改
......
......@@ -220,10 +220,11 @@
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="允许上网终端类型:">
<a-select v-decorator="[ 'universityTerminalType', {rules: [{ required: true, message: '允许上网终端类型'}]} ]" @change="changeTerminalType">
<a-select-option value="PC+手机">PC+手机</a-select-option>
<a-select-option value="仅PC">仅PC</a-select-option>
<a-select-option value="仅手机">仅手机</a-select-option>
<a-select-option value="1PC+1手机">1PC+1手机</a-select-option>
<!-- <a-select-option value="PC+手机">PC+手机</a-select-option>-->
<!-- <a-select-option value="仅PC">仅PC</a-select-option>-->
<!-- <a-select-option value="仅手机">仅手机</a-select-option>-->
<a-select-option v-for="d in broadbands" :key="d.value" :value="d.value" >{{d.name}}</a-select-option>
</a-select>
</a-form-item>
......@@ -306,7 +307,7 @@ import {cloneObject} from '@/utils/util';
import {getSchoolNames, initSubstName} from "../../../api/school-center/louZhang/louZhangManagerAPI";
import {mavonEditor} from "mavon-editor";
import "mavon-editor/dist/css/index.css";
import { getJonslist } from '@/api/api';
export default {
name: "university",
components: {
......@@ -314,6 +315,7 @@ export default {
},
data(){
return {
broadbands:[],
universityId: true,
universityName: '',
regularName: '',
......@@ -888,6 +890,12 @@ export default {
mounted() {
this.initSubstName();
this.getSchool();
getJonslist().then((res) => { //请求json文件
debugger
this.broadbands = res.school_center_productManagement_broadband;
this.$forceUpdate()
}).catch((ress) => {// 请求失败处理
});
}
}
</script>
......
{
"school-center/productManagement/broadband": [
{"value":"PC+手机","name":"PC+手机"},
{"value":"仅PC","name":"仅PC"},
{"value":"仅手机","name":"仅手机"},
{"value":"1PC+1手机","name":"1PC+1手机"}
]
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment