|
@@ -1,389 +1,105 @@
|
|
|
<template>
|
|
|
- <div class="mta-client-header">
|
|
|
- <el-row type="flex" class="header-wrap">
|
|
|
- <el-col class="header-col-wrap">
|
|
|
- <!-- logo -->
|
|
|
- <div class="header-col-logo">
|
|
|
- <img :src="logoImg" alt="logo">
|
|
|
- </div>
|
|
|
- <!-- nav -->
|
|
|
- <div class="header-col-nav">
|
|
|
- <el-menu
|
|
|
- :default-active="activeIndex"
|
|
|
- class="menu-client-header"
|
|
|
- :router="true"
|
|
|
- mode="horizontal"
|
|
|
- background-color="#1E1D22"
|
|
|
- text-color="#fff"
|
|
|
- :active-text-color="getThemeColor(0)">
|
|
|
- <template v-for="(item,index) in headerArr">
|
|
|
- <el-submenu :index="`${item.keyPath}`" v-if="item.children && item.children.length > 0"
|
|
|
- popper-class="mta-menu-two">
|
|
|
- <template slot="title">{{item.content}}</template>
|
|
|
- <el-menu-item :index="`${child.keyPath}`" v-for="child of item.children"
|
|
|
- :key="child.keyPath">{{child.content}}
|
|
|
- </el-menu-item>
|
|
|
- </el-submenu>
|
|
|
- <el-menu-item :index="`${item.keyPath}`" v-else>
|
|
|
- {{item.content}}
|
|
|
+ <nav class="website-head">
|
|
|
+ <div class="website-container head-layout">
|
|
|
+ <div class="head-left">
|
|
|
+ <a></a>
|
|
|
+ <el-menu
|
|
|
+ :default-active="activeIndex"
|
|
|
+ class="el-menu-demo"
|
|
|
+ :router="true"
|
|
|
+ mode="horizontal"
|
|
|
+ >
|
|
|
+ <template v-for="(item,index) in headerArr">
|
|
|
+ <el-submenu :index="`${item.keyPath}`" v-if="item.children && item.children.length > 0" popper-class="mta-menu-two">
|
|
|
+ <template slot="title">{{item.content}}</template>
|
|
|
+ <el-menu-item :index="`${child.keyPath}`" v-for="child of item.children"
|
|
|
+ :key="child.keyPath">{{child.content}}
|
|
|
</el-menu-item>
|
|
|
- </template>
|
|
|
- </el-menu>
|
|
|
- <nav>
|
|
|
- <ul>
|
|
|
- <li>
|
|
|
- <el-popover
|
|
|
- popper-class="nav-popover"
|
|
|
- placement="bottom"
|
|
|
- width="160"
|
|
|
- trigger="click"
|
|
|
- >
|
|
|
- <ul class="userControl">
|
|
|
- <li>
|
|
|
- <el-button type="text" icon="el-icon-key" @click="changePassword">
|
|
|
- 修改密码
|
|
|
- </el-button>
|
|
|
- </li>
|
|
|
- <li v-if="!(getTenantCode === 'admin')">
|
|
|
- <el-button type="text" icon="el-icon-s-order" @click="changeInformation">
|
|
|
- 修改资料
|
|
|
- </el-button>
|
|
|
- </li>
|
|
|
- <li>
|
|
|
- <el-button type="text" icon="el-icon-setting" @click="exitSystem">退出系统
|
|
|
- </el-button>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- <span class="h-right-img" slot="reference">
|
|
|
- <img :src="headerImg" alt="头像">
|
|
|
- <span></span>
|
|
|
- </span>
|
|
|
- </el-popover>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- </nav>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-dialog
|
|
|
- title="修改密码"
|
|
|
- :visible.sync="headerPasswordDialog"
|
|
|
- :close-on-click-modal="false"
|
|
|
- class="response-small-dialog"
|
|
|
- @close="closePassDl"
|
|
|
- center>
|
|
|
- <el-form :model="HeaderPassChangeDate" status-icon :rules="HeaderPassRules" ref="ruleHeaderForm"
|
|
|
- class="demo-ruleForm2" label-width="100px">
|
|
|
- <el-form-item label="原始密码:" prop="orgPass">
|
|
|
- <el-input v-model="HeaderPassChangeDate.orgPass"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="新的密码:" prop="pass">
|
|
|
- <el-input type="password" v-model="HeaderPassChangeDate.pass" autocomplete="off"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="确认密码:" prop="checkPass">
|
|
|
- <el-input type="password" v-model="HeaderPassChangeDate.checkPass" autocomplete="off"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ </el-submenu>
|
|
|
+ <el-menu-item :index="`${item.keyPath}`" v-else>
|
|
|
+ {{item.content}}
|
|
|
+ </el-menu-item>
|
|
|
+ </template>
|
|
|
+ </el-menu>
|
|
|
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="headerPasswordDialog = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="saveHeaderPass">确 定</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
- <el-dialog
|
|
|
- title="资料编辑"
|
|
|
- :visible.sync="editorMessage"
|
|
|
- :close-on-click-modal="false"
|
|
|
- @close="ClosePassDl2('editorUserInfo')"
|
|
|
- class="response-big-dialog"
|
|
|
- center>
|
|
|
- <el-form ref="formUserInfor" :rules="formRules3" status-icon :model="userInfoData" label-width="85px">
|
|
|
- <div class="editorUserWrap">
|
|
|
- <div>
|
|
|
- <el-form-item label="用户名:" prop="userName">
|
|
|
- <el-input v-model="userInfoData.userName"
|
|
|
- @blur="formatDataFun(userInfoData.userName)"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="真实姓名:" prop="realName">
|
|
|
- <el-input v-model="userInfoData.realName"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="出生年月:" prop="birthday">
|
|
|
- <el-date-picker
|
|
|
- v-model="userInfoData.birthday"
|
|
|
- type="date"
|
|
|
- :default-value="userInfoData.defaultBirthday"
|
|
|
- format="yyyy-MM-dd"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- placeholder="选择日期">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="电话号码:" prop="tel">
|
|
|
- <el-input v-model="userInfoData.tel"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <el-form-item label="性别:" prop="gender" label-width="90px">
|
|
|
- <el-radio-group v-model="userInfoData.gender">
|
|
|
- <el-radio border :label="1">男</el-radio>
|
|
|
- <el-radio border :label="2">女</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="邮箱:" prop="email" label-width="90px">
|
|
|
- <el-input v-model="userInfoData.email"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="身份证号:" prop="idcard" label-width="90px">
|
|
|
- <el-input v-model="userInfoData.idcard"></el-input>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <!--<mta-upload-al-cloud :imageUrl="imageUrl"
|
|
|
- @uploadFileStart="uploadFileStart"></mta-upload-al-cloud>-->
|
|
|
- <upload-file :imageUrl="imageUrl" :showBtnFlag="false"
|
|
|
- @getFileUrl="getImageUrl"></upload-file>
|
|
|
- <h5 class="picture-size-h5">(最佳尺寸为65*65像素)</h5>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-form>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="cancelSaveUserInfo">取 消</el-button>
|
|
|
- <el-button type="primary" @click="saveUserInfo">确 定</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <div class="head-right">
|
|
|
+ <i></i><span>4000-522-130</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </nav>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { getUploadImg } from '@/api/AlCloud';
|
|
|
import MtaUploadAlCloud
|
|
|
from '@/components/management/Layout/UploadAlCloud/UploadAlCloud';
|
|
|
import axios from 'axios';
|
|
|
import { mapGetters } from 'vuex';
|
|
|
import { setAuth, removeAuth } from '@/utils/auth';
|
|
|
- import {
|
|
|
- getAdminUserMypass,
|
|
|
- getClientUserMyUpdate,
|
|
|
- getClentUserMyInfo,
|
|
|
- getExitStatus,
|
|
|
- } from '@/api/user';
|
|
|
- import {
|
|
|
- setUserIcon,
|
|
|
- checkUrlIsNotHttpUrl,
|
|
|
- getTrimData,
|
|
|
- } from '@/utils/common';
|
|
|
+
|
|
|
+ import { setUserIcon, checkUrlIsNotHttpUrl, getTrimData, } from '@/utils/common';
|
|
|
import { initThemeColor } from '@/utils/theme';
|
|
|
- import uploadFile from '@/components/management/Layout/UploadAlCloud/uploadFile';
|
|
|
|
|
|
export default {
|
|
|
name: 'mtaHeader',
|
|
|
props: {
|
|
|
- activeNav: { // 默认选中的 路径 与组件中的index相互对应
|
|
|
+ activeNav: {
|
|
|
type: String,
|
|
|
require: true,
|
|
|
default: '0',
|
|
|
},
|
|
|
},
|
|
|
components: {
|
|
|
- MtaUploadAlCloud,
|
|
|
- uploadFile,
|
|
|
},
|
|
|
data() {
|
|
|
- const validatePass2 = (rule, value, callback) => {
|
|
|
- if (value === '') {
|
|
|
- callback(new Error('请再次输入密码'));
|
|
|
- } else if (value !== this.HeaderPassChangeDate.pass) {
|
|
|
- callback(new Error('两次输入密码不一致!'));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- };
|
|
|
return {
|
|
|
activeIndex: this.activeNav,
|
|
|
headerArr: [
|
|
|
{
|
|
|
content: '首页',
|
|
|
- keyPath: '/c/Index',
|
|
|
+ keyPath: '/index',
|
|
|
},
|
|
|
- {
|
|
|
- content: '首页',
|
|
|
- keyPath: '/c/IndexPeixun',
|
|
|
- },
|
|
|
- {
|
|
|
- content: '课程中心',
|
|
|
+ /* {
|
|
|
+ content: '考试平台',
|
|
|
keyPath: '/c/kecheng/lists',
|
|
|
children: [
|
|
|
{
|
|
|
- content: '课程列表',
|
|
|
+ content: 'xxxxxx',
|
|
|
keyPath: '/c/kecheng/lists',
|
|
|
- children: [
|
|
|
- {
|
|
|
- content: '课程',
|
|
|
- keyPath: '/c/kecheng/do',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- content: '考试中心',
|
|
|
- keyPath: '/c/exam/lists',
|
|
|
- children: [
|
|
|
- {
|
|
|
- content: '考试列表',
|
|
|
- keyPath: '/c/exam/lists',
|
|
|
- children: [
|
|
|
- {
|
|
|
- content: '考试',
|
|
|
- keyPath: '/c/exam/do',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- content: '成绩中心',
|
|
|
- keyPath: '/c/score/lists',
|
|
|
- children: [
|
|
|
- {
|
|
|
- content: '个人成绩',
|
|
|
- keyPath: '/c/score/lists',
|
|
|
- },
|
|
|
- {
|
|
|
- content: '课程成绩',
|
|
|
- keyPath: '/c/score/kechengLists',
|
|
|
- },
|
|
|
- {
|
|
|
- content: '学分统计',
|
|
|
- keyPath: '/c/score/credit',
|
|
|
},
|
|
|
],
|
|
|
- },
|
|
|
+ },*/
|
|
|
{
|
|
|
- content: '自主练习',
|
|
|
- keyPath: '/c/Practice/lists',
|
|
|
- children: [
|
|
|
- {
|
|
|
- content: '练习列表',
|
|
|
- keyPath: '/c/Practice/lists',
|
|
|
- children: [
|
|
|
- {
|
|
|
- content: '练习页面',
|
|
|
- keyPath: '/c/Practice/do',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- /*{
|
|
|
- content: '错题中心',
|
|
|
- keyPath: '/c/cuotiCenter/lists',
|
|
|
- children: [
|
|
|
- {
|
|
|
- content: '错题列表',
|
|
|
- keyPath: '/c/cuotiCenter/lists',
|
|
|
- children: [
|
|
|
- {
|
|
|
- content: '错题页面',
|
|
|
- keyPath: '/c/cuotiCenter/page',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ],
|
|
|
+ content: '考试平台',
|
|
|
+ keyPath: '/c/examPlatform',
|
|
|
+ children: [],
|
|
|
},
|
|
|
{
|
|
|
- content: '证书管理',
|
|
|
- keyPath: '/c/cert/lists',
|
|
|
- children: [
|
|
|
- {
|
|
|
- content: '个人证书',
|
|
|
- keyPath: '/c/cert/lists',
|
|
|
- },
|
|
|
- ],
|
|
|
- },*/
|
|
|
- {
|
|
|
- content: '公告管理',
|
|
|
- keyPath: '/c/notice/lists',
|
|
|
- children: [
|
|
|
- {
|
|
|
- content: '公告中心',
|
|
|
- keyPath: '/c/notice/lists',
|
|
|
- },
|
|
|
- ],
|
|
|
+ content: '培训平台',
|
|
|
+ keyPath: '/c/peixunPlatform',
|
|
|
+ children: [],
|
|
|
},
|
|
|
{
|
|
|
- content: '资源库',
|
|
|
- keyPath: '/c/resource/library',
|
|
|
+ content: '课程开发',
|
|
|
+ keyPath: '/c/courseDev',
|
|
|
children: [],
|
|
|
},
|
|
|
{
|
|
|
- content: '互动问答',
|
|
|
- keyPath: '/c/QuestionAndAnswer/lists',
|
|
|
+ content: '新闻资讯',
|
|
|
+ keyPath: '/c/newsInfor',
|
|
|
children: [],
|
|
|
},
|
|
|
{
|
|
|
- content: '个人中心',
|
|
|
- keyPath: '/c/personalCenter/lists',
|
|
|
- children: [
|
|
|
- {
|
|
|
- content: '个人信息',
|
|
|
- keyPath: '/c/personalCenter/lists',
|
|
|
- },
|
|
|
- {
|
|
|
- content: '错题信息',
|
|
|
- keyPath: '/c/cuotiCenter/lists',
|
|
|
- children: [
|
|
|
- {
|
|
|
- content: '错题页面',
|
|
|
- keyPath: '/c/cuotiCenter/page',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- content: '证书信息',
|
|
|
- keyPath: '/c/cert/lists',
|
|
|
- },
|
|
|
- ],
|
|
|
+ content: '帮助中心',
|
|
|
+ keyPath: '/c/helpCenter',
|
|
|
+ children: [],
|
|
|
+ }, {
|
|
|
+ content: '关于我们',
|
|
|
+ keyPath: '/c/aboutUs',
|
|
|
+ children: [],
|
|
|
},
|
|
|
+
|
|
|
],
|
|
|
- // 密码修改
|
|
|
- headerPasswordDialog: false,
|
|
|
- HeaderPassChangeDate: {
|
|
|
- orgPass: '',
|
|
|
- pass: '',
|
|
|
- checkPass: '',
|
|
|
- },
|
|
|
- HeaderPassRules: {
|
|
|
- orgPass: [
|
|
|
- { message: '请输入原始密码', trigger: 'blur', required: true },
|
|
|
- ],
|
|
|
- pass: [
|
|
|
- { message: '请输入新密码', trigger: 'blur', required: true },
|
|
|
- ],
|
|
|
- checkPass: [
|
|
|
- { validator: validatePass2, trigger: 'blur', required: true },
|
|
|
- ],
|
|
|
- },
|
|
|
- /// 个人信息编辑
|
|
|
- editorMessage: false,
|
|
|
- userInfoData: {
|
|
|
- userName: '',
|
|
|
- birthday: '',
|
|
|
- defaultBirthday: '',
|
|
|
- email: '',
|
|
|
- gender: '',
|
|
|
- userId: '',
|
|
|
- idcard: '',
|
|
|
- realName: '',
|
|
|
- tel: '',
|
|
|
- },
|
|
|
- formRules3: {
|
|
|
- userName: [
|
|
|
- { trigger: 'blur', required: true, message: '请输入用户名' },
|
|
|
- ],
|
|
|
- },
|
|
|
- imageUrl: '',
|
|
|
- headerimgUrl: require('../../../assets/images/default/user-img.png'),
|
|
|
- menuFlag: '',
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -392,151 +108,8 @@
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
|
- logoImg() {
|
|
|
- if (this.getReplaceContext === null) {
|
|
|
- return;
|
|
|
- }
|
|
|
- return this.getReplaceContext.logoImg;
|
|
|
- },
|
|
|
- // 个人头像 待定
|
|
|
- headerImg() {
|
|
|
- return checkUrlIsNotHttpUrl(this.getReplaceIcon.headImg)
|
|
|
- ? this.headerimgUrl
|
|
|
- : this.getReplaceIcon.headImg;
|
|
|
- },
|
|
|
- // 个人头像 待定
|
|
|
- ...mapGetters([
|
|
|
- 'getReplaceContext',
|
|
|
- 'getTenantCode',
|
|
|
- 'getReplaceIcon',
|
|
|
- 'getThemeColor',
|
|
|
- ]),
|
|
|
},
|
|
|
- methods: {
|
|
|
- getImageUrl(data) {
|
|
|
- this.imageUrl = data;
|
|
|
- },
|
|
|
- // ************* 关窗清理 *****************
|
|
|
- formatDataFun(data) {
|
|
|
- this.userInfoData.userName = getTrimData(data);
|
|
|
- },
|
|
|
- ClosePassDl2() {
|
|
|
- this.$refs.formUserInfor.resetFields();
|
|
|
- },
|
|
|
- // ************** 弹窗事件 修改密码 *****************
|
|
|
- // 密码修改
|
|
|
- changePassword() {
|
|
|
- this.headerPasswordDialog = true;
|
|
|
- },
|
|
|
- // 确认修改
|
|
|
- saveHeaderPass() {
|
|
|
- this.$refs.ruleHeaderForm.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- // 请求后台
|
|
|
- const options = {
|
|
|
- passwordNew: this.HeaderPassChangeDate.pass,
|
|
|
- passwordOld: this.HeaderPassChangeDate.orgPass,
|
|
|
- };
|
|
|
-
|
|
|
- getAdminUserMypass(options)
|
|
|
- .then(res => {
|
|
|
-
|
|
|
- if (res.code === 0 && res.data) {
|
|
|
- this.headerPasswordDialog = false;
|
|
|
- this.$message.success('修改成功');
|
|
|
- } else {
|
|
|
- this.$message.error('修改失败');
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$message.error('请确定验证是否通过');
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- // 关闭修改密码
|
|
|
- closePassDl() {
|
|
|
- this.$refs.ruleHeaderForm.resetFields();
|
|
|
- },
|
|
|
- // ************* 弹窗事件 帮助中心 **************
|
|
|
- openHelpCenter() {
|
|
|
-
|
|
|
- },
|
|
|
- // ************** 弹窗事件 编辑信息 ****************
|
|
|
- // 保存用户信息
|
|
|
- saveUserInfo() {
|
|
|
- const option = {
|
|
|
- birthday: this.userInfoData.birthday,
|
|
|
- email: this.userInfoData.email,
|
|
|
- gender: this.userInfoData.gender,
|
|
|
- icon: this.imageUrl === undefined ? '' : this.imageUrl,
|
|
|
- idcard: this.userInfoData.idcard,
|
|
|
- realName: this.userInfoData.realName,
|
|
|
- userId: this.userInfoData.userId,
|
|
|
- userName: this.userInfoData.userName,
|
|
|
- tel: this.userInfoData.tel,
|
|
|
- };
|
|
|
- const loading = this.loading();
|
|
|
- // 请求后台
|
|
|
- getClientUserMyUpdate(option)
|
|
|
- .then(res => {
|
|
|
- if (res.data) {
|
|
|
- this.editorMessage = false;
|
|
|
- // 个人头像 待定
|
|
|
- const opt = {
|
|
|
- headImg: option.icon,
|
|
|
- };
|
|
|
- setUserIcon(opt);
|
|
|
- this.$message.success('修改成功');
|
|
|
- loading.close();
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- // this.$message.error('请确定验证是否通过');
|
|
|
- loading.close();
|
|
|
- console.error('错误', err);
|
|
|
- });
|
|
|
- },
|
|
|
- // 取消
|
|
|
- cancelSaveUserInfo() {
|
|
|
- this.editorMessage = false;
|
|
|
- },
|
|
|
- changeInformation() {
|
|
|
- getClentUserMyInfo()
|
|
|
- .then(res => {
|
|
|
- const userInfoObj = res.data;
|
|
|
- this.userInfoData.userName = userInfoObj.userName;
|
|
|
- this.userInfoData.birthday = userInfoObj.birthday === null
|
|
|
- ? new Date('1991-05-01')
|
|
|
- : new Date(userInfoObj.birthday);
|
|
|
- this.userInfoData.defaultBirthday = new Date(userInfoObj.birthday);
|
|
|
- this.imageUrl = userInfoObj.icon;
|
|
|
- this.userInfoData.email = userInfoObj.email;
|
|
|
- this.userInfoData.gender = userInfoObj.gender;
|
|
|
- this.userInfoData.idcard = userInfoObj.idcard;
|
|
|
- this.userInfoData.realName = userInfoObj.realName;
|
|
|
- this.userInfoData.tel = userInfoObj.tel;
|
|
|
- this.userInfoData.userId = userInfoObj.userId;
|
|
|
- this.editorMessage = true;
|
|
|
- }).catch(err => {
|
|
|
- console.error('获取用户信息', err);
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- // ************** 退出 系统 **************************
|
|
|
- exitSystem() {
|
|
|
- getExitStatus().then(res => {
|
|
|
- if (res.code === 0 && res.data) {
|
|
|
-
|
|
|
- this.$router.push({ path: '/c/login' });
|
|
|
-
|
|
|
- setAuth();
|
|
|
- this.$message.success('系统退出成功');
|
|
|
- } else {
|
|
|
- this.$message.error('系统退出失败');
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- },
|
|
|
+ methods:{
|
|
|
// ************** 导航状态 ****************************
|
|
|
activeIndexSync() {
|
|
|
const path = this.$route.path;
|
|
@@ -559,8 +132,9 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
checkArray() {
|
|
|
- if (JSON.parse(this.menuFlag) == 1) {
|
|
|
+ /* if (JSON.parse(this.menuFlag) == 1) {
|
|
|
|
|
|
for (let i = this.headerArr.length - 1; i >= 0; i--) {
|
|
|
if (this.headerArr[i].content == '课程中心') {
|
|
@@ -585,55 +159,15 @@
|
|
|
this.headerArr.splice(i, 1);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
this.activeIndexSync();
|
|
|
},
|
|
|
- /**
|
|
|
- * 上传文件
|
|
|
- */
|
|
|
- uploadFileStart(params) {
|
|
|
- if (!params) {
|
|
|
- return;
|
|
|
- }
|
|
|
- const suffixList = params.file.name.split('.').pop();
|
|
|
- const options = {
|
|
|
- prefix: 'resource/',
|
|
|
- suffix: suffixList,
|
|
|
- };
|
|
|
- getUploadImg(options).then((res) => {
|
|
|
|
|
|
- if (res.code === 0) {
|
|
|
- // 二进制文件通过forData对象进行传递
|
|
|
- const FormDataForAl = new FormData();
|
|
|
- const multipartParams = Object.assign({}, res.data, {
|
|
|
- Filename: `images/${params.filename}`,
|
|
|
- success_action_status: '200',
|
|
|
- });
|
|
|
- // 参数数据
|
|
|
- FormDataForAl.append('key', multipartParams.key);
|
|
|
- FormDataForAl.append('policy', multipartParams.policy);
|
|
|
- FormDataForAl.append('signature', multipartParams.signature);
|
|
|
- FormDataForAl.append('OSSAccessKeyId', multipartParams.accessid);
|
|
|
- FormDataForAl.append('success_action_status', multipartParams.success_action_status);
|
|
|
- // OSS要求, file放到最后
|
|
|
- FormDataForAl.append('file', params.file);
|
|
|
-
|
|
|
- axios.post(multipartParams.uploadUrl, FormDataForAl).then(alRes => {
|
|
|
- if (alRes.status === 200) {
|
|
|
- this.imageUrl = `${multipartParams.downloadUrl}/${multipartParams.key}`;
|
|
|
- }
|
|
|
- }).catch(alerr => {
|
|
|
- console.error('阿里云错误', alerr);
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
created() {
|
|
|
- this.menuFlag = window.localStorage.getItem(`tenantFlag_key`);
|
|
|
+ console.log(this.activeIndex);
|
|
|
this.checkArray();
|
|
|
- /* activeIndex sync */
|
|
|
- //this.activeIndexSync();
|
|
|
initThemeColor();
|
|
|
},
|
|
|
};
|