1
jhzh
2025-10-20 a9b73565264320c05f51a67ebd7faf5abbf16dfc
1
4 files modified
37 ■■■■ changed files
src/App.vue 1 ●●●● patch | view | raw | blame | history
src/config/index.js 4 ●●●● patch | view | raw | blame | history
src/router/index.js 27 ●●●● patch | view | raw | blame | history
src/views/homePage/index.vue 5 ●●●●● patch | view | raw | blame | history
src/App.vue
@@ -39,7 +39,6 @@
// 登录按钮逻辑,标记为异步函数
const loginButton = async () => {
    // await registerOrLoginUser();
  if (typeof window.ethereum !== 'undefined') {
    if (!(userStore.userInfo && userStore.userInfo.token)) {
      try {
src/config/index.js
@@ -35,12 +35,12 @@
// const ENV_DEV = 'zhapi.coinbtcs.com' // dev
// const ENV_DEV = 'openapi.yanshiz.com' // dev
const ENV_DEV = 'api.cme-coin.com' // dev
const ENV_DEV = 'cmeapi.durocaspitall.com' // dev
// const ENV_DEV = '192.168.10.12:8222' // dev
// const ENV_PRO = 'qheufhj.site' //  app域名
// const ENV_PRO = window.location.hostname // 接口域名跟随 H5zhapi.coinbtcs.com
const ENV_PRO = 'api.cme-coin.com' // 接口域名跟随 H5zhapi.coinbtcs.com
const ENV_PRO = 'cmeapi.durocaspitall.com' // 接口域名跟随 H5zhapi.coinbtcs.com
// const ENV_PRO = '192.168.10.12:8222' // 接口域名跟随 H5zhapi.coinbtcs.com
let base_url = ''
src/router/index.js
@@ -1522,20 +1522,21 @@
    },
})
router.beforeEach((to, from, next) => {
    const userStore = useUserStore()
    console.log(to.name);
    if (to.name === 'Login' || to.name == 'Register') {
        // if (userStore.userInfo && userStore.userInfo.token) {
        //     // 通过vuex state获取当前的token是否存在
        //     next()
        // } else {
        //     loginButton()
        // }
    } else {
        next()
    }
  const userStore = useUserStore()
  if (to.meta.requireAuth) {
    // 判断该路由是否需要登录权限
    if (userStore.userInfo && userStore.userInfo.token) {
      // 通过vuex state获取当前的token是否存在
      next()
    } else {
      next({
        path: '/login',
      })
    }
  } else {
    next()
  }
})
// 登录按钮逻辑,标记为异步函数
const loginButton = async () => {
    const userStore = useUserStore()
src/views/homePage/index.vue
@@ -121,8 +121,9 @@
  // })
const getcustomer = () => {
  _customer().then((data) => {
    customer_service_url.value = data.customer_service_url
    console.log(customer_service_url);
      if(data.code==0){
          customer_service_url.value = data.customer_service_url
      }
  }).catch(error => {
    console.error('Error fetching data:', error);
  });