yujialong 4 years ago
parent 7581d38bd1
commit 44077cee02
  1. 10
      src/api/index.js
  2. 2
      src/pages/account/login/index.vue
  3. 109
      src/pages/client/add/index.vue
  4. 172
      src/pages/client/list/index.vue
  5. 33
      src/pages/exception/error/403/index.vue
  6. 33
      src/pages/exception/error/404/index.vue
  7. 2
      src/pages/quesBank/list/globalQuesBank.vue
  8. 221
      src/pages/quesBank/list/myQuesBank.vue
  9. 13
      src/pages/quesBank/list/quesDialog.vue
  10. 4
      src/pages/user/list/index.vue
  11. 2
      src/plugins/requests/index.js
  12. 12
      src/router/permission.js

@ -42,8 +42,8 @@ export default {
getStaff: `management/staff/getStaff`,
queryStaff: `management/staff/enterpriseList`,
updateStaff: `management/staff/updateStaff`,
exportFailureStaff: `management/staff/exportFailure`,
uploadFileStaff: `management/staff/uploadFile`,
exportFailureStaff: `${Setting.apiBaseURL}/management/staff/exportFailure`,
uploadFileStaff: `${Setting.apiBaseURL}/management/staff/uploadFile`,
downloadStaffTemp: `http://liuwanr.oss-cn-shenzhen.aliyuncs.com/xlsx/20201102/1604658763812.xlsx`,
// 角色管理
@ -70,8 +70,8 @@ export default {
deleteUser: `cjEnterprise/user/deleteUser`,
queryUser: `cjEnterprise/user/list`,
updateUser: `cjEnterprise/user/updateUser`,
uploadFileUser: `cjEnterprise/user/uploadFile`,
exportFailureUser: `cjEnterprise/user/exportFailure`,
uploadFileUser: `${Setting.apiBaseURL}/cjEnterprise/user/uploadFile`,
exportFailureUser: `${Setting.apiBaseURL}/cjEnterprise/user/exportFailure`,
downloadUserTemp: 'http://liuwanr.oss-cn-shenzhen.aliyuncs.com/xlsx/20201102/1604658619702.xlsx',
// 题库分类
@ -92,7 +92,7 @@ export default {
pageByCondition:`cjEnterprise/questions/pageByCondition`,
updateQuestions:`cjEnterprise/questions/update`,
getExcel:`cjEnterprise/questions/getExcel`,
impExcel:`cjEnterprise/questions/impExcel`,
impExcel:`${Setting.apiBaseURL}/cjEnterprise/questions/impExcel`,
// 共享相关
batchSave:`cjEnterprise/questionSharing/batchSave`,

@ -92,7 +92,7 @@ export default {
password: this.loginForm.password
}
this.login(data).then(() => {
let redirect = decodeURIComponent(this.$route.query.redirect || '/')
let redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : '/index'
this.$router.replace(redirect)
}).catch(() => {})
}

@ -1,70 +1,65 @@
<template>
<div>
<el-row :gutter="20">
<el-col :span="24">
<el-card shadow="hover" class="m-b-20">
<div class="flex j-between a-center">
<div class="per_title" v-throttle @click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school" v-text="isDetail ? '查看用户' : (id != '' ? '编辑客户' : '新增客户')"></span>
</div>
<el-button type="primary" size="small" round class="mag" v-if="!isDetail" v-throttle @click="saveAdd">确定</el-button>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<div class="flex j-between a-center">
<div class="per_title" v-throttle @click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school" v-text="isDetail ? '查看用户' : (id != '' ? '编辑客户' : '新增客户')"></span>
</div>
<el-button type="primary" size="small" round class="mag" v-if="!isDetail" v-throttle @click="saveAdd">确定</el-button>
</div>
</el-card>
<el-card shadow="hover">
<div>
<div class="p-title m-b-20">基本信息</div>
<el-card shadow="hover">
<div>
<div class="p-title m-b-20">基本信息</div>
<div>
<el-form :model="form" :rules="rules" ref="form" label-width="100px" class="flex j-center" :disabled="isDetail">
<el-col :span="6" style="margin-right: 60px;">
<el-form-item prop="countries" label="国家">
<el-select v-model="form.countries" clearable placeholder="请选择国家">
<el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-form-item>
<div>
<el-form :model="form" :rules="rules" ref="form" label-width="100px" class="flex j-center" :disabled="isDetail">
<el-col :span="6" style="margin-right: 60px;">
<el-form-item prop="countries" label="国家">
<el-select v-model="form.countries" clearable placeholder="请选择国家">
<el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="provinceId" label="省份">
<el-select v-model="form.provinceId" placeholder="" @change="getCity()" @clear="clearprovince()">
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="provinceId" label="省份">
<el-select v-model="form.provinceId" placeholder="" @change="getCity()" @clear="clearprovince()">
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="clientName" label="客户名称">
<el-input placeholder="请输入客户名称" v-model="form.clientName" @change="nameChange"></el-input>
</el-form-item>
<el-form-item prop="clientName" label="客户名称">
<el-input placeholder="请输入客户名称" v-model="form.clientName" @change="nameChange"></el-input>
</el-form-item>
<el-form-item prop="phone" label="手机号">
<el-input placeholder="请输入手机号" v-model="form.phone" maxlength="11"></el-input>
</el-form-item>
</el-col>
<el-form-item prop="phone" label="手机号">
<el-input placeholder="请输入手机号" v-model="form.phone" maxlength="11"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 60px;">
<el-form-item prop="type" label="客户类型">
<el-select v-model="form.type" placeholder="">
<el-option v-for="(item,index) in clientTypeList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-col :span="6" style="margin-left: 60px;">
<el-form-item prop="type" label="客户类型">
<el-select v-model="form.type" placeholder="">
<el-option v-for="(item,index) in clientTypeList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="cityId" label="城市">
<el-select v-model="form.cityId" :disabled="form.provinceId ? false : true" placeholder="">
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="cityId" label="城市">
<el-select v-model="form.cityId" :disabled="form.provinceId ? false : true" placeholder="">
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="contactPersonName" label="管理员姓名">
<el-input placeholder="请输入管理员姓名" v-model="form.contactPersonName"></el-input>
</el-form-item>
</el-col>
</el-form>
</div>
</div>
</el-card>
</el-col>
</el-row>
<el-form-item prop="contactPersonName" label="管理员姓名">
<el-input placeholder="请输入管理员姓名" v-model="form.contactPersonName"></el-input>
</el-form-item>
</el-col>
</el-form>
</div>
</div>
</el-card>
</div>
</template>

@ -1,95 +1,89 @@
<template>
<div>
<el-row :gutter="20">
<el-col :span="24">
<el-card shadow="hover" class="m-b-20">
<div>
<div class="p-title m-b-20">筛选</div>
<div>
<el-form label-width="80px">
<el-col :span="6">
<el-form-item label="国家">
<el-select v-model="form.countries" clearable placeholder="请选择国家">
<el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="省份">
<el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity()" @clear="clearprovince()">
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="城市">
<el-select v-model="form.city" clearable placeholder="请选择城市" :disabled="form.provinces ? false : true" @change="getData()">
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="请输入客户名称/管理员姓名/电话" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</el-form-item>
</el-col>
</el-form>
</div>
</div>
</el-card>
</el-col>
<el-card shadow="hover" class="m-b-20">
<div>
<div class="p-title m-b-20">筛选</div>
<div>
<el-form label-width="80px">
<el-col :span="6">
<el-form-item label="国家">
<el-select v-model="form.countries" clearable placeholder="请选择国家">
<el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="省份">
<el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity()" @clear="clearprovince()">
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="城市">
<el-select v-model="form.city" clearable placeholder="请选择城市" :disabled="form.provinces ? false : true" @change="getData()">
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="请输入客户名称/管理员姓名/电话" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</el-form-item>
</el-col>
</el-form>
</div>
</div>
</el-card>
<el-col :span="24">
<el-card shadow="hover">
<div class="flex j-between m-b-20">
<div class="p-title">客户列表</div>
<div>
<el-button type="primary" size="small" round @click="addcustomer" v-auth>新增客户</el-button>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth>批量删除</el-button>
</div>
</div>
<el-table :data="customerData" ref="table" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{scope.$index + (pageNo - 1) * pageSize + 1}}
</template>
</el-table-column>
<el-table-column prop="clientName" label="客户名称" align="center">
</el-table-column>
<el-table-column prop="provinceName" label="省份" align="center">
</el-table-column>
<el-table-column prop="cityName" label="城市" align="center">
</el-table-column>
<el-table-column prop="contactPersonName" label="管理员姓名" align="center">
</el-table-column>
<el-table-column prop="phone" label="手机号" align="center">
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)" v-auth>查看</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
<el-switch
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
@change="switchOff($event,scope.row,scope.$index)"
v-auth="'dashboard:禁用'"
></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo">
</el-pagination>
</div>
</el-card>
</el-col>
</el-row>
<el-card shadow="hover">
<div class="flex j-between m-b-20">
<div class="p-title">客户列表</div>
<div>
<el-button type="primary" size="small" round @click="addcustomer" v-auth>新增客户</el-button>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth>批量删除</el-button>
</div>
</div>
<el-table :data="customerData" ref="table" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{scope.$index + (pageNo - 1) * pageSize + 1}}
</template>
</el-table-column>
<el-table-column prop="clientName" label="客户名称" align="center">
</el-table-column>
<el-table-column prop="provinceName" label="省份" align="center">
</el-table-column>
<el-table-column prop="cityName" label="城市" align="center">
</el-table-column>
<el-table-column prop="contactPersonName" label="管理员姓名" align="center">
</el-table-column>
<el-table-column prop="phone" label="手机号" align="center">
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)" v-auth>查看</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
<el-switch
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
@change="switchOff($event,scope.row,scope.$index)"
v-auth="'dashboard:禁用'"
></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo">
</el-pagination>
</div>
</el-card>
</div>
</template>

@ -1,23 +1,26 @@
<template>
<div class="error-page">
<div class="error-code">4<span>0</span>3</div>
<div class="error-desc">啊哦~ 你没有权限访问该页面哦</div>
<div class="error-handle">
<router-link to="/">
<el-button type="primary" size="large">返回首页</el-button>
</router-link>
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>
</div>
</div>
<div class="error-page">
<div class="error-code">4<span>0</span>3</div>
<div class="error-desc">啊哦~ 你没有权限访问该页面哦</div>
<div class="error-handle">
<router-link to="/">
<el-button type="primary" size="large" @click="toIndex">返回首页</el-button>
</router-link>
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>
</div>
</div>
</template>
<script>
export default {
methods: {
goBack(){
this.$router.go(-1);
}
}
methods: {
toIndex(){
this.$router.push('/')
},
goBack(){
this.$router.go(-1);
}
}
}
</script>

@ -1,23 +1,26 @@
<template>
<div class="error-page">
<div class="error-code">4<span>0</span>4</div>
<div class="error-desc">啊哦~ 你所访问的页面不存在</div>
<div class="error-handle">
<router-link to="/">
<el-button type="primary" size="large">返回首页</el-button>
</router-link>
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>
</div>
</div>
<div class="error-page">
<div class="error-code">4<span>0</span>4</div>
<div class="error-desc">啊哦~ 你所访问的页面不存在</div>
<div class="error-handle">
<router-link to="/">
<el-button type="primary" size="large" @click="toIndex">返回首页</el-button>
</router-link>
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>
</div>
</div>
</template>
<script>
export default {
methods: {
goBack(){
this.$router.go(-1);
}
}
methods: {
toIndex(){
this.$router.push('/')
},
goBack(){
this.$router.go(-1);
}
}
}
</script>

@ -23,7 +23,7 @@
</el-form>
</div>
<div>
<el-input placeholder="请输入题库名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
<el-input placeholder="请输入题干/知识点" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div>
</div>

@ -1,120 +1,114 @@
<template>
<div>
<el-row :gutter="20">
<el-col :span="24">
<el-card shadow="hover" class="m-b-20">
<div class="p-title m-b-20">测评题库</div>
<div class="flex j-between">
<el-form label-width="80px">
<el-form-item class="no-mb" label="试题类型">
<el-select v-model="typeId" clearable placeholder="请选择试题类型" @change="getData">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-form-item>
</el-form>
<div>
<el-input
placeholder="请输入题干"
prefix-icon="el-icon-search"
v-model="keyword"
clearable
></el-input>
</div>
</div>
</el-card>
</el-col>
<el-card shadow="hover" class="m-b-20">
<div class="p-title m-b-20">测评题库</div>
<div class="flex j-between">
<el-form label-width="80px">
<el-form-item class="no-mb" label="试题类型">
<el-select v-model="typeId" clearable placeholder="请选择试题类型" @change="getData">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-form-item>
</el-form>
<div>
<el-input
placeholder="请输入题干/知识点"
prefix-icon="el-icon-search"
v-model="keyword"
clearable
></el-input>
</div>
</div>
</el-card>
<el-col :span="24">
<el-card shadow="hover" class="m-b-20">
<div class="flex j-between m-b-20">
<div class="p-title">题目列表</div>
<div>
<el-button
type="primary"
size="small"
round
@click="addTopics"
>单题上传</el-button>
<el-button
type="primary"
size="small"
round
@click="showimportVisible"
>批量上传</el-button>
<el-button
type="primary"
size="small"
round
@click="shareDataBatch"
>批量共享</el-button>
<!-- <el-button
type="primary"
size="small"
round
@click="cancelShareBatch"
>取消共享</el-button> -->
<el-button
type="primary"
size="small"
round
@click="delAllData"
>批量删除</el-button>
</div>
</div>
<el-card shadow="hover" class="m-b-20">
<div class="flex j-between m-b-20">
<div class="p-title">题目列表</div>
<div>
<el-button
type="primary"
size="small"
round
@click="addTopics"
>单题上传</el-button>
<el-button
type="primary"
size="small"
round
@click="showimportVisible"
>批量上传</el-button>
<el-button
type="primary"
size="small"
round
@click="shareDataBatch"
>批量共享</el-button>
<!-- <el-button
type="primary"
size="small"
round
@click="cancelShareBatch"
>取消共享</el-button> -->
<el-button
type="primary"
size="small"
round
@click="delAllData"
>批量删除</el-button>
</div>
</div>
<el-table
:data="listData"
ref="table"
row-key="id"
class="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
:reserve-selection="true"
></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template
slot-scope="scope"
>{{scope.$index + (page - 1) * pageSize + 1}}</template>
</el-table-column>
<el-table-column prop="questionStem" :show-overflow-tooltip="true" label="题干" align="center"></el-table-column>
<el-table-column prop="name" label="试题类型" width="120" align="center"></el-table-column>
<el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column>
<el-table-column prop="typeName" label="所属题库" width="140" align="center"></el-table-column>
<el-table-column prop="knowledgePoints" label="知识点" width="140" align="center"></el-table-column>
<el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column>
<el-table-column prop="createTime" label="上传时间" width="140" align="center"></el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看</el-button>
<el-button type="text" @click="edit(scope.row)">修改</el-button>
<el-button type="text" @click="delData(scope.row)">删除</el-button>
<el-button v-if="!scope.row.myShare" type="text" @click="share(scope.row)">共享</el-button>
<el-button v-else type="text" @click="cancelShare(scope.row)">取消共享</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination
background
@current-change="handleCurrentChange"
:current-page="page"
:page-size="pageSize"
layout="total,prev, pager, next"
:total="total"
></el-pagination>
</div>
</el-card>
</el-col>
</el-row>
<el-table
:data="listData"
ref="table"
row-key="id"
class="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
:reserve-selection="true"
></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template
slot-scope="scope"
>{{scope.$index + (page - 1) * pageSize + 1}}</template>
</el-table-column>
<el-table-column prop="questionStem" :show-overflow-tooltip="true" label="题干" align="center"></el-table-column>
<el-table-column prop="name" label="试题类型" width="120" align="center"></el-table-column>
<el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column>
<el-table-column prop="typeName" label="所属题库" width="140" align="center"></el-table-column>
<el-table-column prop="knowledgePoints" label="知识点" width="140" align="center"></el-table-column>
<el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column>
<el-table-column prop="createTime" label="上传时间" width="140" align="center"></el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看</el-button>
<el-button type="text" @click="edit(scope.row)">修改</el-button>
<el-button type="text" @click="delData(scope.row)">删除</el-button>
<el-button v-if="!scope.row.myShare" type="text" @click="share(scope.row)">共享</el-button>
<el-button v-else type="text" @click="cancelShare(scope.row)">取消共享</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination
background
@current-change="handleCurrentChange"
:current-page="page"
:page-size="pageSize"
layout="total,prev, pager, next"
:total="total"
></el-pagination>
</div>
</el-card>
<ques-dialog ref="quesDialog" :title="topicsTitle" :visible.sync="visible" :isDetail.sync="isDetail" @getData="dialogGetData" @closeTopics="closeTopics"></ques-dialog>
@ -343,7 +337,6 @@ export default {
}
},
downLoad() {
// location.href = 'http://192.168.31.152:8001/cjEnterprise/questions/getExcel'
location.href = 'http://39.108.250.202/cjEnterprise/题库导入模板.xlsx'
},
showimportVisible() {

@ -241,9 +241,18 @@ export default {
.catch(err => {})
},
getQuesBank() {
this.$get(this.api.getTypeByOneLever)
let data = {
pageNum: 1,
pageSize: 10000
}
this.$post(this.api.listByPage,data)
.then(res => {
this.quesBankList = res.data.list
let list = res.data.list.list
let result = list
list.map((n,i) => {
result = result.concat(n.secondColumn)
})
this.quesBankList = result
})
.catch(err => {})
},

@ -270,7 +270,7 @@ export default {
let data = {
userInfo: {
id: form.id,
isPort: 1,
isPort: 2,
userId: form.userId,
account: form.account,
clientId: form.clientId,
@ -282,7 +282,7 @@ export default {
},
userManagement: {
id: form.id,
isPort: 1,
isPort: 2,
userId: form.userId,
account: form.account,
clientId: form.clientId,

@ -6,7 +6,7 @@ import Setting from '@/setting'
const service = axios.create({
baseURL: Setting.apiBaseURL,
timeout: 5000
timeout: 50000
})
// post请求头

@ -8,10 +8,14 @@ router.beforeEach((to, from, next) => {
document.title = to.meta.title ? `${to.meta.title} | ${Setting.titleSuffix}` : Setting.titleSuffix;
const role = util.session.get(Setting.usernameKey);
if (!role && to.path !== '/login') {
next({
path: '/login',
query: {redirect: to.fullPath}
})
if(to.fullPath == '/'){
next('/login')
}else{
next({
path: '/login',
query: {redirect: to.fullPath}
})
}
} else if(role && to.path == '/login') {
next('/index')
} else {

Loading…
Cancel
Save