fix: 修复本地开发环境配置和UI文本问题
- 将RankListMini中的分享链接改为本地开发环境 - 添加userType值的alert调试 - 修改minihome页面的"海外资讯"为"海外精选" - 移除requestClass中的调试日志和优化GET请求处理
This commit is contained in:
parent
5f0242d697
commit
fbea363bb8
|
|
@ -161,14 +161,16 @@ function goDetail(item) {
|
||||||
|
|
||||||
// if (judgeRuntimeEnv().isWxMiniWebview) {
|
// if (judgeRuntimeEnv().isWxMiniWebview) {
|
||||||
let shareUrl =
|
let shareUrl =
|
||||||
"https://cankao.cs.com.cn/jnh/#/pages/detail/indexNewsInfo?id=" +
|
// "https://cankao.cs.com.cn/jnh/#/pages/detail/indexNewsInfo?id=" +
|
||||||
// "http://localhost:8881/jnh/#/pages/detail/indexNewsInfo?id=" +
|
"http://localhost:8881/jnh/#/pages/detail/indexNewsInfo?id=" +
|
||||||
item.news_id +
|
item.news_id +
|
||||||
"&phone=" +
|
"&phone=" +
|
||||||
uni.getStorageSync("token") +
|
uni.getStorageSync("token") +
|
||||||
"&userType=" +
|
"&userType=" +
|
||||||
userType.value;
|
userType.value;
|
||||||
|
|
||||||
|
alert(userType.value);
|
||||||
|
|
||||||
wx.miniProgram.navigateTo({
|
wx.miniProgram.navigateTo({
|
||||||
url: "/pages/webView/index?url=" + encodeURIComponent(shareUrl),
|
url: "/pages/webView/index?url=" + encodeURIComponent(shareUrl),
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
<view class="r_tab">
|
<view class="r_tab">
|
||||||
<view style="display: flex; align-items: center; gap: 20rpx">
|
<view style="display: flex; align-items: center; gap: 20rpx">
|
||||||
<view style="display: flex; flex-direction: column; align-items: center">
|
<view style="display: flex; flex-direction: column; align-items: center">
|
||||||
<view class="tab_item" @click="tabChange(0)">海外资讯</view>
|
<view class="tab_item" @click="tabChange(0)">海外精选</view>
|
||||||
<view class="tab_line" :style="{ opacity: tabIndex == 0 ? 1 : 0 }"></view>
|
<view class="tab_line" :style="{ opacity: tabIndex == 0 ? 1 : 0 }"></view>
|
||||||
</view>
|
</view>
|
||||||
<view style="display: flex; flex-direction: column; align-items: center">
|
<view style="display: flex; flex-direction: column; align-items: center">
|
||||||
|
|
@ -181,7 +181,6 @@ onShow(() => {
|
||||||
const userParams = ref({});
|
const userParams = ref({});
|
||||||
|
|
||||||
onLoad((option) => {
|
onLoad((option) => {
|
||||||
console.log("🚀 ~ option:", option);
|
|
||||||
userParams.value = option;
|
userParams.value = option;
|
||||||
if (userParams.value.phone) {
|
if (userParams.value.phone) {
|
||||||
uni.setStorageSync("token", userParams.value.phone);
|
uni.setStorageSync("token", userParams.value.phone);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ class requestClass {
|
||||||
// 拦截器
|
// 拦截器
|
||||||
interceptors = {
|
interceptors = {
|
||||||
request: (func: Fn) => {
|
request: (func: Fn) => {
|
||||||
console.log("🚀 ~ requestClass ~ func:", func)
|
|
||||||
if (func) {
|
if (func) {
|
||||||
requestClass[requestBefore] = func;
|
requestClass[requestBefore] = func;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -53,12 +52,10 @@ class requestClass {
|
||||||
request(options: UniApp.RequestOptions & { baseURL?: string }) {
|
request(options: UniApp.RequestOptions & { baseURL?: string }) {
|
||||||
options.baseURL = options.baseURL || this[config].baseURL;
|
options.baseURL = options.baseURL || this[config].baseURL;
|
||||||
options.dataType = options.dataType || this[config].dataType;
|
options.dataType = options.dataType || this[config].dataType;
|
||||||
options.url = requestClass[isCompleteURL](options.url)
|
options.url = requestClass[isCompleteURL](options.url) ? options.url : options.baseURL + options.url;
|
||||||
? options.url
|
|
||||||
: options.baseURL + options.url;
|
|
||||||
|
|
||||||
// 新增:如果是GET请求且data为空对象,则删除data
|
// 新增:如果是GET请求且data为空对象,则删除data
|
||||||
if (options.method === 'GET' && options.data && Object.keys(options.data).length === 0) {
|
if (options.method === "GET" && options.data && Object.keys(options.data).length === 0) {
|
||||||
delete options.data;
|
delete options.data;
|
||||||
} else {
|
} else {
|
||||||
options.data = options.data;
|
options.data = options.data;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue