Merge branch 'hi-ucs-dev' of http://124.222.94.39:3000/wuhongjian/hi-ucs into hi-ucs-dev

This commit is contained in:
guoyue 2022-10-10 13:54:31 +08:00
commit 8940dc4e24
6 changed files with 218 additions and 180 deletions

View File

@ -1,5 +1,7 @@
import { createRouter, createWebHashHistory } from 'vue-router' import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '@/layout' import Layout from '@/layout'
import { message } from 'ant-design-vue'
import Cookies from 'js-cookie'
export const constantRoutes = [ export const constantRoutes = [
{ {
@ -567,4 +569,24 @@ const router = createRouter({
routes: constantRoutes, routes: constantRoutes,
}) })
router.beforeEach((to, from, next) => {
let token = Cookies.get('ucsToken')
const tokenStartTime = window.localStorage.getItem('tokenStartTime')
//
const timeOver = 2 * 60 * 60 * 1000
let date = new Date().getTime()
if (date - tokenStartTime > timeOver) {
token = null
}
console.log('判断token失效', token, date - tokenStartTime > timeOver)
if (!token) {
if (to.path == '/login') return next()
message.warning('登录失效,请重新登录!')
return next('/login')
} else if (to.path == '/login') {
return next('/home')
}
next()
})
export default router export default router

View File

@ -152,7 +152,7 @@
]) ])
// eslint-disable-next-line vue/no-setup-props-destructure // eslint-disable-next-line vue/no-setup-props-destructure
dataForm.value = props.dataList dataForm.value = props.dataList
console.log('=========================>', dataForm.value) console.log('============dataList=============>', dataForm.value)
// const router = useRouter() // const router = useRouter()
// const arr = // const arr =
// router.currentRoute.value.query.name instanceof Array // router.currentRoute.value.query.name instanceof Array
@ -181,7 +181,7 @@
let arr = JSON.parse(note1) let arr = JSON.parse(note1)
xVideoList.value = [] xVideoList.value = []
arr.map((val) => { arr.map((val) => {
xVideoList.value.push({ name: val.channelName, key: val.channelId }) xVideoList.value.push({ name: val.channelName || '', key: val.channelId })
}) })
videoVisible.value = true videoVisible.value = true
} else { } else {

View File

@ -51,7 +51,7 @@
style="width: 230px" :options="systemOptions" @focus="handleFocus" @blur="handleBlur" style="width: 230px" :options="systemOptions" @focus="handleFocus" @blur="handleBlur"
@change="systemHandleChange" @search="systemHandleSearch"></a-select> @change="systemHandleChange" @search="systemHandleSearch"></a-select>
</a-form-item> </a-form-item>
<span style="font-size:12px;color:#666;padding-left:106px"> 请输入关键字如选项没有系统请新增</span> <span style="font-size:12px;color:#666;padding-left:106px"> 如选项没有系统请新增</span>
</div> </div>
<a-form-item class="applicationScene" label="应用领域" name="applicationScene" <a-form-item class="applicationScene" label="应用领域" name="applicationScene"
:rules="[{ required: true, message: '请选择应用领域' }]" style="width: 6.93rem"> :rules="[{ required: true, message: '请选择应用领域' }]" style="width: 6.93rem">

View File

@ -12,7 +12,7 @@
</div> --> </div> -->
<div class="first-title-text new-guide-box" :style="{ color: '使用手册' === titleData.name ? '#0058e1' : '' }" <div class="first-title-text new-guide-box" :style="{ color: '使用手册' === titleData.name ? '#0058e1' : '' }"
@click="changeName({ name: '使用手册' })"> @click="downloadDoc('/static/doc/userbook.docx', '通用能力服务平台USC用户手册')">
<div class="guide-text">使用手册</div> <div class="guide-text">使用手册</div>
<img src="@/assets/developmentGuide/download.png" @click="downloadDoc('/static/doc/userbook.docx', '通用能力服务平台USC用户手册')" alt="" /> <img src="@/assets/developmentGuide/download.png" @click="downloadDoc('/static/doc/userbook.docx', '通用能力服务平台USC用户手册')" alt="" />
</div> </div>

View File

@ -15,7 +15,11 @@
</a-input> </a-input>
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-input v-model:value="form.password" type="password" placeholder="Password"> <a-input
v-model:value="form.password"
type="password"
placeholder="Password"
>
<template v-slot:prefix> <template v-slot:prefix>
<LockOutlined style="color: rgba(0, 0, 0, 0.25)" /> <LockOutlined style="color: rgba(0, 0, 0, 0.25)" />
</template> </template>
@ -23,8 +27,15 @@
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<!-- IE Chrome || judgeAgent() !== 'Chrome'--> <!-- IE Chrome || judgeAgent() !== 'Chrome'-->
<a-button type="primary" html-type="submit" <a-button
:disabled="form.username === '' || form.password === '' || !canOpen.includes(judgeAgent())"> type="primary"
html-type="submit"
:disabled="
form.username === '' ||
form.password === '' ||
!canOpen.includes(judgeAgent())
"
>
登录 登录
</a-button> </a-button>
</a-form-item> </a-form-item>
@ -38,6 +49,7 @@
<script> <script>
import { dependencies, devDependencies } from '*/package.json' import { dependencies, devDependencies } from '*/package.json'
import { mapActions, mapGetters } from 'vuex' import { mapActions, mapGetters } from 'vuex'
import Cookies from 'js-cookie'
import { Encrypt } from '@/utils/crypto' import { Encrypt } from '@/utils/crypto'
import { UserOutlined, LockOutlined } from '@ant-design/icons-vue' import { UserOutlined, LockOutlined } from '@ant-design/icons-vue'
import { message, Modal } from 'ant-design-vue' import { message, Modal } from 'ant-design-vue'
@ -62,7 +74,7 @@ export default {
devDependencies: devDependencies, devDependencies: devDependencies,
is360: false, is360: false,
isIE: false, isIE: false,
canOpen: ['FF', 'Chrome'] canOpen: ['FF', 'Chrome'],
} }
}, },
computed: { computed: {
@ -87,7 +99,7 @@ export default {
Modal.warning({ Modal.warning({
title: '提示', title: '提示',
content: '请使用谷歌或火狐浏览器!', content: '请使用谷歌或火狐浏览器!',
}); })
} }
}, },
methods: { methods: {
@ -97,7 +109,7 @@ export default {
// //
judgeAgent() { judgeAgent() {
let userAgent = navigator.userAgent // userAgent let userAgent = navigator.userAgent // userAgent
console.log('userAgent------------>', userAgent); console.log('userAgent------------>', userAgent)
let isOpera = userAgent.indexOf('Opera') > -1 let isOpera = userAgent.indexOf('Opera') > -1
//Opera //Opera
if (isOpera) { if (isOpera) {
@ -145,8 +157,12 @@ export default {
password: Encrypt(this.form.password), password: Encrypt(this.form.password),
username: this.form.username, username: this.form.username,
}) })
window.localStorage.setItem('tokenStartTime', new Date().getTime())
window.sessionStorage.setItem('visits', JSON.stringify([])) window.sessionStorage.setItem('visits', JSON.stringify([]))
console.log('添加visits========================================>') console.log(
'添加visits========================================>',
Cookies.get('ucsToken')
)
// console.log(this.handleRoute()) // console.log(this.handleRoute())
// 西 // 西
if (isXiHaiAn) { if (isXiHaiAn) {
@ -155,8 +171,8 @@ export default {
query: { query: {
select: '基础设施', select: '基础设施',
tecHnosphere: '', tecHnosphere: '',
appLiCation: '' appLiCation: '',
} },
}) })
} else { } else {
await this.$router.push('/home') await this.$router.push('/home')

View File

@ -148,7 +148,7 @@ let typeList = ref([
'能力下架', '能力下架',
'能力需求', '能力需求',
'需求评论', '需求评论',
'能力评价', // '',
]) ])
// 西- // 西-
let isXiHaiAn = whoShow.itShowXiHaiAn let isXiHaiAn = whoShow.itShowXiHaiAn