Compare commits

..

23 Commits

Author SHA1 Message Date
YunaiV 41211d17b3 fix: 修复 H5 分享链接未绑定推广用户 2026-05-31 16:35:09 +08:00
YunaiV 164551a22e fix: 修复刷新令牌缺失后不弹登录框
刷新令牌缺失时不再标记为刷新中,避免刷新状态永久卡住,导致后续访问订单等登录接口时不弹出登录框。
2026-05-31 10:58:37 +08:00
YunaiV 6587fb15c6 fix: 登录失效时未弹出登录框
将 isRefreshToken = true 移到 getRefreshToken() 检查之后:
当本地无 refreshToken 时,提前 return handleAuthorized() 会绕过
finally 块,导致 isRefreshToken 永久卡在 true,后续所有 401
请求静默进入队列而不弹登录框。

修复 https://github.com/yudaocode/yudao-mall-uniapp/issues/38
2026-05-31 10:56:38 +08:00
YunaiV d6f272ad75 fix: 显式声明 Vue 依赖
显式声明 vue 依赖版本,避免 npm install 时因 Pinia peer dependency 解析到 Vue 2 而必须添加 --legacy-peer-deps。
2026-05-31 10:45:09 +08:00
芋道源码 2c489b2cab
!181 feat: 增加体验版后端接口地址判断
Merge pull request !181 from 背起行囊/master
2026-05-31 02:31:24 +00:00
zhangfengchen 5ccddfa082 docs: 增加体验版后端接口地址判断 2026-05-26 09:43:57 +08:00
zhangfengchen be05df9d91 feat: 增加体验版后端接口地址判断-方法抽离 2026-05-26 09:24:30 +08:00
zhangfengchen ef6ba21a56 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	.env
2026-05-25 17:51:08 +08:00
zhangfengchen c6c240115d feat: 增加体验版后端接口地址判断 2026-05-25 17:50:49 +08:00
zhangfengchen a6c4179611 feat: 增加体验版后端接口地址判断 2026-05-25 17:47:06 +08:00
芋道源码 75eed2ba19
!178 refactor(store): 优化 Pinia store 定义方式
Merge pull request !178 from 爱宇阳/master
2026-05-23 09:30:01 +00:00
芋道源码 9e7ef1e9f1
!179 update pages/commission/promoter.vue.
Merge pull request !179 from 爱宇阳/N/A
2026-05-23 09:06:14 +00:00
芋道源码 3a27171cda
!180 chore(s-layout): 支持定义顶部导航栏背景颜色
Merge pull request !180 from 背起行囊/master
2026-05-23 08:59:46 +00:00
zhangfengchen 014b0dd508 chore(s-layout): 支持定义顶部导航栏背景颜色 2026-05-21 14:46:49 +08:00
爱宇阳 c034b59a7b
update pages/commission/promoter.vue.
修复getList()未定义错误

Signed-off-by: 爱宇阳 <thedanyang@qq.com>
2026-05-13 03:42:48 +00:00
YunaiV 0533985189 (〃'▽'〃)_v2026_04_发布:新增代码生成器 Excel 导入,增强 IoT 场景联动与数据流转 2026-05-10 11:01:21 +08:00
aiyvyang 43d2d02e8e refactor(store): 优化 Pinia store 定义方式
将所有 store 模块从旧版 defineStore({ id: 'xxx', ... }) 形式
改为新版 defineStore('xxx', { ... }) 形式,符合 Pinia 推荐的最佳实践。

涉及模块:
  - app.js
  - cart.js
  - modal.js
  - sys.js
  - user.js
2026-05-09 15:36:10 +08:00
YunaiV b6b0ca3dbd fix: 修复 H5 公众号微信 JSSDK 签名 URL 错用 location.origin 导致 wx.config invalid signature,改用 location.href.split('#')[0] 2026-05-02 23:20:49 +08:00
YunaiV 0d0017eac7 Merge branch 'master' of https://github.com/yudaocode/yudao-mall-uniapp 2026-04-18 13:38:46 +08:00
YunaiV 5c2377b482 (〃'▽'〃)_v2026_03_发布:新增 MES 制造执行系统,IoT 接入 Modbus 协议 2026-04-18 13:38:25 +08:00
YunaiV 1346f8bf3b fix: 修复团队列表分页重置和订单数字段显示问题 2026-03-08 10:02:59 +08:00
芋道源码 d18d67dd62
Merge pull request #33 from greyfilm/master
fix:修复分销提现页银行名称存储问题,兼容管理端回显
2026-02-07 12:41:22 +08:00
greyfilm f2bfb2d79b fix:修复分销提现页银行名称存储问题,兼容管理端回显 2026-02-01 17:49:49 +08:00
17 changed files with 87 additions and 29 deletions

5
.env
View File

@ -1,9 +1,12 @@
# 版本号
SHOPRO_VERSION=v2.4.1
# 后端接口 - 正式环境(通过 process.env.NODE_ENV 非 development
# 后端接口 - 正式环境(通过 process.env.NODE_ENV 非 development -生产环境-release
SHOPRO_BASE_URL=http://api-dashboard.yudao.iocoder.cn
# 后端接口 - 体验环境(通过 process.env.NODE_ENV 非 development -体验环境-trial
SHOPRO_TRIAL_BASE_URL=http://api-dashboard.yudao.iocoder.cn/trial
# 后端接口 - 测试环境(通过 process.env.NODE_ENV = development
SHOPRO_DEV_BASE_URL=http://127.0.0.1:48080
### SHOPRO_DEV_BASE_URL=http://10.171.1.188:48080

View File

@ -2,7 +2,7 @@
"name": "芋道商城",
"appid": "__UNI__460BC4C",
"description": "基于 uni-app + Vue3 技术驱动的在线商城系统,内含诸多功能与丰富的活动,期待您的使用和反馈。",
"versionName": "2026.01",
"versionName": "2026.04",
"versionCode": "183",
"transformPx": false,
"app-plus": {

View File

@ -2,7 +2,7 @@
"id": "shopro",
"name": "shopro",
"displayName": "芋道商城",
"version": "2026.01",
"version": "2026.04",
"description": "芋道商城一套代码同时发行到iOS、Android、H5、微信小程序多个平台请使用手机扫码快速体验强大功能",
"scripts": {
"prettier": "prettier --write \"{pages,sheep}/**/*.{js,json,tsx,css,less,scss,vue,html,md}\""
@ -94,6 +94,7 @@
"luch-request": "^3.0.8",
"pinia": "^2.0.33",
"pinia-plugin-persist-uni": "^1.2.0",
"vue": "^3.5.11",
"weixin-js-sdk": "^1.6.0"
},
"devDependencies": {

View File

@ -105,7 +105,7 @@
return;
}
state.pagination.pageNo++;
getList();
getRankList();
}
//

View File

@ -163,7 +163,7 @@
<text class="num font-color">{{ item.brokerageUserCount || 0 }} </text>
</view>
<view>
<text class="num">{{ item.orderCount || 0 }}</text
<text class="num">{{ item.brokerageOrderCount || 0 }}</text
></view
>
<view>
@ -320,6 +320,7 @@
function setType(e) {
state.pagination.list = [];
state.pagination.pageNo = 1;
state.level = e + '';
getTeamList();
}

View File

@ -115,7 +115,7 @@
>
<uni-easyinput
:inputBorder="false"
:value="state.accountInfo.bankName"
:value="bankNameLabel"
placeholder="请选择银行"
suffixIcon="right"
disabled
@ -164,7 +164,7 @@
</template>
<script setup>
import { onBeforeMount, reactive } from 'vue';
import { onBeforeMount, reactive, computed } from 'vue';
import sheep from '@/sheep';
import accountTypeSelect from './components/account-type-select.vue';
import { fen2yuan } from '@/sheep/hooks/useGoods';
@ -199,6 +199,14 @@
bankListSelectedIndex: '', // bankList index
});
const bankNameLabel = computed(() => {
if (!state.accountInfo.bankName || !state.bankList || state.bankList.length === 0) {
return '';
}
const item = state.bankList.find((it) => it.value === state.accountInfo.bankName);
return item ? item.label : '';
});
//
const onAccountSelect = (e) => {
state.accountSelect = e;
@ -300,7 +308,8 @@
function bankChange(e) {
const value = e.detail.value;
state.bankListSelectedIndex = value;
state.accountInfo.bankName = state.bankList[value].label;
const item = state.bankList[value];
state.accountInfo.bankName = item ? item.value : undefined;
}
onBeforeMount(() => {

View File

@ -12,6 +12,7 @@
:color="color"
:tools="tools"
:opacityBgUi="opacityBgUi"
:backgroundColor="navbarBackgroundColor"
@search="(e) => emits('search', e)"
:defaultSearch="defaultSearch"
/>
@ -80,6 +81,11 @@
type: String,
default: 'bg-white',
},
// navbar === 'normal'
navbarBackgroundColor: {
type: String,
default: '',
},
color: {
type: String,
default: '',
@ -213,16 +219,16 @@
// #endif
// 使 onMounted 使 onShow
onMounted(()=>{
onMounted(() => {
// #ifdef MP-ALIPAY
uni.setNavigationBarTitle({
title: "",
title: '',
});
// #endif
if (!isEmpty(shareInfo.value)) {
sheep.$platform.share.updateShareInfo(shareInfo.value);
}
})
});
</script>
<style lang="scss" scoped>

View File

@ -1,4 +1,5 @@
import packageInfo from '@/package.json';
import { getWxEnvVersion } from '@/sheep/helper/env';
const { version } = packageInfo;
@ -7,7 +8,21 @@ export let baseUrl;
if (process.env.NODE_ENV === 'development') {
baseUrl = import.meta.env.SHOPRO_DEV_BASE_URL;
} else {
baseUrl = import.meta.env.SHOPRO_BASE_URL;
// 非本地 dev 模式开发环境,判断是体验版还是正式版
const wxEnvVersion = getWxEnvVersion();
if (wxEnvVersion === 'trial') {
// 体验版使用体验版服务器地址
baseUrl = import.meta.env.SHOPRO_TRIAL_BASE_URL || import.meta.env.SHOPRO_BASE_URL;
console.log('当前运行环境:体验版');
} else if (wxEnvVersion === 'release') {
// 正式版使用生产服务器地址
baseUrl = import.meta.env.SHOPRO_BASE_URL;
console.log('当前运行环境:正式版');
} else {
// 其他平台或获取失败,使用默认地址
baseUrl = import.meta.env.SHOPRO_BASE_URL;
}
}
if (typeof baseUrl === 'undefined') {
console.error('请检查.env配置文件是否存在');

21
sheep/helper/env.js Normal file
View File

@ -0,0 +1,21 @@
/**
* 微信小程序运行环境develop / trial / release
* 其它平台默认 release整个 App 生命周期内不会变缓存一次
*/
let cachedEnvVersion;
export function getWxEnvVersion() {
if (cachedEnvVersion) return cachedEnvVersion;
// #ifdef MP-WEIXIN
try {
cachedEnvVersion = wx.getAccountInfoSync().miniProgram.envVersion;
} catch (e) {
console.log('获取微信小程序环境失败', e);
cachedEnvVersion = 'release';
}
// #endif
// #ifndef MP-WEIXIN
cachedEnvVersion = 'release';
// #endif
return cachedEnvVersion;
}

View File

@ -30,8 +30,9 @@ export default {
}
// 调用后端接口,获得 JSSDK 初始化所需的签名
const url = location.origin;
const { code, data } = await AuthUtil.createWeixinMpJsapiSignature(url);
// 微信要求签名 URL 与当前页面去掉 hash 后完全一致;不能直接用 location.origin会丢子路径与 query
const signUrl = location.href.split('#')[0];
const { code, data } = await AuthUtil.createWeixinMpJsapiSignature(signUrl);
if (code === 0) {
jweixin.config({
debug: false,
@ -57,7 +58,11 @@ export default {
configSuccess = true;
jweixin.error((err) => {
configSuccess = false;
console.error('微信 JSSDK 初始化失败', err);
console.error('[wx-jssdk] config error', err, {
href: location.href,
signUrl,
data,
});
$helper.toast('微信JSSDK:' + err.errMsg);
});
jweixin.ready(() => {

View File

@ -107,7 +107,7 @@ const buildSpmLink = (query, linkAddress = '') => {
};
// 解析Spm
const decryptSpm = (spm) => {
const decryptSpm = async (spm) => {
const user = $store('user');
let shareParamsArray = spm.split('.');
let shareParams = {
@ -168,7 +168,7 @@ const decryptSpm = (spm) => {
uni.setStorageSync('shareId', shareParams.shareId);
// 已登录 绑定推广员
if (!!user.isLogin) {
bindBrokerageUser(shareParams.shareId);
await bindBrokerageUser(shareParams.shareId);
}
}

View File

@ -230,12 +230,14 @@ const refreshToken = async (config) => {
// 如果未认证,并且未进行刷新令牌,说明可能是访问令牌过期了
if (!isRefreshToken) {
isRefreshToken = true;
// 1. 如果获取不到刷新令牌,则只能执行登出操作
const refreshToken = getRefreshToken();
if (!refreshToken) {
return handleAuthorized();
}
// 只有真正发起刷新时才标记刷新中,避免无刷新令牌时状态一直卡住,后续 401 不再弹登录框
// https://github.com/yudaocode/yudao-mall-uniapp/issues/38
isRefreshToken = true;
// 2. 进行刷新访问令牌
try {
const refreshTokenResult = await AuthUtil.refreshToken(refreshToken);

View File

@ -8,8 +8,7 @@ import user from './user';
import sys from './sys';
import { baseUrl, h5Url } from '@/sheep/config';
const app = defineStore({
id: 'app',
const app = defineStore('app', {
state: () => ({
paramsForTabbar: {}, // 为全局tabbar跳转传参用。原因是 tabbar 无法传参,只能通过全局状态传递
info: {
@ -74,7 +73,7 @@ const app = defineStore({
this.info = {
name: '芋道商城',
logo: 'https://static.iocoder.cn/ruoyi-vue-pro-logo.png',
version: '2026.01',
version: '2026.04',
copyright: '全部开源,个人与企业可 100% 免费使用',
copytime: 'Copyright© 2018-2025',

View File

@ -1,8 +1,7 @@
import { defineStore } from 'pinia';
import CartApi from '@/sheep/api/trade/cart';
const cart = defineStore({
id: 'cart',
const cart = defineStore('cart', {
state: () => ({
list: [], // 购物车列表invalidList + validList
selectedIds: [], // 已选列表

View File

@ -1,7 +1,6 @@
import { defineStore } from 'pinia';
const modal = defineStore({
id: 'modal',
const modal = defineStore('modal', {
state: () => ({
auth: '', // 授权弹框 accountLogin|smsLogin|resetPassword|changeMobile|changePassword|changeUsername
share: false, // 分享弹框

View File

@ -1,8 +1,7 @@
import { defineStore } from 'pinia';
import app from './app';
const sys = defineStore({
id: 'sys',
const sys = defineStore('sys', {
state: () => ({
theme: '', // 主题,
mode: 'light', // 明亮模式、暗黑模式(暂未支持)

View File

@ -36,8 +36,7 @@ const defaultNumData = {
},
};
const user = defineStore({
id: 'user',
const user = defineStore('user', {
state: () => ({
userInfo: clone(defaultUserInfo), // 用户信息
userWallet: clone(defaultUserWallet), // 用户钱包信息