From 8b55419643377b8ad6dcc166d7eda3e7d6c99be4 Mon Sep 17 00:00:00 2001 From: YuanHuakk <1751826683@qq.com> Date: Sat, 13 Sep 2025 16:26:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BE=9D=E8=B5=96=E5=8D=87=E7=BA=A7,bug=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 17 +- .env.development | 29 +-- .env.production | 14 +- .env.reserve | 8 + .env.test | 26 +- .idea/.gitignore | 8 + .idea/codeStyles/Project.xml | 60 +++++ .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/inspectionProfiles/Project_Default.xml | 7 + .idea/jdt-user.iml | 12 + .idea/modules.xml | 8 + .idea/prettier.xml | 6 + .idea/vcs.xml | 6 + components.d.ts | 4 +- config/index.ts | 12 +- package.json | 242 +++++++++---------- private.wx4a9380d8bb16d9de.key | 27 +++ src/api/game.ts | 4 + src/app.scss | 2 - src/config/index.ts | 10 - src/pages/game/gamehome/index.vue | 11 +- src/pages/user/index.vue | 77 +++--- src/utils/game_request.ts | 32 --- 23 files changed, 343 insertions(+), 284 deletions(-) create mode 100644 .env.reserve create mode 100644 .idea/.gitignore create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/jdt-user.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/prettier.xml create mode 100644 .idea/vcs.xml create mode 100644 private.wx4a9380d8bb16d9de.key create mode 100644 src/api/game.ts delete mode 100644 src/config/index.ts delete mode 100644 src/utils/game_request.ts diff --git a/.drone.yml b/.drone.yml index 07abec7..019d8e0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,7 +9,7 @@ platform: steps: - name: 测试服-构建部署 pull: if-not-exists - image: node:22-alpine + image: node:24-alpine when: branch: - test @@ -22,7 +22,7 @@ steps: - name: 正式服-构建部署 pull: if-not-exists - image: node:22-alpine + image: node:24-alpine when: branch: - master @@ -33,6 +33,19 @@ steps: - pnpm build:weapp:prod:upload - rm -rf dist.tar + - name: 备用服-构建部署 + pull: if-not-exists + image: node:24-alpine + when: + branch: + - master + commands: + - npm install -g pnpm + - pnpm config set registry https://registry.npmmirror.com/ + - pnpm install + - pnpm build:weapp:reserve:upload + - rm -rf dist.tar + - name: 企业微信通知 pull: if-not-exists image: plugins/webhook diff --git a/.env.development b/.env.development index 6acd4cf..3aebef6 100644 --- a/.env.development +++ b/.env.development @@ -2,32 +2,7 @@ TARO_APP_ID='wx7b3322daa2cf9c88' # 开发版appkey -TARO_APP_KEY='1234567890' +TARO_APP_KEY='' # API接口 -TARO_APP_API='https://test.wanzhuanyongcheng.cn/app' - -# 骰子游戏链接 -TARO_APP_GAME='https://jdt-test-tz.wanzhuanyongcheng.cn/pages/index/index?uid=' -# TARO_APP_GAME='http://192.168.31.225:10086?uid=' - -# 捕鱼游戏链接 -TARO_APP_FISH_GAME='https://jdt-test-fish.wanzhuanyongcheng.cn/?uid=' - -# 游戏API -TARO_APP_HALL_API='https://game.wanzhuanyongcheng.cn' - -# 游戏大厅 -TARO_APP_HOME='https://test.wanzhuanyongcheng.cn/app/game' - -# 游戏ws链接 -TARO_APP_WS='wss://game.wanzhuanyongcheng.cn/dice/home' - -# 大转盘ws -TARO_APP_TURNTABLE_WS='wss://game2.wanzhuanyongcheng.cn/turntable/home' - -# 大转盘api -TARO_APP_TURNTABLE_API='https://game2.wanzhuanyongcheng.cn/turntable' - -# 澳拾 -TARO_APP_AOSHI_API='https://game3.wanzhuanyongcheng.cn' \ No newline at end of file +TARO_APP_API='https://test.wanzhuanyongcheng.cn/app' \ No newline at end of file diff --git a/.env.production b/.env.production index 3290875..47482e1 100644 --- a/.env.production +++ b/.env.production @@ -1,16 +1,8 @@ -# 正式版版appid +# 正式版appid TARO_APP_ID='wxdd00d46fa6f07974' -# 开发版appkey +# 正式版appkey TARO_APP_KEY='private.wxdd00d46fa6f07974.key' # API接口 -TARO_APP_API='https://www.wanzhuanyongcheng.cn/app' - -TARO_APP_GAME='https://jdt-prod-tz.wanzhuanyongcheng.cn/pages/index/index?uid=' - -# 捕鱼游戏链接 -TARO_APP_FISH_GAME='https://jdt-prod-fish.wanzhuanyongcheng.cn/?uid=' - -# 游戏大厅 -TARO_APP_HOME='https://www.wanzhuanyongcheng.cn/app/game' \ No newline at end of file +TARO_APP_API='https://www.wanzhuanyongcheng.cn/app' \ No newline at end of file diff --git a/.env.reserve b/.env.reserve new file mode 100644 index 0000000..fc3b697 --- /dev/null +++ b/.env.reserve @@ -0,0 +1,8 @@ +# 正式版appid +TARO_APP_ID='wx4a9380d8bb16d9de' + +# 正式版appkey +TARO_APP_KEY='private.wx4a9380d8bb16d9de.key' + +# API接口 +TARO_APP_API='https://api.gxwzwh.com/app' \ No newline at end of file diff --git a/.env.test b/.env.test index edc2ef8..1120df4 100644 --- a/.env.test +++ b/.env.test @@ -5,28 +5,4 @@ TARO_APP_ID='wx7b3322daa2cf9c88' TARO_APP_KEY='private.wx7b3322daa2cf9c88.key' # API接口 -TARO_APP_API='https://test.wanzhuanyongcheng.cn/app' - -# 游戏链接 -TARO_APP_GAME='https://jdt-test-tz.wanzhuanyongcheng.cn/pages/index/index?uid=' - -# 捕鱼游戏链接 -TARO_APP_FISH_GAME='https://jdt-test-fish.wanzhuanyongcheng.cn/?uid=' - -# 游戏API -TARO_APP_HALL_API='https://game.wanzhuanyongcheng.cn' - -# 游戏大厅 -TARO_APP_HOME='https://test.wanzhuanyongcheng.cn/app/game' - -# 游戏ws链接 -TARO_APP_WS='wss://game.wanzhuanyongcheng.cn/dice/home' - -# 大转盘ws -TARO_APP_TURNTABLE_WS='wss://game2.wanzhuanyongcheng.cn/turntable/home' - -# 大转盘api -TARO_APP_TURNTABLE_API='https://game2.wanzhuanyongcheng.cn/turntable' - -# 澳拾 -TARO_APP_AOSHI_API='https://game3.wanzhuanyongcheng.cn' \ No newline at end of file +TARO_APP_API='https://test.wanzhuanyongcheng.cn/app' \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..35410ca --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..2e77a2e --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,60 @@ + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..7c4836f --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/.idea/jdt-user.iml b/.idea/jdt-user.iml new file mode 100644 index 0000000..24643cc --- /dev/null +++ b/.idea/jdt-user.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..df5e3fa --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/prettier.xml b/.idea/prettier.xml new file mode 100644 index 0000000..b0c1c68 --- /dev/null +++ b/.idea/prettier.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/components.d.ts b/components.d.ts index 14a87fa..a2592ba 100644 --- a/components.d.ts +++ b/components.d.ts @@ -3,7 +3,7 @@ // Generated by unplugin-vue-components // Read more: https://github.com/vuejs/core/pull/3399 // biome-ignore lint: disable -export {}; +export {} /* prettier-ignore */ declare module 'vue' { @@ -42,6 +42,8 @@ declare module 'vue' { NutSwiper: typeof import('@nutui/nutui-taro')['Swiper'] NutSwiperItem: typeof import('@nutui/nutui-taro')['SwiperItem'] NutSwitch: typeof import('@nutui/nutui-taro')['Switch'] + NutTabbar: typeof import('@nutui/nutui-taro')['Tabbar'] + NutTabbarItem: typeof import('@nutui/nutui-taro')['TabbarItem'] NutTable: typeof import('@nutui/nutui-taro')['Table'] NutTabPane: typeof import('@nutui/nutui-taro')['TabPane'] NutTabs: typeof import('@nutui/nutui-taro')['Tabs'] diff --git a/config/index.ts b/config/index.ts index 7f09230..1c812e0 100644 --- a/config/index.ts +++ b/config/index.ts @@ -4,21 +4,21 @@ import { UnifiedWebpackPluginV5 } from 'weapp-tailwindcss/webpack'; import { join } from 'node:path'; import { argv } from 'yargs'; -const { robot = 1, desc } = argv; - const CIPluginOptFn = async () => { /** * @typedef { import('@tarojs/plugin-mini-ci').CIOptions } CIOptions * @type {CIOptions} */ + const parsedArgs = await argv; + return { weapp: { appid: process.env.TARO_APP_ID, privateKeyPath: process.env.TARO_APP_KEY, - robot, + robot: parsedArgs.robot || 1, }, - desc, + desc: parsedArgs.desc, }; }; @@ -48,7 +48,7 @@ const config = { framework: 'vue3', compiler: { type: 'webpack5', - prebundle: { enable: false }, + prebundle: { enable: process.env.TARO_ENV === 'h5' }, }, cache: { enable: false, // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache @@ -98,7 +98,7 @@ const config = { }, }, cssModules: { - enable: true, // 默认为 false,如需使用 css modules 功能,则设为 true + enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true config: { namingPattern: 'module', // 转换模式,取值为 global/module generateScopedName: '[name]__[local]___[hash:base64:5]', diff --git a/package.json b/package.json index aea2258..77f6752 100644 --- a/package.json +++ b/package.json @@ -1,126 +1,120 @@ { - "name": "jdt-user", - "version": "4.0.11", - "private": true, - "description": "", - "templateInfo": { - "name": "jdt-user", - "typescript": true, - "css": "sass" - }, - "taroConfig": { - "version": "4.0.11" - }, - "scripts": { - "build:weapp": "taro build --type weapp", - "build:test": "taro build --type weapp --mode test", - "build:swan": "taro build --type swan", - "build:alipay": "taro build --type alipay", - "build:tt": "taro build --type tt", - "build:h5": "taro build --type h5", - "build:rn": "taro build --type rn", - "build:qq": "taro build --type qq", - "build:jd": "taro build --type jd", - "build:quickapp": "taro build --type quickapp", - "dev:weapp": "taro build --type weapp --watch", - "dev:weapp:prview": "taro build --type weapp --watch --mode production", - "dev:swan": "npm run build:swan -- --watch", - "dev:alipay": "npm run build:alipay -- --watch", - "dev:tt": "npm run build:tt -- --watch", - "dev:h5": "npm run build:h5 -- --watch", - "dev:rn": "npm run build:rn -- --watch", - "dev:qq": "npm run build:qq -- --watch", - "dev:jd": "npm run build:jd -- --watch", - "dev:quickapp": "npm run build:quickapp -- --watch", - "lint": "eslint --ext .ts,.vue .", - "lint:fix": "eslint --fix --ext .ts,.vue .", - "lint:staged": "lint-staged", - "prepare": "husky install", - "cz": "cz", - "lf": "npx prettier --write", - "postinstall": "weapp-tw patch", - "build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'", - "build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test" - }, - "browserslist": [ - "last 3 versions", - "Android >= 4.1", - "ios >= 8" - ], - "author": "", - "lint-staged": { - "*.{ts,vue}": [ - "eslint --ext .ts,.vue .", - "npx prettier --write --end-of-line lf ." - ] - }, - "config": { - "commitizen": { - "path": "node_modules/cz-customizable" - } - }, - "dependencies": { - "@babel/runtime": "^7.28.4", - "@nutui/icons-vue-taro": "^0.0.9", - "@nutui/nutui-taro": "^4.3.14", - "@qiun/vue-ucharts": "2.5.0-20230101", - "@tarojs/components": "4.1.6", - "@tarojs/helper": "4.1.6", - "@tarojs/plugin-framework-vue3": "4.1.6", - "@tarojs/plugin-html": "4.1.6", - "@tarojs/plugin-platform-alipay": "4.1.6", - "@tarojs/plugin-platform-h5": "4.1.6", - "@tarojs/plugin-platform-jd": "4.1.6", - "@tarojs/plugin-platform-qq": "4.1.6", - "@tarojs/plugin-platform-swan": "4.1.6", - "@tarojs/plugin-platform-tt": "4.1.6", - "@tarojs/plugin-platform-weapp": "4.1.6", - "@tarojs/runtime": "4.1.6", - "@tarojs/shared": "4.1.6", - "@tarojs/taro": "4.1.6", - "dayjs": "^1.11.18", - "pinia": "^2.3.1", - "uqrcodejs": "^4.0.7", - "vue": "^3.5.21" - }, - "devDependencies": { - "@babel/core": "^7.28.4", - "@commitlint/cli": "^18.6.1", - "@commitlint/config-conventional": "^18.6.3", - "@tarojs/cli": "4.1.6", - "@tarojs/plugin-mini-ci": "4.1.6", - "@tarojs/taro-loader": "4.1.6", - "@tarojs/webpack5-runner": "4.1.6", - "@types/node": "^18.19.124", - "@types/webpack-env": "^1.18.8", - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/parser": "^6.21.0", - "@unocss/webpack": "^0.60.4", - "@vue/babel-plugin-jsx": "^1.5.0", - "@vue/compiler-sfc": "^3.5.21", - "autoprefixer": "^10.4.21", - "babel-preset-taro": "4.1.6", - "commitizen": "^4.3.1", - "css-loader": "3.4.2", - "cz-customizable": "^7.5.1", - "eslint": "^8.57.1", - "eslint-config-taro": "4.1.6", - "eslint-plugin-vue": "^9.33.0", - "husky": "^8.0.3", - "lint-staged": "^15.5.2", - "miniprogram-ci": "^2.1.26", - "postcss": "8.4.29", - "postcss-rem-to-responsive-pixel": "^6.1.0", - "prettier": "^3.6.2", - "style-loader": "1.3.0", - "stylelint": "9.3.0", - "tailwindcss": "^3.4.17", - "ts-node": "^10.9.2", - "typescript": "^5.9.2", - "unplugin-vue-components": "^28.8.0", - "vue-loader": "^17.4.2", - "weapp-tailwindcss": "^3.7.0", - "webpack": "^5.101.3", - "yargs": "^17.7.2" - } + "name": "jdt-user", + "version": "4.0.12", + "taroConfig": { + "version": "4.0.12" + }, + "scripts": { + "build:weapp": "taro build --type weapp", + "build:test": "taro build --type weapp --mode test", + "build:swan": "taro build --type swan", + "build:alipay": "taro build --type alipay", + "build:tt": "taro build --type tt", + "build:h5": "taro build --type h5", + "build:rn": "taro build --type rn", + "build:qq": "taro build --type qq", + "build:jd": "taro build --type jd", + "build:quickapp": "taro build --type quickapp", + "dev:weapp": "taro build --type weapp --watch", + "dev:weapp:prview": "taro build --type weapp --watch --mode production", + "dev:swan": "npm run build:swan -- --watch", + "dev:alipay": "npm run build:alipay -- --watch", + "dev:tt": "npm run build:tt -- --watch", + "dev:h5": "npm run build:h5 -- --watch", + "dev:rn": "npm run build:rn -- --watch", + "dev:qq": "npm run build:qq -- --watch", + "dev:jd": "npm run build:jd -- --watch", + "dev:quickapp": "npm run build:quickapp -- --watch", + "lint": "eslint --ext .ts,.vue .", + "lint:fix": "eslint --fix --ext .ts,.vue .", + "lint:staged": "lint-staged", + "prepare": "husky install", + "cz": "cz", + "postinstall": "weapp-tw patch", + "build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'", + "build:weapp:reserve:upload": "taro build --type weapp --upload --robot=3 --desc='备用环境' --mode reserve", + "build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test" + }, + "browserslist": [ + "last 3 versions", + "Android >= 4.1", + "ios >= 8" + ], + "author": "", + "lint-staged": { + "*.{ts,vue}": [ + "eslint --ext .ts,.vue .", + "npx prettier --write --end-of-line lf ." + ] + }, + "config": { + "commitizen": { + "path": "node_modules/cz-customizable" + } + }, + "dependencies": { + "@babel/runtime": "^7.28.4", + "@nutui/icons-vue-taro": "^0.0.9", + "@nutui/nutui-taro": "^4.3.14", + "@qiun/vue-ucharts": "2.5.0-20230101", + "@tarojs/components": "4.1.6", + "@tarojs/helper": "4.1.6", + "@tarojs/plugin-framework-vue3": "4.1.6", + "@tarojs/plugin-html": "4.1.6", + "@tarojs/plugin-platform-alipay": "4.1.6", + "@tarojs/plugin-platform-h5": "4.1.6", + "@tarojs/plugin-platform-jd": "4.1.6", + "@tarojs/plugin-platform-qq": "4.1.6", + "@tarojs/plugin-platform-swan": "4.1.6", + "@tarojs/plugin-platform-tt": "4.1.6", + "@tarojs/plugin-platform-weapp": "4.1.6", + "@tarojs/runtime": "4.1.6", + "@tarojs/shared": "4.1.6", + "@tarojs/taro": "4.1.6", + "dayjs": "^1.11.18", + "pinia": "^2.3.1", + "uqrcodejs": "^4.0.7", + "vue": "^3.5.21" + }, + "devDependencies": { + "@babel/core": "^7.28.4", + "@commitlint/cli": "^18.6.1", + "@commitlint/config-conventional": "^18.6.3", + "@tarojs/cli": "4.1.6", + "@tarojs/plugin-mini-ci": "4.1.6", + "@tarojs/taro-loader": "4.1.6", + "@tarojs/webpack5-runner": "4.1.6", + "@types/node": "^18.19.124", + "@types/webpack-env": "^1.18.8", + "@types/yargs": "^17.0.33", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", + "@unocss/webpack": "^0.60.4", + "@vue/babel-plugin-jsx": "^1.5.0", + "@vue/compiler-sfc": "^3.5.21", + "autoprefixer": "^10.4.21", + "babel-preset-taro": "4.1.6", + "commitizen": "^4.3.1", + "css-loader": "3.4.2", + "cz-customizable": "^7.5.1", + "eslint": "^8.57.1", + "eslint-config-taro": "4.1.6", + "eslint-plugin-vue": "^9.33.0", + "husky": "^8.0.3", + "lint-staged": "^15.5.2", + "miniprogram-ci": "^2.1.26", + "postcss": "8.4.29", + "postcss-rem-to-responsive-pixel": "^6.1.0", + "prettier": "^3.6.2", + "style-loader": "1.3.0", + "stylelint": "9.3.0", + "tailwindcss": "^3.4.17", + "ts-node": "^10.9.2", + "typescript": "^5.9.2", + "unplugin-vue-components": "^28.8.0", + "vue-loader": "^17.4.2", + "weapp-tailwindcss": "^3.7.0", + "webpack": "^5.101.3", + "yargs": "^17.7.2" + } } diff --git a/private.wx4a9380d8bb16d9de.key b/private.wx4a9380d8bb16d9de.key new file mode 100644 index 0000000..2e42150 --- /dev/null +++ b/private.wx4a9380d8bb16d9de.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEogIBAAKCAQEAmHk5BywZ6y2rji/dL2HooKGiTuHrcSeGFODvDK6PPUjnieWB +ev7C6N9kBWNbtYiwyLVpW5iKCxCb/GaBa5EIE0nXnKiOhThP3a8OYDW0oA9Xyp03 +1W56U3tnHA/GziyABIIMxqA45WYh3e9ar/sdhDvDyre0yl+8cWcPdNOVOW7as88W +yXDsCQbQedPIAy3sRANZ6K2QTNe5Aht3Y7F1uMKRlJwLodutUopPd32rxJz7WNhB +j9CrjzgnfLJa7siURM2r6om2osNFqHP4bmy5yO68TPI8JQgJTUqoNswgFDa2ng9Y +lOhks6kMR8ldL89+fYqILGDVG7124LKIo1awTQIDAQABAoIBACS+Kaj5zrEmy02z +aRjO/lEfQk7CEIuvG5eScOjcc/YvyGQpo18xX2Tg2GiX/fSsIPXtCZuiEboC4aQc +S5nRVGHZjJTa5aVi4ZQpaEx1BLcBm4VfB6JuQho2Ba30e1MZ1CvB7zQ6Thux1f12 +faMk34MLJ+6FAJM4KOAnFslvZ2l0VxIlBq5pbF71dO/MsIrpBWVFNGqu6jtXRUJw +J92PbaFMi/smsgdXixsokzPmE5em3zLdp5cfHQCRBjNBclMjlnHhwQVK8wU7D609 +CPcvPS8J3PMceMeGXC1QXFANllVecmn7jECVBU5H4Ed0pb89T9Q7yWVnVBo31ZB7 +r4GuL+ECgYEAyLcE4cuPsp31oaKATSZrBmypQuGFsarddyereN8ATZ9DjbFL9Y2/ +NazLmG1KjeD1yN1q9/ek+nctKTNzuY14cVeahDoiv0ALNUOuS7IFzoHWf5SnNKEx +oEgGJV9D6olk9YnPF5iwn/lRL84af3dxSnKr75hh8Yv5hWrPnJ95xJkCgYEAwniQ +z6yFg2SmnzwwYV72/aoukmsI3KKBHMEDkAFOummy7iv8eT+9DLumQ9BC+mT3eFmq +GVNVM+199NTQ5b5CzXYalSsw93rewhRkk0RVV31AJUwaRbYy6F6O502SpFYb4n8f +S7KfDv70utGOnycMBNjeaFGWxAZbUCLjfUv8JdUCgYBb1fGz5lHPZhrXY+TUZ/mc +LOedJFbpncZLGKmKWm5nFbHxCOg6aCrOwks9aPQtynpq93RUFMk1mIXfTh1rDuHG +6lBWo8r2OrVmH5uGIuQpQpsEMN34ZLCyJ4I4Y0hN7aN1/SH2J/TYnViaSPEy1VHO +wH0O2Wgm/uaiNubbQNSUMQKBgCXT5fc/i8j/LxoSTybhnhHBpMV+ZH7mbU72jIba +ekHwhYmmrLm5GED9z12piR3Dvg9/AYNjnlM3gyS4sNm/pKbqrkkN2byJ/gKqjNXI +mQEnr+6RWxrsUgK5QfrkL/4fcdUg/SlwWVhFZ71fPerfYYsf1ENee4Et610vLCkX +OrjxAoGATIlZgaPuDA/Sh/YTxxSEjNZGCWx4YvWZfL+PW2ItuadMeD2lLai6lOOi +9ew2xXZkvaeA9PGOA5YK2121M5brwkB0Kc3zNvEmrkpQDJYqeoRvLEuFGDmZ/MX1 +p0bzKs1vvh5dyFjWQ5IN9FckZ3Fpk6A1zMEuyQdk35TwX+w5EdE= +-----END RSA PRIVATE KEY----- diff --git a/src/api/game.ts b/src/api/game.ts new file mode 100644 index 0000000..22bf28b --- /dev/null +++ b/src/api/game.ts @@ -0,0 +1,4 @@ +import request from '../utils/request'; + +// 获取游戏列表 +export const getGameList = () => request('/game', {}, 'POST'); diff --git a/src/app.scss b/src/app.scss index 9da775c..cc4350c 100644 --- a/src/app.scss +++ b/src/app.scss @@ -5,8 +5,6 @@ page { background-color: #f5f5f5; - // font-size: 30rpx; - // IOS安全区域 padding-bottom: constant(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom); } diff --git a/src/config/index.ts b/src/config/index.ts deleted file mode 100644 index f0f6768..0000000 --- a/src/config/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -// 用于配置项目的一些常量,如接口地址、websocket地址等 -import Taro from '@tarojs/taro'; - -export const app = { - API_URL: () => `${process.env.TARO_APP_HALL_API}`, - API_WS: () => - `${process.env.TARO_APP_WS}?uid=${Taro.getStorageSync('uid')}&game_id=${ - Taro.getStorageSync('gameItem').ID - }`, -}; diff --git a/src/pages/game/gamehome/index.vue b/src/pages/game/gamehome/index.vue index 6a7475f..bd8550e 100644 --- a/src/pages/game/gamehome/index.vue +++ b/src/pages/game/gamehome/index.vue @@ -16,6 +16,7 @@ import { ref } from 'vue'; import Taro from '@tarojs/taro'; import { getPersonalInfo } from '@/api/user'; +import { getGameList } from '@/api/game'; const list = ref([]); @@ -55,14 +56,8 @@ const getUserInfo = async () => { const getList = async () => { // console.log(process.env.TARO_APP_HALL_API) - Taro.request({ - url: `${process.env.TARO_APP_HOME}`, - method: 'POST', - success: ({ data: res }) => { - list.value = - res.data.data.sort((a: any, b: any) => b.sort - a.sort) || []; - }, - }); + const res = await getGameList(); + list.value = res.data.data.sort((a: any, b: any) => b.sort - a.sort) || []; }; const toPage = item => { diff --git a/src/pages/user/index.vue b/src/pages/user/index.vue index 2895043..94bd8a1 100644 --- a/src/pages/user/index.vue +++ b/src/pages/user/index.vue @@ -1,14 +1,14 @@