feat(web):重构前端路由和配置管理
- 移除旧版全局变量定义,采用Vue Router管理页面跳转 - 新增配置文件统一管理游戏名称和注册码设置 -优化加载条逻辑,使用onMounted确保DOM元素正确获取 - 添加服务端配置接口,动态加载游戏配置信息 - 升级依赖包,引入vue-router支持单页应用 - 调整项目结构,分离服务器端代码至独立目录 - 配置Vite代理转发API请求到本地开发服务器 - 更新package.json脚本命令,支持前后端联合调试 - 引入pnpm workspace管理模式,提升多包协作效率
This commit is contained in:
@@ -1,17 +1,7 @@
|
||||
/**
|
||||
* 冰雪传奇H5
|
||||
* 2022 XX信息科技有限公司
|
||||
*
|
||||
* @author 123456
|
||||
* @wx 123456
|
||||
* @qq 123456
|
||||
*/
|
||||
|
||||
let host = window.location.hostname || '100.88.157.105';
|
||||
let port = 80;
|
||||
|
||||
const webUrl = getHttp() + host + (port && 80 != port ? ':' + port : ''),
|
||||
account = getQueryString('account'),
|
||||
const account = getQueryString('account'),
|
||||
token = getQueryString('token'),
|
||||
noLogin = !account || !token;
|
||||
|
||||
@@ -20,7 +10,7 @@ if (noLogin) {
|
||||
loadBarClear();
|
||||
loadBarFull();
|
||||
setTimeout(function () {
|
||||
window.location.href = webUrl + '/login';
|
||||
window.location.href = '/login';
|
||||
}, randomRange(250, 500));
|
||||
}, 1e3);
|
||||
}
|
||||
@@ -79,19 +69,18 @@ window['loginView'] = 'app.MainLoginView';
|
||||
|
||||
// 相关URL
|
||||
window['webHost'] = host;
|
||||
window['webUrl'] = webUrl;
|
||||
window['serviceListdUrl'] = webUrl + '/server';
|
||||
window['setServiceListdUrl'] = webUrl + '/server';
|
||||
window['payUrl'] = webUrl + '/pay';
|
||||
window['apiUrl'] = webUrl + '/api';
|
||||
window['orderUrl'] = webUrl + '/api?act=order';
|
||||
window['reportUrl'] = webUrl + '/api?act=report'; // 上报接口
|
||||
window['errorReportUrl'] = webUrl + '/api?act=report&do=error';// 错误上报接口
|
||||
window['checkUrl'] = webUrl + '/api?act=check'; // 验证URL
|
||||
window['versionUrl'] = webUrl + '/api?act=version'; // 请求客户端版本
|
||||
window['getActorInfoUrl'] = webUrl + '/api?act=actor';
|
||||
window['roleInfoUrl'] = webUrl + '/api?act=role';
|
||||
window['gongGaoUrl'] = webUrl + '/notice.txt';
|
||||
window['serviceListdUrl'] = '/server';
|
||||
window['setServiceListdUrl'] = '/server';
|
||||
window['payUrl'] = '/pay';
|
||||
window['apiUrl'] = '/api';
|
||||
window['orderUrl'] = '/api?act=order';
|
||||
window['reportUrl'] = '/api?act=report'; // 上报接口
|
||||
window['errorReportUrl'] = '/api?act=report&do=error';// 错误上报接口
|
||||
window['checkUrl'] = '/api?act=check'; // 验证URL
|
||||
window['versionUrl'] = '/api?act=version'; // 请求客户端版本
|
||||
window['getActorInfoUrl'] = '/api?act=actor';
|
||||
window['roleInfoUrl'] = '/api?act=role';
|
||||
window['gongGaoUrl'] = '/notice.txt';
|
||||
|
||||
// 客服信息
|
||||
window['kfQQ'] = '123456';
|
||||
@@ -341,7 +330,7 @@ function feedbackFunction(info) {
|
||||
param += key + '=' + msgInfo[key] + '&'
|
||||
}
|
||||
param = param.substring(0, param.length - 1)
|
||||
let srcStr = webUrl + '/api?' + param;
|
||||
let srcStr = '/api?' + param;
|
||||
const div = document.createElement('div');
|
||||
div.id = 'iframDiv';
|
||||
div.innerHTML = '<iframe id="main" scrolling="no" noresize="true" frameborder="0" style="width: 90%;height: 90%;padding-left:5%;padding-top:2%;" src=' + srcStr + '></iframe>';
|
||||
@@ -369,7 +358,7 @@ function feedbackFunction(info) {
|
||||
|
||||
// 防沉迷
|
||||
function IdCardFunction() {
|
||||
window.open(webUrl);
|
||||
window.open();
|
||||
}
|
||||
|
||||
function addQQGrp() {
|
||||
@@ -378,17 +367,17 @@ function addQQGrp() {
|
||||
|
||||
//下载YY游戏大厅
|
||||
function downYYGameHallFun() {
|
||||
window.open(webUrl);
|
||||
window.open();
|
||||
}
|
||||
|
||||
//开通会员
|
||||
function openYYVip() {
|
||||
window.open(webUrl);
|
||||
window.open();
|
||||
}
|
||||
|
||||
//开超玩会员
|
||||
function openChaoWanVip() {
|
||||
window.open(webUrl);
|
||||
window.open();
|
||||
}
|
||||
|
||||
function removeIfram() {
|
||||
|
||||
Reference in New Issue
Block a user