chore(加载主题样式): 只使用异步方式,保留一个函数loadTheme

This commit is contained in:
2026-01-06 17:01:03 +08:00
parent 6358102cae
commit d7b07c974d
3 changed files with 7 additions and 27 deletions

View File

@@ -8,7 +8,7 @@
export default {
mixins: [auth],
onLaunch: function(options) {
onLaunch: async function(options) {
// 方式支持快应用从url中query部分获取uniacid或useragent中获取uniacid
if(options.query.uniacid){
uni.setStorageSync('uniacid', options.query.uniacid);
@@ -61,7 +61,8 @@
// 主题风格
if (uni.getStorageSync('themeStyle')) {
this.$store.commit('setThemeStyle', configExternal.loadThemeSync(uni.getStorageSync('themeStyle')));
const themeData = await configExternal.loadTheme(uni.getStorageSync('themeStyle'));
this.$store.commit('setThemeStyle', themeData);
this.$store.dispatch('themeColorSet');
}