From b7b0a14b8683d6b2c40a98d59bc339f1fda42024 Mon Sep 17 00:00:00 2001 From: wuhongjian Date: Mon, 11 Jul 2022 19:12:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=9C=AC=E7=B1=BB=E7=AE=97=E6=B3=95?= =?UTF-8?q?=E8=AF=95=E7=94=A8+=E5=8D=95=E7=82=B9=E7=99=BB=E5=BD=95bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/public/index.html | 6 +-- front/public/index.html | 8 ++-- front/src/api/file.js | 8 +++- front/src/utils/request.js | 34 +++++++++----- front/src/vab/plugins/permissions.js | 6 ++- .../components/Algorithm/TestOfWords.vue | 47 ++++++++++++------- front/src/views/home/infrastructurePage.vue | 2 +- 7 files changed, 69 insertions(+), 42 deletions(-) diff --git a/back/public/index.html b/back/public/index.html index 465e77bf..1d32cc9d 100644 --- a/back/public/index.html +++ b/back/public/index.html @@ -1,8 +1,8 @@ @@ -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地址 diff --git a/front/public/index.html b/front/public/index.html index cacc03dd..e408d9d5 100644 --- a/front/public/index.html +++ b/front/public/index.html @@ -1,8 +1,8 @@ @@ -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 @@ - \ No newline at end of file + diff --git a/front/src/api/file.js b/front/src/api/file.js index 96f3d1ea..5848b83a 100644 --- a/front/src/api/file.js +++ b/front/src/api/file.js @@ -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() { diff --git a/front/src/utils/request.js b/front/src/utils/request.js index f4fe2a90..0f02346e 100644 --- a/front/src/utils/request.js +++ b/front/src/utils/request.js @@ -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 diff --git a/front/src/vab/plugins/permissions.js b/front/src/vab/plugins/permissions.js index 8e495192..6139bd4b 100644 --- a/front/src/vab/plugins/permissions.js +++ b/front/src/vab/plugins/permissions.js @@ -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') diff --git a/front/src/views/detailsAll/components/Algorithm/TestOfWords.vue b/front/src/views/detailsAll/components/Algorithm/TestOfWords.vue index 6cee07eb..4541c9a5 100644 --- a/front/src/views/detailsAll/components/Algorithm/TestOfWords.vue +++ b/front/src/views/detailsAll/components/Algorithm/TestOfWords.vue @@ -26,9 +26,9 @@
-

错误内容: {{ errorWord }}

-

错误位置: {{ errorWordIndex }}

-

识别内容: {{ errorWordContent }}

+

返回结果: {{ errorWord }}

+
@@ -43,26 +43,37 @@ diff --git a/front/src/views/home/infrastructurePage.vue b/front/src/views/home/infrastructurePage.vue index f58fb5c9..a7de5707 100644 --- a/front/src/views/home/infrastructurePage.vue +++ b/front/src/views/home/infrastructurePage.vue @@ -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, //关灯模式