From ecf190fa0116fad49df8179eb033d7e920bd3b30 Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Mon, 21 Jul 2025 11:51:32 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E9=A1=B5=E9=9D=A2=E8=B0=83=E6=95=B4?= =?UTF-8?q?=202=E3=80=81=E7=94=A8=E6=88=B7=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 106 ++++++++++++------------- src/config/index.ts | 4 +- src/manifest.json | 4 +- src/pages.json | 2 +- src/pages/index/components/tab4.vue | 10 +-- src/pages/index/index.vue | 6 +- src/pages/index/search.vue | 2 +- src/pages/index/signUpCenter.vue | 2 +- src/pages/match/match.vue | 6 +- src/pages/promote/promote.vue | 8 +- src/pages/promote/rate.vue | 2 +- src/pages/signUp/info.vue | 82 +++++++++++++++++++- src/pages/signUp/self.vue | 88 ++++++++++++++++++++- src/pages/user/archive.vue | 7 +- src/pages/user/signIn.vue | 2 - src/pages/user/userDetail.vue | 115 +++++++++++++++++++++++++++- 16 files changed, 364 insertions(+), 82 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 86951a4..d221e44 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,9 +1,9 @@ import Request from 'luch-request' -import { tenantId, apiUrl, appSecret } from '@/config' +import {tenantId, apiUrl, appSecret} from '@/config' import { - getSign + getSign } from '@/utils/util' -import {getUserInfo} from "@/utils/user"; +import {clearUserInfo, getUserInfo} from "@/utils/user"; import {$toast} from "@/utils"; const http = new Request(); @@ -14,76 +14,76 @@ const http = new Request(); * @param {Function} */ http.setConfig((config) => { - /* config 为默认全局配置*/ - config.baseURL = apiUrl; /* 根域名 */ + /* config 为默认全局配置*/ + config.baseURL = apiUrl; /* 根域名 */ - return config + return config }) // 拦截器(请求之前拦截) http.interceptors.request.use((config) => { // 可使用async await 做异步操作 - const token = getUserInfo().token - config.header = { - ...config.header, - tenantId - } - if(token){ - config.header.Authorization = token - } - if (config.data) { - config.data.tenantId = tenantId - } - // console.log(config) - if (!token) { - // 如果token不存在,需要加签 - config.params.tenantId = tenantId - config.params.sign = getSign(config.params,appSecret); - }else { - - } - /** - /* 演示 - if (!token) { // 如果token不存在,return Promise.reject(config) 会取消本次请求 - return Promise.reject(config) - } - **/ - return config + const token = getUserInfo().token + config.header = { + ...config.header, + tenantId + } + if (config.data) { + config.data.tenantId = tenantId + } + if (!token) { + // 如果token不存在,需要加签 + config.params.tenantId = tenantId + config.params.sign = getSign(config.params, appSecret); + } + if (config.url !== '/login') { + if (token) { + config.header.Authorization = token + } + } + uni.showLoading({title: '数据加载中'}) + /** + /* 演示 + if (!token) { // 如果token不存在,return Promise.reject(config) 会取消本次请求 + return Promise.reject(config) + } + **/ + return config }, config => { // 可使用async await 做异步操作 - return Promise.reject(config) + return Promise.reject(config) }) // 拦截器(请求之后拦截) http.interceptors.response.use((response) => { - /* 对响应成功做点什么 可使用async await 做异步操作*/ - // if (response.data.code !== 200) { // 服务端返回的状态码不等于200,则reject() - // return Promise.reject(response) // return Promise.reject 可使promise状态进入catch - // if (response.config.custom.verification) { // 演示自定义参数的作用 - // return response.data - // } + /* 对响应成功做点什么 可使用async await 做异步操作*/ + // if (response.data.code !== 200) { // 服务端返回的状态码不等于200,则reject() + // return Promise.reject(response) // return Promise.reject 可使promise状态进入catch + // if (response.config.custom.verification) { // 演示自定义参数的作用 + // return response.data + // } - // token过期 - if (response.data.code == 401) { + // token过期 + if (response.data.code == 401) { + clearUserInfo() $toast('请重新登录') uni.redirectTo({url: '/pages/user/login'}) - } - if (response.data.code === 1) { + } + if (response.data.code === 1) { $toast(response.data.message) - return Promise.reject(response.data) - } - return response.data + return Promise.reject(response.data) + } + uni.hideLoading() + return response.data }, (response) => { - /* 对响应错误做点什么 (statusCode !== 200)*/ - return Promise.reject(response) + /* 对响应错误做点什么 (statusCode !== 200)*/ + return Promise.reject(response) }) export const post = (url, data) => { - return new Promise(resolve => { - console.log(data) - http.post(url, data).then(res => { - console.log(res) + return new Promise(resolve => { + http.post(url, data).then(res => { resolve(res) }) - }) + }) } export default http diff --git a/src/config/index.ts b/src/config/index.ts index 40d6c36..9cdc874 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -6,9 +6,9 @@ export const fileUrl = 'https://oss.wsdns.cn'; // 核心模块接口 // export const API_BASE_URL: string = 'http://127.0.0.1:9091/api'; // 主节点 -export const SERVER_API_URL = 'https://server.gxwebsoft.com/api'; +export const SERVER_API_URL = 'https://server-api.gjjd168.com/api'; // 模块接口地址 -export const MODULES_API_URL = 'https://gjjd-api.shwhl.com/api'; +export const MODULES_API_URL = 'https://api.gjjd168.com/api'; // export const MODULES_API_URL = 'http://127.0.0.1:9099/api'; // export const MODULES_API_URL = 'http://192.168.50.96:9099/api'; diff --git a/src/manifest.json b/src/manifest.json index a62e6f5..34369af 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -3,8 +3,8 @@ "appid" : "__UNI__06C03D0", //__UNI__06C03D0 "description" : "", - "versionName" : "2.2.2", - "versionCode" : "277", + "versionName" : "3.0.4", + "versionCode" : "282", "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { diff --git a/src/pages.json b/src/pages.json index 241d61d..c35bcd0 100644 --- a/src/pages.json +++ b/src/pages.json @@ -246,7 +246,7 @@ "path": "pages/article/info", "style": { "navigationStyle": "custom", - "navigationBarTextStyle": "white" + "navigationBarTextStyle": "black" } }, { diff --git a/src/pages/index/components/tab4.vue b/src/pages/index/components/tab4.vue index 4457aff..d57fb7b 100644 --- a/src/pages/index/components/tab4.vue +++ b/src/pages/index/components/tab4.vue @@ -56,13 +56,13 @@ + :autoplay="true" circular="true"> - - + + - + width="700rpx" height="280rpx"> + diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 911f331..9692f02 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -2,7 +2,7 @@ - + {{ dayjs(item.publishTime ? item.publishTime : item.createTime).format('YYYY-MM-DD') }} {{ item.actualViews + item.virtualViews }} 浏览 - {{ item.comments }} + diff --git a/src/pages/index/signUpCenter.vue b/src/pages/index/signUpCenter.vue index ee8c724..da80280 100644 --- a/src/pages/index/signUpCenter.vue +++ b/src/pages/index/signUpCenter.vue @@ -401,7 +401,7 @@ onMounted(() => { .train-item { - width: 470rpx; + width: 700rpx; height: auto; .name { diff --git a/src/pages/match/match.vue b/src/pages/match/match.vue index 4d4ad38..4390046 100644 --- a/src/pages/match/match.vue +++ b/src/pages/match/match.vue @@ -84,11 +84,11 @@ + circular="true"> - + - + + circular="true"> - + - + * + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +