更新项目配置和添加小程序模块
- 修改 ArticleController.java - 更新 application.yml 配置 - 更新 frontend/.env.production 环境配置 - 添加 single_uniapp22miao 小程序模块 - 添加 logs 目录
This commit is contained in:
24
single_uniapp22miao/store/getters.js
Normal file
24
single_uniapp22miao/store/getters.js
Normal file
@@ -0,0 +1,24 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
export default {
|
||||
token: state => state.app.token,
|
||||
isLogin: state => !!state.app.token,
|
||||
backgroundColor: state => state.app.backgroundColor,
|
||||
userInfo: state => state.app.userInfo || {},
|
||||
uid: state => state.app.uid,
|
||||
homeActive: state => state.app.homeActive,
|
||||
home: state => state.app.home,
|
||||
chatUrl: state => state.app.chatUrl,
|
||||
systemPlatform: state => state.app.systemPlatform,
|
||||
productType: state => state.app.productType,
|
||||
bottomNavigationIsCustom: state => state.app.bottomNavigationIsCustom,
|
||||
globalData: state => state.app.globalData,
|
||||
};
|
||||
23
single_uniapp22miao/store/index.js
Normal file
23
single_uniapp22miao/store/index.js
Normal file
@@ -0,0 +1,23 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
import Vue from "vue";
|
||||
import Vuex from "vuex";
|
||||
import modules from "./modules";
|
||||
import getters from "./getters";
|
||||
|
||||
Vue.use(Vuex);
|
||||
const debug = process.env.NODE_ENV !== "production";
|
||||
|
||||
export default new Vuex.Store({
|
||||
modules,
|
||||
getters,
|
||||
strict: debug
|
||||
});
|
||||
166
single_uniapp22miao/store/modules/app.js
Normal file
166
single_uniapp22miao/store/modules/app.js
Normal file
@@ -0,0 +1,166 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// +----------------------------------------------------------------------
|
||||
import Auth from '../../libs/wechat';
|
||||
import {
|
||||
getUserInfo,
|
||||
computeUser
|
||||
} from "../../api/user.js";
|
||||
import {
|
||||
LOGIN_STATUS,
|
||||
UID,
|
||||
PLATFORM,
|
||||
BOTTOM_NAVIGATION_ISCUSTOM
|
||||
} from '../../config/cache';
|
||||
import Cache from '../../utils/cache';
|
||||
import {
|
||||
USER_INFO
|
||||
} from '../../config/cache';
|
||||
let cartArr = [{
|
||||
name: "微信支付",
|
||||
icon: "icon-weixinzhifu1",
|
||||
value: 'weixin',
|
||||
title: '微信快捷支付',
|
||||
payStatus: 1,
|
||||
},
|
||||
{
|
||||
name: "余额支付",
|
||||
icon: "icon-yuezhifu",
|
||||
value: 'yue',
|
||||
title: '可用余额:',
|
||||
payStatus: 1,
|
||||
userBalance: ''
|
||||
},
|
||||
// #ifndef MP
|
||||
{
|
||||
name: "支付宝支付",
|
||||
icon: "icon-zhifubao",
|
||||
value: 'alipay',
|
||||
title: '支付宝快捷支付',
|
||||
payStatus: 1,
|
||||
}
|
||||
// #endif
|
||||
];
|
||||
const state = {
|
||||
token: Cache.get(LOGIN_STATUS) || '',
|
||||
backgroundColor: "#fff",
|
||||
userInfo: Cache.get(USER_INFO) ? JSON.parse(Cache.get(USER_INFO)) : null,
|
||||
uid: Cache.get(UID) || null,
|
||||
homeActive: false,
|
||||
chatUrl: Cache.get('chatUrl') || '',
|
||||
systemPlatform: Cache.get(PLATFORM) ? Cache.get(PLATFORM) : '',
|
||||
productType: Cache.get('productType') || '',
|
||||
bottomNavigationIsCustom: Cache.get('BOTTOM_NAVIGATION_ISCUSTOM') ? Cache.get('BOTTOM_NAVIGATION_ISCUSTOM') : false, //是否使用自定义导航
|
||||
};
|
||||
|
||||
const mutations = {
|
||||
LOGIN(state, opt) {
|
||||
state.token = opt.token;
|
||||
Cache.set(LOGIN_STATUS, opt.token);
|
||||
},
|
||||
SETUID(state, val) {
|
||||
state.uid = val;
|
||||
// 转换为字符串存储,避免 uni-app H5 平台包装成 {"type":"number","data":xxx} 格式
|
||||
Cache.set(UID, String(val));
|
||||
},
|
||||
UPDATE_LOGIN(state, token) {
|
||||
state.token = token;
|
||||
},
|
||||
LOGOUT(state) {
|
||||
state.token = undefined;
|
||||
state.uid = undefined
|
||||
Cache.clear(LOGIN_STATUS);
|
||||
Cache.clear(UID);
|
||||
Cache.clear(USER_INFO);
|
||||
},
|
||||
BACKGROUND_COLOR(state, color) {
|
||||
state.color = color;
|
||||
document.body.style.backgroundColor = color;
|
||||
},
|
||||
UPDATE_USERINFO(state, userInfo) {
|
||||
state.userInfo = userInfo;
|
||||
Cache.set(USER_INFO, userInfo);
|
||||
},
|
||||
OPEN_HOME(state) {
|
||||
state.homeActive = true;
|
||||
},
|
||||
CLOSE_HOME(state) {
|
||||
state.homeActive = false;
|
||||
},
|
||||
SET_CHATURL(state, chatUrl) {
|
||||
state.chatUrl = chatUrl;
|
||||
},
|
||||
SYSTEM_PLATFORM(state, systemPlatform) {
|
||||
state.systemPlatform = systemPlatform;
|
||||
Cache.set(PLATFORM, systemPlatform);
|
||||
},
|
||||
//更新useInfo数据
|
||||
changInfo(state, payload) {
|
||||
state.userInfo[payload.amount1] = payload.amount2;
|
||||
Cache.set(USER_INFO, state.userInfo);
|
||||
},
|
||||
//商品类型,用于区分视频号商品与一般商品
|
||||
PRODUCT_TYPE(state, productType) {
|
||||
state.productType = productType;
|
||||
Cache.set('productType', productType);
|
||||
},
|
||||
/** 是否使用自定义导航 **/
|
||||
BottomNavigationIsCustom: (state, bottomNavigationIsCustom) => {
|
||||
state.bottomNavigationIsCustom = bottomNavigationIsCustom
|
||||
Cache.set(BOTTOM_NAVIGATION_ISCUSTOM, bottomNavigationIsCustom);
|
||||
},
|
||||
};
|
||||
|
||||
const actions = {
|
||||
USERINFO({
|
||||
state,
|
||||
commit
|
||||
}, force) {
|
||||
return new Promise(reslove => {
|
||||
getUserInfo().then(res => {
|
||||
commit("UPDATE_USERINFO", res.data);
|
||||
reslove(res.data);
|
||||
});
|
||||
}).catch(() => {
|
||||
commit("LOGOUT");
|
||||
});
|
||||
},
|
||||
getPayConfig({
|
||||
state,
|
||||
commit
|
||||
}, force) {
|
||||
return new Promise(reslove => {
|
||||
getOrderPayConfig().then(res => {
|
||||
let data = res.data;
|
||||
cartArr[0].payStatus = data.payWechatOpen ? 1 : 0;
|
||||
cartArr[1].payStatus = data.yuePayStatus ? 1 : 0;
|
||||
cartArr[1].userBalance = data.userBalance ? data.userBalance : 0;
|
||||
// #ifdef H5
|
||||
if (Auth.isWeixin()) {
|
||||
cartArr[2].payStatus = 0;
|
||||
} else {
|
||||
cartArr[2].payStatus = data.aliPayStatus ? 1 : 0;
|
||||
}
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
cartArr[2].payStatus = data.aliPayStatus ? 1 : 0;
|
||||
// #endif
|
||||
let cartArrs = cartArr.filter(e => e.payStatus === 1);
|
||||
reslove({
|
||||
userBalance: data.userBalance,
|
||||
payConfig: cartArrs
|
||||
});
|
||||
})
|
||||
}).catch(err => {
|
||||
return util.Tips({
|
||||
title: err
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export default {
|
||||
state,
|
||||
mutations,
|
||||
actions
|
||||
};
|
||||
15
single_uniapp22miao/store/modules/index.js
Normal file
15
single_uniapp22miao/store/modules/index.js
Normal file
@@ -0,0 +1,15 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
import app from "./app";
|
||||
|
||||
export default {
|
||||
app
|
||||
};
|
||||
Reference in New Issue
Block a user