dev_202207
yujialong 3 years ago
parent f1b0f30c32
commit eab1e7457a
  1. 1
      src/api/index.js
  2. BIN
      src/assets/img/exts/pdf.png
  3. BIN
      src/assets/img/exts/pic.png
  4. BIN
      src/assets/img/exts/txt.png
  5. BIN
      src/assets/img/exts/word.png
  6. 30
      src/layouts/header/index.vue
  7. 21
      src/pages/account/login/index.vue
  8. 2
      src/pages/match/list/index.vue
  9. 10
      src/pages/station/preview/index.vue
  10. 13
      src/store/modules/user.js

@ -12,6 +12,7 @@ export default {
getToken: `users/users/user/getToken`, getToken: `users/users/user/getToken`,
getOtherAccountByPhone: `users/users/user/getOtherAccountByPhone`, getOtherAccountByPhone: `users/users/user/getOtherAccountByPhone`,
unbindAccounts: `users/users/user/unbindAccounts`, unbindAccounts: `users/users/user/unbindAccounts`,
getUserRolesPermissionMenu: `${host}users/users/user-role/getUserRolesPermissionMenu`,
platformLogList: `nakadai/nakadai/log/platformLogList`, platformLogList: `nakadai/nakadai/log/platformLogList`,
logNotification: `nakadai/nakadai/log/logNotification`, logNotification: `nakadai/nakadai/log/logNotification`,

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

@ -10,16 +10,16 @@
<div class="inner"> <div class="inner">
<navbar class="nav-wrap" ref="nav"></navbar> <navbar class="nav-wrap" ref="nav"></navbar>
<template v-if="token"> <template v-if="token || serverToken">
<div class="user-wrap"> <div class="user-wrap">
<el-dropdown size="medium" @command="menuChange"> <el-dropdown size="medium" @command="menuChange">
<div class="user"> <div class="user">
<el-avatar :size="35" :src="avatar"></el-avatar> <el-avatar :size="35" :src="avatar"></el-avatar>
<span class="username">{{ customerName || userName }}</span> <span class="username">{{ customerName || cName || userName }}</span>
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="isIndex" command="index">前往学习</el-dropdown-item> <el-dropdown-item v-if="isIndex" command="index">前往{{ serverToken ? '教学' : '学习' }}</el-dropdown-item>
<el-dropdown-item v-if="!customerName" command="info">个人中心</el-dropdown-item> <el-dropdown-item v-if="!customerName && !serverToken" command="info">个人中心</el-dropdown-item>
<el-dropdown-item command="logout">退出登录</el-dropdown-item> <el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
@ -29,7 +29,6 @@
<img src="@/assets/img/user.png" alt=""> <img src="@/assets/img/user.png" alt="">
<span>登录</span> <span>登录</span>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
@ -38,10 +37,13 @@ import { mapState, mapMutations, mapActions } from "vuex";
import Setting from "@/setting"; import Setting from "@/setting";
import util from "@/libs/util"; import util from "@/libs/util";
import navbar from "../navbar"; import navbar from "../navbar";
import axios from 'axios'
export default { export default {
data() { data() {
return { return {
token: util.local.get(Setting.tokenKey), token: util.local.get(Setting.tokenKey), // token
serverToken: util.local.get('oc_server_token'), // token
cName: util.cookies.get('customerName'),
isIndex: Setting.whiteList.find(e => e === this.$route.path), // isIndex: Setting.whiteList.find(e => e === this.$route.path), //
}; };
}, },
@ -108,9 +110,19 @@ export default {
toNew(path) { toNew(path) {
// //
if (util.cookies.get('serverLogin') === 'true' && util.local.get('oc_server_token')) { if (util.cookies.get('serverLogin') === 'true' && util.local.get('oc_server_token')) {
window.open(process.env.NODE_ENV === 'development' ? const defaultPath = '/station/list' //
'http://192.168.31.125:8081/#/index' : //
`${location.origin}/admin/#/index`) axios.get(`${this.api.getUserRolesPermissionMenu}?platformId=1`, {
headers: {
token: this.serverToken
}
}).then(({ data }) => {
const list = data.permissionMenu[0].children
const route = list.find(e => e.path === defaultPath) ? defaultPath : list[0].path //
window.open(process.env.NODE_ENV === 'development' ?
`http://192.168.31.125:8081/#${route}` :
`${location.origin}/admin/#${route}`)
}).catch(err => {})
} else { } else {
window.open(this.$router.resolve(path).href) window.open(this.$router.resolve(path).href)
} }

@ -368,16 +368,25 @@ export default {
}, },
// //
toMang() { toMang() {
util.local.set(Setting.tokenKey, this.token, Setting.tokenExpires) const { token } = this
util.local.set('oc_server_token', token, Setting.tokenExpires)
// 使 // 使
util.cookies.set('serverLogin', true, { util.cookies.set('serverLogin', true, {
expires: new Date(Date.now() + 15 * 60 * 1000) // 15 expires: new Date(Date.now() + 15 * 60 * 1000) // 15
}) })
this.reloadIndex() axios.get(this.api.isClient, {
// headers: {
location.href = Setting.isDev ? token
`http://${location.hostname}:8081/#/redirect?auth=${btoa(this.token)}` : }
`${location.origin}/admin/#/redirect?auth=${window.btoa(this.token)}` }).then(({ data }) => {
//
data.customerName && util.cookies.set('customerName', data.customerName)
this.reloadIndex()
//
location.href = Setting.isDev ?
`http://${location.hostname}:8081/#/redirect?auth=${btoa(this.token)}` :
`${location.origin}/admin/#/redirect?auth=${window.btoa(this.token)}`
}).catch(res => {})
}, },
// //
selectRole(val) { selectRole(val) {

@ -461,7 +461,7 @@ export default {
} }
dd { dd {
padding: 5px 15px; padding: 5px 15px;
color: #4c4c4c; color: #6a6a6a;
font-size: 16px; font-size: 16px;
white-space: nowrap; white-space: nowrap;
cursor: pointer; cursor: pointer;

@ -20,7 +20,7 @@
<div class="excel-mask1" style="height: 48px;"></div> <div class="excel-mask1" style="height: 48px;"></div>
</template> </template>
</template> </template>
<div class="pdf inner" v-else-if="pdfSrc"> <div class="pdf" v-else-if="pdfSrc">
<p class="arrow"> <p class="arrow">
<span @click="changePdfPage(0)" class="turn el-icon-arrow-left" <span @click="changePdfPage(0)" class="turn el-icon-arrow-left"
:class="{grey: currentPage==1}"></span> :class="{grey: currentPage==1}"></span>
@ -53,7 +53,12 @@
<div class="section" v-if="item.subsectionList.length"> <div class="section" v-if="item.subsectionList.length">
<p class="sectionName" :class="{active: curLink === `${item.name}${section.name}`}" v-for="(section,i) in item.subsectionList" :key="i" @click="preview(section, item.name)"> <p class="sectionName" :class="{active: curLink === `${item.name}${section.name}`}" v-for="(section,i) in item.subsectionList" :key="i" @click="preview(section, item.name)">
<img v-if="section.fileType === 'pptx'" src="@/assets/img/exts/ppt.png" alt=""> <img v-if="section.fileType === 'pptx'" src="@/assets/img/exts/ppt.png" alt="">
<img v-else src="@/assets/img/exts/video.png" alt=""> <img v-else-if="section.fileType === 'mp4'" src="@/assets/img/exts/video.png" alt="">
<img v-else-if="section.fileType === 'doc' || section.fileType === 'docx'" src="@/assets/img/exts/word.png" alt="">
<img v-else-if="section.fileType === 'pptx'" src="@/assets/img/exts/ppt.png" alt="">
<img v-else-if="section.fileType === 'txt'" src="@/assets/img/exts/txt.png" alt="">
<img v-else-if="section.fileType === 'pdf'" src="@/assets/img/exts/pdf.png" alt="">
<img v-else src="@/assets/img/exts/pic.png" alt="">
{{ section.name }} {{ section.name }}
</p> </p>
</div> </div>
@ -238,6 +243,7 @@ export default {
this.coverUrl = row.fileUrl; this.coverUrl = row.fileUrl;
} else if (row.fileType == "pdf") { } else if (row.fileType == "pdf") {
this.pdfSrc = row.fileUrl; this.pdfSrc = row.fileUrl;
console.log("🚀 ~ file: index.vue ~ line 246 ~ preview ~ this.pdfSrc", this.pdfSrc)
this.pdfVisible = true; this.pdfVisible = true;
} else { } else {
this.$get(`${this.api.curriculumGetSubsection}/${row.id}`).then(res => { this.$get(`${this.api.curriculumGetSubsection}/${row.id}`).then(res => {

@ -79,10 +79,15 @@ export default {
}, },
logout({ commit, state, dispatch }) { logout({ commit, state, dispatch }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
util.local.remove(Setting.storeKey); if (util.local.get(Setting.storeKey)) {
util.local.remove(Setting.tokenKey); util.local.remove(Setting.storeKey)
location.reload(); util.local.remove(Setting.tokenKey)
resolve(); } else {
util.local.remove('oc_server_token')
util.local.remove('oc_server_store')
}
location.reload()
resolve()
}); });
}, },
setInfo({ state, commit }, info) { setInfo({ state, commit }, info) {

Loading…
Cancel
Save