From 227ab6fb84ef98144962ec9b4103b367679c3fef Mon Sep 17 00:00:00 2001
From: zzzz <690498789@qq.com>
Date: Fri, 29 Mar 2024 16:01:04 +0800
Subject: [PATCH] 注册页面的客服地址错误

---
 src/store/modules/home.store.js |   89 +++++++++++++++++++++++++-------------------
 1 files changed, 50 insertions(+), 39 deletions(-)

diff --git a/src/store/modules/home.store.js b/src/store/modules/home.store.js
index 55751e0..280a90f 100644
--- a/src/store/modules/home.store.js
+++ b/src/store/modules/home.store.js
@@ -1,7 +1,13 @@
 import { getStorage, setStorage, changeTheme } from "@/utils/utis";
-import { SET_COIN_LIST, SET_CURRENCY, SET_COIN_SYMBOL_ARR, SET_KEFU, SET_THEME } from '@/store/const.store'
-import { _getCoins, _getExchangeRate } from '@/API/home.api'
-import { customer } from '@/API/user.api'
+import {
+  SET_COIN_LIST,
+  SET_CURRENCY,
+  SET_COIN_SYMBOL_ARR,
+  SET_KEFU,
+  SET_THEME,
+} from "@/store/const.store";
+import { _getCoins, _getExchangeRate } from "@/API/home.api";
+import { customer } from "@/API/user.api";
 
 export default {
   namespaced: true,
@@ -10,23 +16,23 @@
     coinArr: [], // 解构出来的币种数组
     hotArr: [], // 热门币种
     coinList: [], // 品种
-    kefu_url: '',
-    theme: getStorage('theme') || 'light'
+    kefu_url: "",
+    theme: "light",
   },
   getters: {
-    coinList: state => state.coinList,
-    coinArr: state => state.coinArr,
-    hotArr: state => state.hotArr,
-    currency: state => state.currency,
-    kefu_url: state => state.kefu_url,
-    theme: state => state.theme
+    coinList: (state) => state.coinList,
+    coinArr: (state) => state.coinArr,
+    hotArr: (state) => state.hotArr,
+    currency: (state) => state.currency,
+    kefu_url: (state) => state.kefu_url,
+    theme: (state) => state.theme,
   },
   mutations: {
     [SET_THEME]: (state, theme) => {
-      state.theme = theme
-      window.document.documentElement.setAttribute('data-theme', theme)
-      changeTheme(theme)
-      setStorage('theme', theme)
+      state.theme = theme;
+      window.document.documentElement.setAttribute("data-theme", theme);
+      changeTheme(theme);
+      setStorage("theme", theme);
     },
     [SET_COIN_LIST](state, list) {
       state.coinList = list;
@@ -35,36 +41,40 @@
       state.currency = currency;
     },
     [SET_COIN_SYMBOL_ARR](state, list) {
-      const arr = []
-      const hots = []
-      list.map(item => {
-        arr.push(item.symbol)
-        if (item.isTop === '1') { // 热门
-          hots.push(item.symbol)
+      const arr = [];
+      const hots = [];
+      list.map((item) => {
+        arr.push(item.symbol);
+        if (item.isTop === "1") {
+          // 热门
+          hots.push(item.symbol);
         }
-      })
-      state.coinArr = arr
-      state.hotArr = hots
+      });
+      state.coinArr = arr;
+      state.hotArr = hots;
     },
     [SET_KEFU](state, url) {
       state.kefu_url = url;
     },
   },
   actions: {
-    async [SET_COIN_LIST]({ commit, state }) { // 获取配置的币种
+    async [SET_COIN_LIST]({ commit, state }) {
+      // 获取配置的币种
 
-      const list = await _getCoins().catch(err => { Promise.reject(err) })
-      commit(SET_COIN_SYMBOL_ARR, list) // 原数据
-      commit(SET_COIN_LIST, list) // 拆分的单个数据
-      Promise.resolve(list)
-
+      const list = await _getCoins().catch((err) => {
+        Promise.reject(err);
+      });
+      commit(SET_COIN_SYMBOL_ARR, list); // 原数据
+      commit(SET_COIN_LIST, list); // 拆分的单个数据
+      Promise.resolve(list);
     },
-    async [SET_CURRENCY]({ commit, state, rootState }) { // 设置汇率
-      console.log('rootState', rootState)
+    async [SET_CURRENCY]({ commit, state, rootState }) {
+      // 设置汇率
+      console.log("rootState", rootState);
       const currency = await _getExchangeRate({
-        token: rootState.user.userInfo.token
-      }).catch(err => Promise.reject(err))
-      commit(SET_CURRENCY, currency)
+        token: rootState.user.userInfo.token,
+      }).catch((err) => Promise.reject(err));
+      commit(SET_CURRENCY, currency);
     },
     actionsToken({ commit }, data) {
       commit("SET_TOKEN", data);
@@ -72,11 +82,12 @@
     actionsStatus({ commit }, data) {
       commit("SET_STATUS", data);
     },
-    async [SET_KEFU]({ commit, state, rootState }) { // 设置汇率
+    async [SET_KEFU]({ commit, state, rootState }) {
+      // 设置汇率
 
-      const data = await customer().catch(err => Promise.reject(err))
-      let url = data.customer_service_url
-      commit(SET_KEFU, url)
+      const data = await customer().catch((err) => Promise.reject(err));
+      let url = data.customer_service_url;
+      commit(SET_KEFU, url);
     },
   },
 };

--
Gitblit v1.9.3