去除获取金币比例接口改为从公共数据common里获取
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import {
|
||||
defineStore
|
||||
} from "pinia";
|
||||
import {getCommonConfig} from '@/api/init.js'
|
||||
import {
|
||||
getCommonConfig
|
||||
} from '@/api/init.js'
|
||||
const $map = {
|
||||
882: 'isWxIosPay',
|
||||
833: 'checkIosLogin',
|
||||
@@ -34,27 +36,28 @@ const $map = {
|
||||
881: '',
|
||||
109: '',
|
||||
922: 'withdrawNum',
|
||||
500:'payTips'
|
||||
500: 'payTips',
|
||||
914: 'goldBili' // 金币比例
|
||||
}
|
||||
|
||||
export const useCommonStore = defineStore("common", {
|
||||
state() {
|
||||
return {
|
||||
payTips:'付款完成后不要忘记抽红包哦'
|
||||
payTips: '付款完成后不要忘记抽红包哦',
|
||||
goldBili:0
|
||||
};
|
||||
},
|
||||
actions:{
|
||||
async init(){
|
||||
const res=await getCommonConfig()
|
||||
if(res){
|
||||
actions: {
|
||||
async init() {
|
||||
const res = await getCommonConfig()
|
||||
if (res) {
|
||||
for (let i in $map) {
|
||||
const key = $map[i]
|
||||
if (key) {
|
||||
this[key]=res[i]
|
||||
this[key] = res[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(res);
|
||||
}
|
||||
},
|
||||
unistorage: true, // 开启后对 state 的数据读写都将持久化
|
||||
|
||||
Reference in New Issue
Block a user