文本类算法试用+单点登录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 * @Author: hisense.wuhongjian
* @Date: 2022-04-11 10:11:40 * @Date: 2022-04-11 10:11:40
* @LastEditors: hisense.liangjunhua * @LastEditors: hisense.wuhongjian
* @LastEditTime: 2022-07-11 12:09:13 * @LastEditTime: 2022-07-11 18:56:36
* @Description: 告诉大家这是什么 * @Description: 告诉大家这是什么
--> -->
<!DOCTYPE html> <!DOCTYPE html>
@ -44,7 +44,7 @@
// window.SITE_CONFIG['apiURL'] = 'http://15.2.21.166:8888/renren-admin'; // 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://124.222.94.39:8888/renren-admin';
// window.SITE_CONFIG['apiURL'] = 'http://10.16.5.35: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['previewUrl'] = 'http://15.2.21.238:9796/';
// window.SITE_CONFIG['apiURL'] = 'http://15.2.23.141:8000/renren-admin'; // window.SITE_CONFIG['apiURL'] = 'http://15.2.23.141:8000/renren-admin';
// WebSocket地址 // WebSocket地址

View File

@ -1,8 +1,8 @@
<!-- <!--
* @Author: hisense.wuhongjian * @Author: hisense.wuhongjian
* @Date: 2022-03-29 16:45:25 * @Date: 2022-03-29 16:45:25
* @LastEditors: hisense.liangjunhua * @LastEditors: hisense.wuhongjian
* @LastEditTime: 2022-07-09 15:05:57 * @LastEditTime: 2022-07-11 18:10:24
* @Description: 告诉大家这是什么 * @Description: 告诉大家这是什么
--> -->
<!DOCTYPE html> <!DOCTYPE html>
@ -49,7 +49,7 @@
window.SITE_CONFIG['backUrl'] = 'http://15.2.21.238:9797'; window.SITE_CONFIG['backUrl'] = 'http://15.2.21.238:9797';
window.SITE_CONFIG['previewUrl'] = 'http://15.2.21.238:9796/'; 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['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['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'; // window.SITE_CONFIG['backUrl'] = 'http://124.222.94.39:9797';
@ -126,4 +126,4 @@
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
</html> </html>

View File

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

View File

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

View File

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

View File

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

View File

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