文本类算法试用+单点登录bug修复

This commit is contained in:
wuhongjian 2022-07-11 19:12:53 +08:00
parent ae22bbd063
commit b7b0a14b86
7 changed files with 69 additions and 42 deletions

View File

@ -1,8 +1,8 @@
<!--
* @Author: hisense.wuhongjian
* @Date: 2022-04-11 10:11:40
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-07-11 12:09:13
* @LastEditors: hisense.wuhongjian
* @LastEditTime: 2022-07-11 18:56:36
* @Description: 告诉大家这是什么
-->
<!DOCTYPE html>
@ -44,7 +44,7 @@
// window.SITE_CONFIG['apiURL'] = 'http://15.2.21.166:8888/renren-admin';
// window.SITE_CONFIG['apiURL'] = 'http://124.222.94.39:8888/renren-admin';
// window.SITE_CONFIG['apiURL'] = 'http://10.16.5.35:8888/renren-admin';
window.SITE_CONFIG['apiURL'] = 'http://15.2.21.238:8888/renren-admin';
window.SITE_CONFIG['apiURL'] = 'http://15.2.21.239:8888/renren-admin';
window.SITE_CONFIG['previewUrl'] = 'http://15.2.21.238:9796/';
// window.SITE_CONFIG['apiURL'] = 'http://15.2.23.141:8000/renren-admin';
// WebSocket地址

View File

@ -1,8 +1,8 @@
<!--
* @Author: hisense.wuhongjian
* @Date: 2022-03-29 16:45:25
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-07-09 15:05:57
* @LastEditors: hisense.wuhongjian
* @LastEditTime: 2022-07-11 18:10:24
* @Description: 告诉大家这是什么
-->
<!DOCTYPE html>
@ -49,7 +49,7 @@
window.SITE_CONFIG['backUrl'] = 'http://15.2.21.238:9797';
window.SITE_CONFIG['previewUrl'] = 'http://15.2.21.238:9796/';
window.SITE_CONFIG['frontUrl'] = 'http://15.2.21.238:9796/document/#/devModelFile/';
window.SITE_CONFIG['apiURL'] = 'http://15.2.21.238:8888/renren-admin';
window.SITE_CONFIG['apiURL'] = 'http://15.2.21.239:8888/renren-admin';
window.SITE_CONFIG['POI_URL'] = 'http://15.2.21.238:8090/iserver/services/addressmatch-qingdaoPOI181015/restjsr/v1/address';
// 穿透版本
// window.SITE_CONFIG['backUrl'] = 'http://124.222.94.39:9797';
@ -126,4 +126,4 @@
<!-- built files will be auto injected -->
</body>
</html>
</html>

View File

@ -1,8 +1,8 @@
/*
* @Author: hisense.wuhongjian
* @Date: 2022-04-20 17:16:35
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-06-22 14:57:16
* @LastEditors: hisense.wuhongjian
* @LastEditTime: 2022-07-11 19:02:33
* @Description: 告诉大家这是什么
*/
import request from '@/utils/request'
@ -46,6 +46,10 @@ export function correct(params) {
export function paddleocr(params) {
return axios.post('http://15.72.183.90:7008/paddleocr', params, config2)
}
//
export function algo(params) {
return axios.post('http://15.72.184.10:8888/api/algo', params, config2)
}
// -
export function count() {

View File

@ -29,12 +29,13 @@ const handleCode = (code, msg, res) => {
// message.error(msg || '')
store.dispatch('user/resetAll').catch(() => {})
if (res.token) {
console.log('存在token信息', res.token)
setAccessToken(res.token)
const token = getAccessToken()
console.log('验证token信息', token)
}
debugger
// if (res.token) {
// console.log('token', res.token)
// setAccessToken(res.token)
// const token = getAccessToken()
// console.log('token', token)
// }
// // location.reload()
// if (redirect) {
@ -71,8 +72,10 @@ const instance = axios.create({
*/
instance.interceptors.request.use(
(config) => {
if (store.getters['user/accessToken'])
config.headers[tokenName] = store.getters['user/accessToken']
debugger
const token = getAccessToken()
if (token)
config.headers[tokenName] = token
if (
config.data &&
config.headers['Content-Type'] ===
@ -101,10 +104,12 @@ instance.interceptors.response.use(
console.log('接口返回REDIRECT', response.headers.redirect)
response['Access-Control-Expose-Headers'] = 'redirect'
const { code, message } = response.data
if (response.headers.token) {
debugger
if (code=='0' && response.headers.token) {
setAccessToken(response.headers.token)
} else {
if (response.headers.redirect) {
const token = getAccessToken()
if (response.headers.redirect && !token) {
// window.location.href = response.headers.redirect
window.location.replace(response.headers.redirect)
return
@ -154,16 +159,21 @@ instance.interceptors.response.use(
// }
},
(error) => {
debugger
console.log('接口error', error)
if (loadingInstance) loadingInstance.close()
const { response, message } = error
if (error.response && error.response.data) {
if (error.response) {
console.log('接口返回', response)
console.log('接口返回headers', response.headers)
console.log('接口返回REDIRECT', response.headers.redirect)
// if (response.headers.token) {
// setAccessToken(response.headers.token)
// }
if (response.headers.redirect) {
window.location.replace(response.headers.redirect)
return Promise.reject(error)
// return Promise.resolve()
}
const { status, data } = response

View File

@ -2,7 +2,7 @@
* @Author: hisense.wuhongjian
* @Date: 2022-04-01 17:23:11
* @LastEditors: hisense.wuhongjian
* @LastEditTime: 2022-07-08 18:55:28
* @LastEditTime: 2022-07-11 16:39:36
* @Description: 告诉大家这是什么
*/
/**
@ -33,8 +33,9 @@
if (!loginInterception) hasToken = true
console.log('hasToken存在巨大问题', hasToken)
if (hasToken) {
setAccessToken(hasToken)
// setAccessToken(hasToken)
await store.dispatch('user/getUserInfo')
debugger
next()
} else {
let accessRoutes = []
@ -45,6 +46,7 @@
if (routesWhiteList.indexOf(to.path) !== -1) {
next()
} else {
//
getUserInfo().then(res=>{
console.log(res)
router.replace('/home')

View File

@ -26,9 +26,9 @@
<div class="bg bg4"></div>
<div class="top-left">
<div class="text">
<p>错误内容 {{ errorWord }}</p>
<p>错误位置 {{ errorWordIndex }}</p>
<p>识别内容 {{ errorWordContent }}</p>
<p>返回结果 {{ errorWord }}</p>
<!-- <p>错误位置 {{ errorWordIndex }}</p>
<p>识别内容 {{ errorWordContent }}</p> -->
<span></span>
</div>
</div>
@ -43,26 +43,37 @@
</template>
<script setup>
import { ref } from 'vue'
import { correct } from '@/api/file'
import { correct,algo } from '@/api/file'
import { useRouter } from 'vue-router'
const router = useRouter()
// const keyId = router.currentRoute.value.query.id
const wordValue = ref('')
wordValue.value = router.currentRoute.value.query.data
const errorWord = ref('')
const errorWordIndex = ref('')
const errorWordContent = ref('')
// const errorWordIndex = ref('')
// const errorWordContent = ref('')
const correctWord = () => {
const param = {
sentence: wordValue.value,
// sentence: wordValue.value,
company: router.currentRoute.value.query.company,
algorithmName: router.currentRoute.value.query.algorithmName,
data: wordValue.value,
type: router.currentRoute.value.query.type
}
correct(param).then((res) => {
// wordContent.value = res.data.data
Object.keys(res.data.data).forEach((key) => {
console.log(key)
errorWord.value = key
})
Object.values(res.data.data).forEach((val) => {
console.log(val)
errorWordIndex.value = val.ix
errorWordContent.value = val.value
})
// correct(param).then((res) => {
// // wordContent.value = res.data.data
// Object.keys(res.data.data).forEach((key) => {
// console.log(key)
// errorWord.value = key
// })
// Object.values(res.data.data).forEach((val) => {
// console.log(val)
// errorWordIndex.value = val.ix
// errorWordContent.value = val.value
// })
// })
algo(param).then(res=>{
errorWord.value = res.data.text_data
})
}
</script>

View File

@ -138,7 +138,7 @@
muted: false, //
webFullScreen: false,
speedRate: ['0.75', '1.0', '1.25', '1.5', '2.0'], //
autoPlay: true, //
autoPlay: false, //
loop: false, //
mirror: false, //
ligthOff: false, //