Browse Source

Merge branch 'config_href_url' into dev

# Conflicts:
#	src/store/modules/app.ts
CzRger 1 year ago
parent
commit
f0b3085088

+ 1 - 1
src/api/index.ts

@@ -7,7 +7,7 @@ export const handle = (p: { [index: string]: any}) => {
 }
 
 const files = import.meta.globEager("/src/api/module/*.ts")
-const apiModule = {}
+const apiModule: any = {}
 for (const [key, value] of Object.entries(files)) {
   Object.assign(apiModule, value)
 }

+ 1 - 1
src/store/index.ts

@@ -3,7 +3,7 @@ import app from "./modules/app";
 import easyMap from "./modules/easy-map";
 
 export default createStore({
-  state: {},
+  state: <any>{},
   mutations: {},
   actions: {},
   modules: {

+ 7 - 6
src/store/modules/app.js

@@ -5,37 +5,38 @@ const state = {
 	apiProxy: {
 		tesApi: 'api-tes',	//	托尔斯视频拉流服务
 		wazxApi: 'api-wazx',	//	网安中心
+		staticApi: 'api-static',	//	静态资源代理
 	},
 	userInfo: null
 }
 
 const getters = {
-	isLogin(state) {
+	isLogin(state: any) {
 		return localStorage.getItem('sc_token')
 	}
 }
 
 const mutations = {
-	SET_USER_INFO(state, data) {
+	SET_USER_INFO(state: any, data: any) {
 		state.userInfo = data
 	}
 }
 
 const actions = {
-	LOAD_USER_INFO({ commit }, refresh = false) {
+	LOAD_USER_INFO({ commit }: any, refresh = false) {
 		return new Promise((resolve, reject) => {
 			if (refresh || !state.userInfo) {
-				api.default.getUserInfo().then(res => {
+				api.default.getUserInfo().then((res: any) => {
 					commit('SET_USER_INFO', res.userInfo)
 					resolve(res.userInfo)
 				}).catch(() => {
 				})
 			} else {
-				resolve()
+				resolve(null)
 			}
 		})
 	},
-	EXIT_LOGIN({ commit }) {
+	EXIT_LOGIN({ commit }: any) {
 		ElMessageBox.confirm('确定进行[退出]操作?', '提示', {
 			confirmButtonText: '确定',
 			cancelButtonText: '取消',

BIN
src/views/common/img/info-sub-1.png


BIN
src/views/common/img/info-sub-2.png


BIN
src/views/common/img/info-sub-3.png


BIN
src/views/common/img/info-sub-4.png


BIN
src/views/common/img/info-sub-5.png


BIN
src/views/common/img/info-sub-6.png


+ 2 - 1
src/views/common/static.ts

@@ -14,6 +14,7 @@ import InfoMain4 from './img/info-main-4.jpg'
 import InfoMain5 from './img/info-main-5.png'
 import LogoIcon from './img/logo-icon.png'
 import LogoIconZwww from './img/logo-icon_zwww.png'
+import store from '@/store/index'
 
 export const logoIcon = window?.cusConfig?.version === 'zwww' ? LogoIconZwww : LogoIcon
 
@@ -60,6 +61,6 @@ export const infoMapper = [
     enLabel: 'Achievement-Exhibition',
     remark: '近年来,平台通过船舶管控系统精准预警重点海域和重要时段涉海信息,配合海南海警局、海岸警察总队等部门破获了系列重大案件...',
     subImg: InfoSub6,
-    href: 'http://www.baidu.com'
+    href: `/${store.state.app.apiProxy.staticApi}/video/cgzs.mp4`
   },
 ]