h888
Wayne Hsu 3 years ago
parent 60054a53ff
commit bfb8895b1b

@ -3,11 +3,3 @@ VITE_APP_IMG_URL = 'https://shop.h888.fun/'
VITE_APP_API_URL = 'https://shop.h888.fun/appapi/v1' VITE_APP_API_URL = 'https://shop.h888.fun/appapi/v1'
VITE_APP_SSO_URL = 'https://sso.h888.fun/api/v1' VITE_APP_SSO_URL = 'https://sso.h888.fun/api/v1'
VITE_APP_SSO_DOMAIN = 'localhost'
# VITE_APP_SSO_DOMAIN = 'localhost'
# VITE_APP_BASE_URL = 'https://localhost'
VITE_APP_BASE_URL = 'http://localhost:5173'

@ -1,13 +1,5 @@
VITE_APP_IMG_URL = 'https://shop.h888.fun/' VITE_APP_IMG_URL = 'https://shop.slash1000.com/'
VITE_APP_API_URL = 'https://shop.h888.fun/appapi/v1' VITE_APP_API_URL = 'https://shop.slash1000.com/appapi/v1'
VITE_APP_SSO_URL = 'https://sso.h888.fun/api/v1' VITE_APP_SSO_URL = 'https://sso.slash1000.com/api/v1'
# VITE_APP_SSO_DOMAIN = 'e58b-111-241-124-153.jp.ngrok.io'
VITE_APP_SSO_DOMAIN = 'h888.fun'
VITE_APP_BASE_URL = 'https://shop.h888.fun'
# VITE_APP_BASE_URL = 'https://e58b-111-241-124-153.jp.ngrok.io'

2
components.d.ts vendored

@ -22,11 +22,13 @@ declare module '@vue/runtime-core' {
VanGrid: typeof import('vant/es')['Grid'] VanGrid: typeof import('vant/es')['Grid']
VanGridItem: typeof import('vant/es')['GridItem'] VanGridItem: typeof import('vant/es')['GridItem']
VanIcon: typeof import('vant/es')['Icon'] VanIcon: typeof import('vant/es')['Icon']
VanList: typeof import('vant/es')['List']
VanNavBar: typeof import('vant/es')['NavBar'] VanNavBar: typeof import('vant/es')['NavBar']
VanOverlay: typeof import('vant/es')['Overlay'] VanOverlay: typeof import('vant/es')['Overlay']
VanPicker: typeof import('vant/es')['Picker'] VanPicker: typeof import('vant/es')['Picker']
VanPopover: typeof import('vant/es')['Popover'] VanPopover: typeof import('vant/es')['Popover']
VanPopup: typeof import('vant/es')['Popup'] VanPopup: typeof import('vant/es')['Popup']
VanPullRefresh: typeof import('vant/es')['PullRefresh']
VanRadio: typeof import('vant/es')['Radio'] VanRadio: typeof import('vant/es')['Radio']
VanRadioGroup: typeof import('vant/es')['RadioGroup'] VanRadioGroup: typeof import('vant/es')['RadioGroup']
VanSwipe: typeof import('vant/es')['Swipe'] VanSwipe: typeof import('vant/es')['Swipe']

@ -22,6 +22,7 @@
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"pinia": "^2.0.28", "pinia": "^2.0.28",
"postcss": "^8.4.20", "postcss": "^8.4.20",
"qrcode.vue": "^3.4.0",
"uuid": "^9.0.0", "uuid": "^9.0.0",
"vant": "^4.0.2", "vant": "^4.0.2",
"vue": "^3.2.41", "vue": "^3.2.41",

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

@ -4,7 +4,7 @@
<i class="icon-menu icli nav-bar" @click="toggleMenu"></i> <i class="icon-menu icli nav-bar" @click="toggleMenu"></i>
<!-- <a href="###"> <img class="logo logo-w" src="@/assets/images/logo/logo-w.png" alt="logo" /></a> --> <!-- <a href="###"> <img class="logo logo-w" src="@/assets/images/logo/logo-w.png" alt="logo" /></a> -->
<a href="###"> <a href="###">
<img class="logo" src="@/assets/images/logo/logo_w.png" alt="logo" /> <img class="logo" src="@/assets/images/logo/logo_w.jpg" alt="logo" />
</a> </a>
</div> </div>
<div class="avatar-wrap" @click="$router.push('/cart')"> <div class="avatar-wrap" @click="$router.push('/cart')">
@ -17,8 +17,8 @@
<a href="javascript:void(0)" class="overlay-sidebar" :class="{show: showMenu}" @click="toggleMenu"></a> <a href="javascript:void(0)" class="overlay-sidebar" :class="{show: showMenu}" @click="toggleMenu"></a>
<aside class="header-sidebar" :class="{show: showMenu}"> <aside class="header-sidebar" :class="{show: showMenu}">
<div class="wrap"> <div class="wrap">
<!-- <div class="user-panel"> <div class="user-panel">
<div class="media"> <!-- <div class="media">
<a href="account.html"> <img src="assets/images/avatar/avatar.jpg" alt="avatar" /></a> <a href="account.html"> <img src="assets/images/avatar/avatar.jpg" alt="avatar" /></a>
<div class="media-body"> <div class="media-body">
<a href="account.html" class="title-color font-sm" <a href="account.html" class="title-color font-sm"
@ -26,20 +26,48 @@
<span class="content-color font-xs">andreajoanne@gmail.com</span> <span class="content-color font-xs">andreajoanne@gmail.com</span>
</a> </a>
</div> </div>
</div> </div> -->
</div> --> <i class="icon-close-circle icli close" @click="toggleMenu"></i>
</div>
<!-- Navigation Start --> <!-- Navigation Start -->
<nav class="navigation"> <nav class="navigation">
<ul> <ul>
<li> <li @click="$router.push('/home')">
<a href="index.html" class="nav-link title-color font-sm"> <a class="nav-link title-color font-sm">
<i class="iconly-Home icli"></i> <i class="iconly-Home icli"></i>
<span>首頁</span> <span>首頁</span>
</a> </a>
<a class="arrow" href="###"><i data-feather="chevron-right"></i></a> <a class="arrow" href="###"><i data-feather="chevron-right"></i></a>
</li> </li>
<li @click="$router.push('/article?id=145')">
<a class="nav-link title-color font-sm">
<i class="iconly-Home icli"></i>
<span>分銷說明</span>
</a>
<a class="arrow" href="###"><i data-feather="chevron-right"></i></a>
</li>
<li @click="$router.push('/card')">
<a class="nav-link title-color font-sm">
<i class="iconly-Home icli"></i>
<span>立即購買</span>
</a>
<a class="arrow" href="###"><i data-feather="chevron-right"></i></a>
</li>
<li @click="$router.push('/category')">
<a class="nav-link title-color font-sm">
<i class="iconly-Home icli"></i>
<span>線上商店</span>
</a>
<a class="arrow" href="###"><i data-feather="chevron-right"></i></a>
</li>
<li @click="$router.push('/user/info')">
<a class="nav-link title-color font-sm">
<i class="iconly-Home icli"></i>
<span>我的</span>
</a>
<a class="arrow" href="###"><i data-feather="chevron-right"></i></a>
</li>
</ul> </ul>
</nav> </nav>
<!-- Navigation End --> <!-- Navigation End -->
@ -48,7 +76,10 @@
<div class="contact-us"> <div class="contact-us">
<span class="title-color">聯絡我們</span> <span class="title-color">聯絡我們</span>
<p class="content-color font-xs">如果您有任何問題立即聯絡我們</p> <p class="content-color font-xs">如果您有任何問題立即聯絡我們</p>
<a href="javascript:void(0)" class="btn-solid"> LINE@客服 </a> <p class="content-color font-xs">{{ shopStore.config.service_phone}}</p>
<p class="content-color font-xs">{{ shopStore.config.service_email}}</p>
<!-- <a href="javascript:void(0)" class="btn-solid"> LINE@客服 </a> -->
<p class="content-color font-xs">匯康科技有限公司</p>
</div> </div>
</aside> </aside>
<!-- Sidebar End --> <!-- Sidebar End -->
@ -59,6 +90,8 @@
import { ref } from 'vue' import { ref } from 'vue'
import { useCartStore } from '@/store/Cart' import { useCartStore } from '@/store/Cart'
import { useShopStore } from '@/store/Shop'
const showMenu = ref(false) const showMenu = ref(false)
function toggleMenu(){ function toggleMenu(){
@ -67,10 +100,19 @@ function toggleMenu(){
const cartStore = useCartStore() const cartStore = useCartStore()
const shopStore = useShopStore()
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.logo{ .logo{
width: 130px !important; width: 130px !important;
} }
.user-panel{
text-align: right !important;
i{
font-size: 20px;
}
}
</style> </style>

@ -33,7 +33,7 @@
<nav class="navigation"> <nav class="navigation">
<ul> <ul>
<li> <li>
<a href="index.html" class="nav-link title-color font-sm"> <a href="###" class="nav-link title-color font-sm">
<i class="iconly-Home icli"></i> <i class="iconly-Home icli"></i>
<span>首頁</span> <span>首頁</span>
</a> </a>

@ -1,11 +1,10 @@
<template> <template>
<Header/>
<RouterView/> <RouterView/>
<Footer/> <Footer/>
</template> </template>
<script setup> <script setup>
import Header from '@/components/UserHeader.vue' // import Header from '@/components/UserHeader.vue'
import Footer from '@/components/Footer.vue' import Footer from '@/components/Footer.vue'
</script> </script>

@ -37,7 +37,7 @@
</div> </div>
<h3 class="title-color font-sm">{{ ua.consignee }}</h3> <h3 class="title-color font-sm">{{ ua.consignee }}</h3>
<h3 class="title-color font-sm">{{ ua.tel }}</h3> <h3 class="title-color font-sm">{{ ua.tel }}</h3>
<p class="content-color font-sm">{{ ua.address }}</p> <p class="content-color font-sm">{{ua.city + '' + ua.district + '' + ua.address }}</p>
</div> </div>
<!-- <img src="/src/assets/images/map/map.jpg" alt="map" /> --> <!-- <img src="/src/assets/images/map/map.jpg" alt="map" /> -->
</div> </div>
@ -95,7 +95,7 @@
<van-popup v-model:show="showPicker" position="bottom"> <van-popup v-model:show="showPicker" position="bottom">
<van-picker <van-picker
name="selectedValue" name="selectedValue"
v-model="form.selectedValue" v-model="selectedValue"
:columns="columns" :columns="columns"
@confirm="onConfirm" @confirm="onConfirm"
@cancel="showPicker = false" @cancel="showPicker = false"
@ -157,15 +157,17 @@ const addrForm = ref();
const form = ref({ const form = ref({
name: "住家", name: "住家",
consignee: "", consignee: '',
tel: "", tel: '',
area: "", city: '',
zipcode: "", district: '',
address: "", zipcode: '',
selectedValue: ["0"], address: '',
is_default: false, is_default: false,
}); });
const selectedValue = ref(["0"])
onMounted(async () => { onMounted(async () => {
let addrRes = await getUserAddress(); let addrRes = await getUserAddress();
@ -183,6 +185,7 @@ const onConfirm = ({ selectedOptions }) => {
showPicker.value = false; showPicker.value = false;
let selectedArea = selectedOptions[0].text; let selectedArea = selectedOptions[0].text;
if (selectedOptions[1]) { if (selectedOptions[1]) {
selectedArea += "-" + selectedOptions[1].text; selectedArea += "-" + selectedOptions[1].text;
} }
@ -191,6 +194,9 @@ const onConfirm = ({ selectedOptions }) => {
} }
fieldValue.value = selectedArea; fieldValue.value = selectedArea;
form.value.city = selectedOptions[0].text;
form.value.district = selectedOptions[1].text;
}; };
const handleSubmit = () => { const handleSubmit = () => {

@ -205,7 +205,6 @@
</template> </template>
<script setup> <script setup>
import axios from 'axios'
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { ref, onMounted, computed } from 'vue' import { ref, onMounted, computed } from 'vue'
@ -264,7 +263,7 @@ const addToCart = async (id, type) => {
} }
let res = await cartStore.addCart(goods) let res = await cartStore.addCart(goods)
if (!res) { if (!res) {
return showToast('添加失敗!'); return showToast('添加失敗!');
} }
@ -272,7 +271,16 @@ const addToCart = async (id, type) => {
if (type === 0) { if (type === 0) {
showToast('添加成功!'); showToast('添加成功!');
} else { } else {
router.push('/checkout') //
if (Cookies.get('uid')) {
return router.push('/checkout')
}
return router.push({
path: '/login',
query: {
redirect: '/checkout'
}
})
} }
return return
@ -290,7 +298,11 @@ const goCheckout = async () => {
} }
let res = await addCart(goods) let res = await addCart(goods)
if (res.code === 200) { if (res.code === 200) {
return router.push('/checkout') //
if (Cookies.get('uid')) {
return router.push('/checkout')
}
return router.push('/login')
} }
alert('操作錯誤,請重新操作') alert('操作錯誤,請重新操作')
return return

@ -24,7 +24,6 @@
<van-cell-group inset> <van-cell-group inset>
<van-field v-model="form.cname" type="text" placeholder="任何您想寫的文字" label="中文姓名" /> <van-field v-model="form.cname" type="text" placeholder="任何您想寫的文字" label="中文姓名" />
<van-field v-model="form.ename" type="text" placeholder="任何您想寫的文字" label="英文姓名" /> <van-field v-model="form.ename" type="text" placeholder="任何您想寫的文字" label="英文姓名" />
<van-field v-model="form.user_id" type="text" label="用戶編號" />
</van-cell-group> </van-cell-group>
<div style="margin: 16px 32px;"> <div style="margin: 16px 32px;">
圖片<br /> 圖片<br />
@ -83,6 +82,7 @@ const form = computed({
return props.modelValue return props.modelValue
}, },
set(v) { set(v) {
console.log('set', v)
emit('update:modelValue', v) emit('update:modelValue', v)
} }
}) })
@ -176,7 +176,6 @@ const onCrop = () => {
} }
}, "image/jpeg"); }, "image/jpeg");
} }
return; return;
}; };
@ -225,7 +224,7 @@ const handleDelete = (file) => {
position: absolute; position: absolute;
top: 110px; top: 110px;
left: 180px; left: 180px;
font-size: 16px; font-size: 12px;
letter-spacing: 5px; letter-spacing: 5px;
} }
} }

@ -84,8 +84,8 @@
<div> <div>
<ul> <ul>
<li>收件人{{ shippingData.extra_data.consignee }}</li> <li>收件人{{ shippingData.extra_data.consignee }}</li>
<li> {{ shippingData.extra_data.address }}</li>
<li> {{ shippingData.extra_data.tel }}</li> <li> {{ shippingData.extra_data.tel }}</li>
<li> {{ shippingData.extra_data.city + shippingData.extra_data.district + shippingData.extra_data.address }}</li>
</ul> </ul>
</div> </div>
</template> </template>
@ -267,7 +267,17 @@ onMounted(async () => {
// //
const cartToOrder = () => { const cartToOrder = () => {
console.log('cardItem',cartStore.cartItems);
items.value = cartStore.cartItems; items.value = cartStore.cartItems;
//goods_id1,orderextension_codeslashcard
let is_slashcard = items.value.find((item) => item.goods_id === 1);
if(is_slashcard){
orderStore.extension_code = 'slashcard';
}
}; };
// //
@ -284,6 +294,8 @@ const selectShipping = async (value) => {
shipping_fee: 0, shipping_fee: 0,
extra_data: { extra_data: {
address: resAddr.data.address, address: resAddr.data.address,
city: resAddr.data.city,
district: resAddr.data.district,
consignee: resAddr.data.consignee, consignee: resAddr.data.consignee,
tel: resAddr.data.tel, tel: resAddr.data.tel,
}, },

@ -68,7 +68,7 @@
</main> </main>
<div ref="formContainer" :style="{ display: showForm }"></div> <div ref="formContainer" :style="{ display: showForm }"></div>
<footer class="footer-wrap footer-button"> <footer class="footer-wrap footer-button">
<a href="javascript:void(0);" class="font-md">確認</a> <!-- <a href="javascript:void(0);" class="font-md">確認</a> -->
</footer> </footer>
</template> </template>

@ -14,7 +14,17 @@
<div class="feature"> <div class="feature">
<img src="@/assets/images/feature02.png" alt="應用領域"> <img src="@/assets/images/feature02.png" alt="應用領域">
</div> </div>
<div class="company">
<div>
匯康科技股份有限公司
</div>
<div>
服務專線{{ shopStore.config.service_phone}}
</div>
<div>
服務信箱{{ shopStore.config.service_email}}
</div>
</div>
</div> </div>
</template> </template>
@ -22,6 +32,10 @@
import { ref ,onMounted } from 'vue' import { ref ,onMounted } from 'vue'
import { getBanner } from '@/services/home' import { getBanner } from '@/services/home'
import { useShopStore } from '@/store/Shop'
const shopStore = useShopStore()
const images = ref([]); const images = ref([]);
const img_url = import.meta.env.VITE_APP_IMG_URL const img_url = import.meta.env.VITE_APP_IMG_URL
@ -47,4 +61,16 @@ onMounted(async ()=>{
width: 100%; width: 100%;
} }
} }
.company{
background-color: #f5f5f5;
width: 100%;
// text-align: center;
padding: 10px;
margin-bottom: 20px;
div{
color: #666;
margin-bottom: 3px;
}
}
</style> </style>

@ -10,19 +10,16 @@
<!-- Email Input start --> <!-- Email Input start -->
<div class="input-box"> <div class="input-box">
<input type="tel" placeholder="手機號碼" required class="form-control" v-model="form.username" /> <input type="tel" placeholder="手機號碼" required class="form-control" v-model="form.username" />
<i data-feather="at-sign"></i> <i class="verify" :class="{ disable: !showGetVerifyBtn }" @click="handleGetVerify"
>{{ getVerifyMsg }}
<template v-if="countdown > 0">({{ countdown }})</template>
</i>
</div> </div>
<!-- Email Input End --> <!-- Email Input End -->
<!-- Password Input start --> <!-- Password Input start -->
<div class="input-box"> <div class="input-box">
<input <input type="password" placeholder="驗證碼" required class="form-control" v-model="form.password" />
type="password"
placeholder="驗證碼"
required
class="form-control"
v-model="form.password"
/>
<i class="iconly-Hide icli showHidePassword"></i> <i class="iconly-Hide icli showHidePassword"></i>
</div> </div>
<!-- Password Input End --> <!-- Password Input End -->
@ -53,47 +50,168 @@
import Cookies from "js-cookie"; import Cookies from "js-cookie";
// import liff from '@line/liff' // import liff from '@line/liff'
import { ref } from "vue"; import { ref, watch, onUnmounted } from "vue";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { login } from "@/services/auth"; import { useShopStore } from "@/store/Shop"
import { showToast } from "vant";
import "vant/es/toast/style";
import { login, sendVerify } from "@/services/auth";
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
console.log("callback"); const shopStore = useShopStore()
const form = ref({ const form = ref({
username: "0983214434", username: "",
password: "123456", password: "",
}); });
const getVerifyMsg = ref("獲取驗證碼");
const showGetVerifyBtn = ref(false);
const countdown = ref(0);
const handleGetVerify = async () => {
if(!showGetVerifyBtn.value){
return
}
if (!form.value.username) {
return showToast({
message: "請輸入手機號",
duration: 1000,
});
}
let res = await sendVerify(form.value.username);
if (res.code === 200) {
getVerifyMsg.value = "重新發送";
countdown.value = 60;
showToast({
message: "驗證碼已發送",
duration: 1000,
});
} else {
countdown.value = res.data.countdown;
showToast({
message: res.message,
duration: 1000,
});
}
};
watch(
() => form.value.username,
(nVal) => {
//vVal
let reg = /^09[0-9]{8}$/;
if (reg.test(nVal)) {
if (countdown.value === 0) {
return (showGetVerifyBtn.value = true);
} else {
return (showGetVerifyBtn.value = false);
}
} else {
return (showGetVerifyBtn.value = false);
}
}
);
let timer = null;
watch(
() => countdown.value,
(nVal) => {
if (nVal > 0) {
showGetVerifyBtn.value = false;
if (!timer) {
timer = setInterval(() => {
if (countdown.value > 0) {
countdown.value--;
}
}, 1000);
}
} else {
clearInterval(timer);
timer = null;
showGetVerifyBtn.value = true;
}
}
);
const handleLogin = async () => { const handleLogin = async () => {
//
if (!form.value.username) {
return showToast({
message: "請輸入手機號",
duration: 1000,
});
}
//
if (!form.value.username || !form.value.password) {
return showToast({
message: "請輸入帳號及驗證碼",
duration: 1000,
});
}
let res = await login(form.value); let res = await login(form.value);
// console.log("res", res); // console.log("res", res);
if (res.code === 200) { if (res.code === 200) {
Cookies.set("token", res.data.token, { expires: 30, domain: import.meta.env.VITE_APP_SSO_DOMAIN }); Cookies.set("token", res.data.token, { expires: 365, domain: shopStore.sso_domain });
Cookies.set("uid", res.data.uid, { expires: 30, domain: import.meta.env.VITE_APP_SSO_DOMAIN }); Cookies.set("uid", res.data.uid, { expires: 365, domain: shopStore.sso_domain });
if (route.query.redirect) {
router.push("/user"); router.push(route.query.redirect);
return;
}
return router.push("/user");
} else if (res.code === 201) { } else if (res.code === 201) {
sessionStorage.setItem('reg',form.value.username) sessionStorage.setItem("reg", form.value.username);
router.push({name:'Register',query: {type:'mobile'}}); router.push({ name: "Register", query: { type: "mobile" } });
}else{
showToast({
message: '登入失敗',
duration: 1000,
});
} }
}; };
const handleLineLogin = async () => { const handleLineLogin = async () => {
const client_id = "1657876696"; const client_id = "1657876696";
const redirect_uri = import.meta.env.VITE_APP_BASE_URL + "/m/linelogin/"; const redirect_uri = "https://" + shopStore.domain + "/m/linelogin/";
let link = "https://access.line.me/oauth2/v2.1/authorize?"; let link = "https://access.line.me/oauth2/v2.1/authorize?";
link = link + "response_type=code"; link = link + "response_type=code";
link += "&client_id=" + client_id; link += "&client_id=" + client_id;
link += "&redirect_uri=" + redirect_uri; link += "&redirect_uri=" + redirect_uri;
link += "&state=login"; link += "&state=" + (route.query.redirect || "login");
link += "&scope=openid%20profile"; link += "&scope=openid%20profile";
window.location.href = link; window.location.href = link;
}; };
onUnmounted(() => {
clearInterval(timer);
});
</script> </script>
<style lang="less" scoped></style> <style lang="less" scoped>
.input-box {
.verify {
font-size: calc(14px + (28 - 22) * ((100vw - 320px) / (1920 - 320)));
position: absolute;
right: 16px;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
.disable {
color: #c9ccd0;
cursor: not-allowed;
}
}
</style>

@ -10,10 +10,13 @@ import { useRoute , useRouter } from 'vue-router'
import { lineLogin } from '@/services/auth' import { lineLogin } from '@/services/auth'
import { showToast } from 'vant' import { showToast } from 'vant'
import { useShopStore } from '@/store/Shop'
const route = useRoute() const route = useRoute()
const router = useRouter() const router = useRouter()
const shopStore = useShopStore()
const code = route.query.code const code = route.query.code
if(!code){ if(!code){
@ -22,7 +25,7 @@ if(!code){
axios.post('https://api.line.me/oauth2/v2.1/token',{ axios.post('https://api.line.me/oauth2/v2.1/token',{
grant_type: 'authorization_code', grant_type: 'authorization_code',
code: code, code: code,
redirect_uri: import.meta.env.VITE_APP_BASE_URL + '/m/linelogin/', redirect_uri: 'https://' + shopStore.domain + '/m/linelogin/',
client_id: '1657876696', client_id: '1657876696',
client_secret: '2a7930d6143a00ff421812b942cde200' client_secret: '2a7930d6143a00ff421812b942cde200'
},{ },{
@ -32,11 +35,14 @@ if(!code){
}).then(async (response) => { }).then(async (response) => {
let res = await lineLogin({token:response.data.id_token}) let res = await lineLogin({token:response.data.id_token})
if(res.code == 200){ if(res.code == 200){
Cookies.set('token',res.data.token,{ expires: 30 ,domain: import.meta.env.VITE_APP_SSO_DOMAIN}) Cookies.set('token',res.data.token,{ expires: 365 ,domain: shopStore.sso_domain})
Cookies.set('uid',res.data.uid,{ expires: 30 ,domain: import.meta.env.VITE_APP_SSO_DOMAIN}) Cookies.set('uid',res.data.uid,{ expires: 365 ,domain: shopStore.sso_domain})
showToast('登入成功') showToast('登入成功')
if(route.query.state !== 'login'){
router.push('/user/info') router.push(route.query.state)
}else{
router.push('/user/info')
}
}else if(res.code == 201){ }else if(res.code == 201){
sessionStorage.setItem('reg',JSON.stringify(response.data)) sessionStorage.setItem('reg',JSON.stringify(response.data))
router.push({name:'Register',query: {type:'line'}}); router.push({name:'Register',query: {type:'line'}});

@ -0,0 +1,203 @@
<template>
<!-- Header Start -->
<header class="header">
<div class="logo-wrap">
<i class="icon-arrow-left-bold-box icli" @click="$router.push('/user/info')"></i>
<h1 class="title-color font-md">餘額管理</h1>
</div>
</header>
<!-- Header End -->
<!-- Main Start -->
<main class="main-wrap order-history mb-xxl">
<!-- Account Info Start -->
<div class="info-section">
可提領餘額: ${{ accInfo.user_money }}<br/>
未入帳餘額: ${{ accInfo.frozen_money }}<br/>
總餘額: ${{ parseInt(accInfo.user_money) + parseInt(accInfo.frozen_money) }}
</div>
<!-- Account Info End -->
<!-- Action: Start -->
<div class="action-section">
<van-button type="success" size="small" @click="showWithdraw = true">我要提領</van-button>
</div>
<!-- Action: End -->
<!-- Tab Content Start -->
<section class="tab-content ratio2_1" id="pills-tabContent">
<!-- Catagories Content Start -->
<div class="tab-pane fade show active" id="catagories1" role="tabpanel" aria-labelledby="catagories1-tab">
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list
v-model:loading="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad">
<div class="order-box" v-for="(v, i) in list" :key="v.id">
<div class="media">
<div class="content-box">
<h2 class="font-sm title-color">操作時間: {{ v.add_time }}</h2>
<h2 class="font-sm title-color">類型: {{ v.process_type }}</h2>
<div class="content-color font-xs">
金額: <span class="font-theme">${{ v.amount }}</span>
</div>
<p class="font-xs content-color">會員備註{{ v.user_note }}</p>
<p class="font-xs content-color">管理員備註{{ v.admin_note }}</p>
<div></div>
</div>
</div>
<div class="bottom-content">
<a class="title-color font-sm fw-600"> {{ v.is_paid }} </a>
<a
@click="handleCancel(v.id)"
v-if="v.is_paid == '未支付'"
class="give-rating content-color font-sm"> 取消</a>
</div>
</div>
</van-list>
</van-pull-refresh>
</div>
<!-- Catagories Content End -->
</section>
<!-- Tab Content End -->
</main>
<!-- Main End -->
<!-- Add New Withdraw Start -->
<van-popup v-model:show="showWithdraw" round closeable position="bottom">
<div class="offcanvas-header">
<h5 class="title-color font-md fw-600">餘額提領</h5>
</div>
<van-form @submit="onSubmit" ref="addrForm">
<div class="offcanvas-body small">
<van-cell-group inset>
<van-field
v-model="form.amount"
name="amount"
label="提領金額"
placeholder="金額最少為1000"
:rules="[{ required: true, message: '提領金額' }]"
/>
<van-field v-model="form.user_note" name="user_note" label="提領備註" />
</van-cell-group>
</div>
<div style="margin: 16px">
<van-button round block type="success" native-type="submit"> 確認送出 </van-button>
</div>
</van-form>
</van-popup>
<!-- Add New Withdraw End -->
</template>
<script setup>
import { ref, onMounted, watch } from "vue";
import { getUserAccInfo, getUserAccounts, addUserAccount, delUserAccount } from "@/services/user";
import { showToast } from "vant";
import "vant/es/toast/style";
import { showConfirmDialog } from 'vant';
import { load } from "@liff/extensions";
const accInfo = ref({
user_money: 0,
frozen_money: 0,
});
const list = ref([]);
const page = ref(1);
const loading = ref(false);
const finished = ref(false);
const refreshing = ref(false);
onMounted(async() => {
let res = await getUserAccInfo();
if(res.code === 200){
accInfo.value = res.data;
}
});
const onLoad = async ()=>{
if (refreshing.value) {
page.value = 1;
list.value = [];
refreshing.value = false;
}
let res = await getUserAccounts(page.value);
if (res.code === 200) {
//res.datalist array
list.value.push(...res.data.data);
// list.value.push(res.data);
page.value += 1
}
loading.value = false;
if (list.value.length == res.data.total) {
finished.value = true;
}
}
const onRefresh = async () =>{
finished.value = false;
loading.value = true;
onLoad();
}
//
const showWithdraw = ref(false);
const form = ref({
amount: null,
user_note: "",
});
const onSubmit = async () => {
let res = await addUserAccount(form.value);
if (res.code === 200) {
showToast("申請成功,請等待管理員審核撥款");
list.value = res.data;
form.value = {};
} else {
showToast("操作失敗,重新發送");
}
showWithdraw.value = false;
};
//
const handleCancel = (id) => {
showConfirmDialog({
title: "確認取消",
message: "您確定要取消此筆提領嗎?",
confirmButtonText: "確認",
cancelButtonText: "取消",
})
.then(async () => {
let res = await delUserAccount(id);
if (res.code === 200) {
showToast("取消成功");
//list.value,idid
list.value = list.value.filter((v) => v.id !== id);
} else {
showToast("取消失敗");
}
})
.catch(() => {
showToast("取消操作");
});
};
</script>
<style lang="less" scoped>
.action-section {
//
text-align: right;
}
</style>

@ -57,11 +57,11 @@
<!-- Navigation Start --> <!-- Navigation Start -->
<ul class="navigation"> <ul class="navigation">
<li> <li>
<a href="index.html" class="nav-link title-color font-sm"> <a class="nav-link title-color font-sm">
<i class="icon-account icli"></i> <i class="icon-account icli"></i>
<span>推薦人</span> <span>推薦人</span>
</a> </a>
<a href="index.html"> <a>
{{ userInfo.parent_name || '沒有推薦人'}} {{ userInfo.parent_name || '沒有推薦人'}}
</a> </a>
</li> </li>
@ -70,12 +70,10 @@
<i class="icon-link-variant icli"></i> <i class="icon-link-variant icli"></i>
<span>推薦連結</span> <span>推薦連結</span>
</a> </a>
<!-- <a href="javacript:void(0)"> -->
<button v-clipboard:copy="userInfo.refer_url" <button v-clipboard:copy="userInfo.refer_url"
v-clipboard:success="onSuccess" v-clipboard:success="onSuccess"
v-clipboard:error="onError" v-clipboard:error="onError"
>複制</button> >複制</button>
<!-- </a> -->
</li> </li>
<li @click="$router.push('/address')"> <li @click="$router.push('/address')">
<a class="nav-link title-color font-sm"> <a class="nav-link title-color font-sm">
@ -95,23 +93,23 @@
<i class="icon-chevron-right"></i> <i class="icon-chevron-right"></i>
</a> </a>
</li> </li>
<li> <li @click="$router.push('/user/account')">
<router-link to="/address" class="nav-link title-color font-sm"> <a class="nav-link title-color font-sm">
<i class="icon-home icli"></i> <i class="icon-home icli"></i>
<span>餘額管理</span> <span>餘額管理</span>
</router-link> </a>
<router-link to="/address" class="arrow"> <a class="arrow">
<i class="icon-chevron-right"></i> <i class="icon-chevron-right"></i>
</router-link> </a>
</li> </li>
<li> <li @click="$router.push('/user/share')">
<router-link to="/user/share" class="nav-link title-color font-sm"> <a class="nav-link title-color font-sm">
<i class="icon-share icli"></i> <i class="icon-share icli"></i>
<span>我的推薦</span> <span>我的推薦</span>
</router-link> </a>
<router-link to="/user/share" class="arrow"> <a class="arrow">
<i class="icon-chevron-right"></i> <i class="icon-chevron-right"></i>
</router-link> </a>
</li> </li>
</ul> </ul>
<!-- Navigation End --> <!-- Navigation End -->
@ -131,6 +129,7 @@ import Cookies from 'js-cookie';
import { onMounted , ref } from 'vue' import { onMounted , ref } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { useShopStore } from '@/store/Shop'
import { getUserInfo } from '@/services/user' import { getUserInfo } from '@/services/user'
import { showToast } from 'vant'; import { showToast } from 'vant';
@ -141,6 +140,9 @@ import { showToast } from 'vant';
})() })()
const router = useRouter() const router = useRouter()
const shopStore = useShopStore()
const userInfo = ref({}) const userInfo = ref({})
onMounted(async () => { onMounted(async () => {
@ -153,9 +155,8 @@ onMounted(async () => {
}) })
const handleLogout = () => { const handleLogout = () => {
console.log({ domain: import.meta.env.VITE_APP_SSO_DOMAIN}) Cookies.remove('token',{ domain: shopStore.sso_domain})
Cookies.remove('token',{ domain: import.meta.env.VITE_APP_SSO_DOMAIN}) Cookies.remove('uid',{ domain: shopStore.sso_domain})
Cookies.remove('uid',{ domain: import.meta.env.VITE_APP_SSO_DOMAIN})
// liff.logout() // liff.logout()
router.replace('/login') router.replace('/login')

@ -1,27 +1,17 @@
<template> <template>
<!-- Header Start --> <!-- Header Start -->
<!-- <header class="header"> <header class="header">
<div class="logo-wrap"> <div class="logo-wrap">
<a href="index.html"><i class="iconly-Arrow-Left-Square icli"></i></a> <i class="icon-arrow-left-bold-box icli" @click="$router.push('/user/info')"></i>
<h1 class="title-color font-md">Order History</h1> <h1 class="title-color font-md">我的訂單</h1>
</div> </div>
<div class="avatar-wrap"> </header>
<a href="index.html">
<i class="iconly-Home icli"></i>
</a>
</div>
</header> -->
<!-- Header End --> <!-- Header End -->
<!-- Main Start --> <!-- Main Start -->
<main class="main-wrap order-history mb-xxl"> <main class="main-wrap order-history mb-xxl">
<!-- Catagories Tabs Start --> <!-- Catagories Tabs Start -->
<ul class="nav nav-tab nav-pills custom-scroll-hidden" id="pills-tab" role="tablist"> <!-- <ul class="nav nav-tab nav-pills custom-scroll-hidden" id="pills-tab" role="tablist">
<li class="nav-item" role="presentation" @click="setStatus(0)">
<button class="nav-link" :class="{active: status==0}" id="catagories1-tab" type="button">
待確認
</button>
</li>
<li class="nav-item" role="presentation" @click="setStatus(1)"> <li class="nav-item" role="presentation" @click="setStatus(1)">
<button class="nav-link" :class="{active: status==1}" id="catagories1-tab" type="button"> <button class="nav-link" :class="{active: status==1}" id="catagories1-tab" type="button">
待付款 待付款
@ -52,7 +42,7 @@
退貨/退款 退貨/退款
</button> </button>
</li> </li>
</ul> </ul> -->
<!-- Catagories Tabs End --> <!-- Catagories Tabs End -->
<!-- Tab Content Start --> <!-- Tab Content Start -->
@ -76,7 +66,7 @@
</a> </a>
</div> </div>
<div class="bottom-content"> <div class="bottom-content">
<a href="address2.html" class="title-color font-sm fw-600"> 再買一次 </a> <!-- <a href="javascript:;" class="title-color font-sm fw-600"> 再買一次 </a> -->
<a href="javascript:void(0)" class="give-rating content-color font-sm"> {{ orderStatus[order.order_status] }}</a> <a href="javascript:void(0)" class="give-rating content-color font-sm"> {{ orderStatus[order.order_status] }}</a>
<div class="rating"> <div class="rating">
<i data-feather="star"></i> <i data-feather="star"></i>
@ -108,12 +98,11 @@ const orderList = ref([])
const orderStatus = { const orderStatus = {
0: '待確認', 0: '待確認',
1: '待付款', 1: '已確認',
2: '待出貨', 2: '已取消',
3: '待收貨', 3: '無效',
4: '已完成', 4: '退貨',
5: '不成立', 7: '已完成',
6: '退貨退款',
} }
onMounted(async () => { onMounted(async () => {

@ -1,10 +1,19 @@
<template> <template>
<!-- Header Start -->
<header class="header">
<div class="logo-wrap">
<i class="icon-arrow-left-bold-box icli" @click="$router.push('/user/info')"></i>
<h1 class="title-color font-md">我的推薦</h1>
</div>
</header>
<!-- Header End -->
<!-- Main Start --> <!-- Main Start -->
<main class="main-wrap about-us-page mb-xxl"> <main class="main-wrap about-us-page mb-xxl">
<!-- 分潤獎金 Section Start --> <!-- 分潤獎金 Section Start -->
<section class="spliting"> <section class="bonus-section">
<h2 class="title-color font-md">分銷獎金</h2> <h2 class="title-color font-md">分銷獎金</h2>
<div>目前累積金額 $20000</div> <div>目前累積金額 ${{ shareInfo.l1_num * 400 }}</div>
<div class="css-table"> <div class="css-table">
<div class="css-tr"> <div class="css-tr">
<div class="css-td">推薦人數</div> <div class="css-td">推薦人數</div>
@ -12,18 +21,18 @@
<div class="css-td">轉換率</div> <div class="css-td">轉換率</div>
</div> </div>
<div class="css-tr"> <div class="css-tr">
<div class="css-td">100</div> <div class="css-td">{{shareInfo.share_num}}</div>
<div class="css-td">50</div> <div class="css-td">{{shareInfo.l1_num}}</div>
<div class="css-td">50%</div> <div class="css-td">{{shareInfo.tran_rate}}%</div>
</div> </div>
</div> </div>
</section> </section>
<!-- 分潤獎金 Section End --> <!-- 分潤獎金 Section End -->
<!-- 分潤獎金 Section Start --> <!-- 分潤獎金 Section Start -->
<section class="spliting"> <section class="profit-section">
<h2 class="title-color font-md">分潤獎金</h2> <h2 class="title-color font-md">分潤獎金</h2>
<div>目前累積金額 $2000</div> <div>目前累積金額 ${{ shareInfo.l2_num * 50 + shareInfo.l3_num * 30 + shareInfo.l4_num * 20 }}</div>
<div class="css-table"> <div class="css-table">
<div class="css-tr"> <div class="css-tr">
<div class="css-td">二級人數</div> <div class="css-td">二級人數</div>
@ -31,9 +40,9 @@
<div class="css-td">四級人數</div> <div class="css-td">四級人數</div>
</div> </div>
<div class="css-tr"> <div class="css-tr">
<div class="css-td">1</div> <div class="css-td">{{ shareInfo.l2_num}}</div>
<div class="css-td">3</div> <div class="css-td">{{ shareInfo.l3_num}}</div>
<div class="css-td">5</div> <div class="css-td">{{ shareInfo.l4_num}}</div>
</div> </div>
</div> </div>
</section> </section>
@ -46,10 +55,34 @@
<script setup> <script setup>
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import { getShareInfo } from '@/services/user'
const shareInfo = ref({})
onMounted(async ()=>{
let res = await getShareInfo()
if (res.code === 200) {
shareInfo.value = res.data
}
})
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.bonus-section{
margin-bottom: 20px;
width: 100%;
padding: 17px;
background-color: #fafafa;
border-radius: 7px;
}
.profit-section{
width: 100%;
padding: 17px;
background-color: #fafafa;
border-radius: 7px;
}
.css-table { .css-table {
display:table; display:table;
width: 100%; width: 100%;
@ -60,8 +93,7 @@ import { ref, onMounted } from 'vue'
width: 33%; width: 33%;
display: table-cell; display: table-cell;
text-align: center; text-align: center;
border: 1px #666 solid; border: 1px #ccc solid;
} }
} }
} }

@ -66,6 +66,7 @@ import Cookies from "js-cookie";
import { ref } from "vue"; import { ref } from "vue";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import { useShopStore } from '@/store/Shop'
import { showToast, showLoadingToast } from "vant"; import { showToast, showLoadingToast } from "vant";
@ -76,6 +77,8 @@ const URL = window.URL || window.webkitURL;
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const shopStore = useShopStore();
const form = ref({ const form = ref({
phone: "", phone: "",
}); });
@ -102,8 +105,8 @@ const onSubmit = async () => {
return router.push("/login"); return router.push("/login");
} else if (regRes.code === 200) { } else if (regRes.code === 200) {
showToast("註冊成功"); showToast("註冊成功");
Cookies.set("token", regRes.data.token, { expires: 30, domain: import.meta.env.VITE_APP_SSO_DOMAIN }); Cookies.set("token", regRes.data.token, { expires: 365, domain: shopStore.sso_domain });
Cookies.set("uid", regRes.data.uid, { expires: 30, domain: import.meta.env.VITE_APP_SSO_DOMAIN }); Cookies.set("uid", regRes.data.uid, { expires: 365, domain: shopStore.sso_domain });
return router.push("/user"); return router.push("/user");
} else { } else {

@ -3,7 +3,7 @@ import Cookies from 'js-cookie'
import CommonLayout from '@/layouts/Common.vue' import CommonLayout from '@/layouts/Common.vue'
import UserLayout from '@/layouts/User.vue' import UserLayout from '@/layouts/User.vue'
import checkLogn from '@/pages/Login/checkLogin' import checkLogin from '@/pages/Login/checkLogin'
let history = createWebHistory('/m') let history = createWebHistory('/m')
@ -44,7 +44,6 @@ let routes = [
path: '/login', path: '/login',
name: 'Login', name: 'Login',
component: ()=> import("../pages/Login/Index.vue"), component: ()=> import("../pages/Login/Index.vue"),
beforeEnter: [checkLogn]
}, },
{ {
path: '/linelogin', path: '/linelogin',
@ -75,6 +74,12 @@ let routes = [
path: '/404', path: '/404',
name: '404', name: '404',
component: ()=> import("../pages/Error/404.vue") component: ()=> import("../pages/Error/404.vue")
},
{
path: '/user/info',
name: 'UserInfo',
meta: {isAuth: true},
component: ()=> import("../pages/My/Index.vue")
} }
] ]
},{ },{
@ -83,18 +88,18 @@ let routes = [
component: UserLayout, component: UserLayout,
redirect: '/user/info', redirect: '/user/info',
children: [ children: [
{
path: 'info',
name: 'UserInfo',
meta: {isAuth: true},
component: ()=> import("../pages/My/Index.vue")
},
{ {
path: 'order', path: 'order',
name: 'UserOrder', name: 'UserOrder',
meta: {isAuth: true}, meta: {isAuth: true},
component: ()=> import("../pages/My/Order/Index.vue") component: ()=> import("../pages/My/Order/Index.vue")
}, },
{
path: 'account',
name: 'UserAccount',
meta: {isAuth: true},
component: ()=> import("../pages/My/Account/Index.vue")
},
{ {
path: 'share', path: 'share',
name: 'UserShare', name: 'UserShare',

@ -12,6 +12,10 @@ export function login(params){
return request('/auth/login','post',params, {requestBase:'sso'}) return request('/auth/login','post',params, {requestBase:'sso'})
} }
export function sendVerify(username){
return request('/auth/sendVerify','post', {username},{requestBase:'sso'})
}
export function checkLogin(){ export function checkLogin(){
return request('/auth/checkLogin') return request('/auth/checkLogin')
} }
@ -19,3 +23,4 @@ export function checkLogin(){
export function register(params){ export function register(params){
return request('/auth/register','post',params) return request('/auth/register','post',params)
} }

@ -28,3 +28,22 @@ export function getUserOrders() {
return request('/user/getUserOrders', 'post') return request('/user/getUserOrders', 'post')
} }
export function getUserAccounts(page) {
return request('/user/getUserAccounts', 'get', { page })
}
export function addUserAccount(params) {
return request('/user/addUserAccount', 'post', params)
}
export function delUserAccount(id) {
return request('/user/delUserAccount', 'get', { id })
}
export function getUserAccInfo() {
return request('/user/getUserAccInfo', 'get')
}
export function getShareInfo() {
return request('/user/getShareInfo', 'get')
}

@ -20,6 +20,7 @@ export const useOrderStore = defineStore('order', {
}, },
goodsItems: [], goodsItems: [],
discount: 0, discount: 0,
extension_code: '',
} }
}, },
getters: { getters: {

@ -6,7 +6,12 @@ export const useShopStore = defineStore('shop', {
state: () => { state: () => {
return { return {
session_id: '', session_id: '',
config:[] domain: '',
sso_domain: '',
config: {
service_phone: '',
service_email: '',
}
} }
}, },
getters: { getters: {
@ -15,6 +20,7 @@ export const useShopStore = defineStore('shop', {
async getShopInfo(){ async getShopInfo(){
let res = await getShopInfo() let res = await getShopInfo()
this.session_id = res.data.session_id this.session_id = res.data.session_id
this.config = res.data.shop_config
} }
}, },
}) })

@ -4,19 +4,41 @@ import { useShopStore } from "@/store/Shop"
import { useUserStore } from "@/store/User" import { useUserStore } from "@/store/User"
import { useCartStore } from "@/store/Cart" import { useCartStore } from "@/store/Cart"
export async function initSession(){ export async function initSession() {
if(!Cookies.get('SessionId')){ if (!Cookies.get('SessionId')) {
Cookies.set('SessionId',uuidv1()) Cookies.set('SessionId', uuidv1())
} }
} }
export async function initStore(){ export async function initStore() {
const shopStore = useShopStore() const shopStore = useShopStore()
const userStore = useUserStore() const userStore = useUserStore()
const cartStore = useCartStore() const cartStore = useCartStore()
await Promise.all([shopStore.getShopInfo(),userStore.init(),cartStore.initCart()]) // 獲取當前頁面的主機名
const hostname = window.location.hostname;
//判斷hostname是否為ip
const reg = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/;
if (reg.test(hostname)) {
shopStore.sso_domain = hostname
} else {
// 將主機名按照句點進行拆分
const parts = hostname.split('.');
let domain = '';
// 如果主機名包含至少 3 個部分(例如 subdomain.example.com
if (parts.length >= 3) {
// 獲取第二個部分(即 subdomain
domain = parts[1] + '.' + parts[2];
} else {
domain = hostname;
}
console.log('domain', domain)
shopStore.domain = hostname
shopStore.sso_domain = domain
}
await Promise.all([shopStore.getShopInfo(), userStore.init(), cartStore.initCart()])
} }

@ -1,13 +1,14 @@
import axios from 'axios' import axios from 'axios'
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import router from '@/router' import router from '@/router'
import { useShopStore } from '@/store/Shop'
import { showToast, showLoadingToast } from 'vant' import { showToast, showLoadingToast } from 'vant'
import NProgress from "nprogress"; import NProgress from "nprogress";
import "nprogress/nprogress.css"; import "nprogress/nprogress.css";
const ajax = axios.create({ const ajax = axios.create({
baseURL: 'https://shop.h888.fun/appapi/v1', baseURL: import.meta.env.VITE_APP_API_URL,
withCredentials: true, withCredentials: true,
timeout: 5000 timeout: 5000
}) })
@ -57,9 +58,8 @@ ajax.interceptors.response.use(
if (error.response) { if (error.response) {
switch (error.response.status) { switch (error.response.status) {
case 401: case 401:
console.log('response 401') Cookies.remove('token', { expires: 30, domain: useShopStore.sso_domain })
Cookies.remove('token', { expires: 30, domain: import.meta.env.VITE_APP_SSO_DOMAIN }) Cookies.remove('uid', { expires: 30, domain: useShopStore.sso_domain })
Cookies.remove('uid', { expires: 30, domain: import.meta.env.VITE_APP_SSO_DOMAIN })
router.replace({ router.replace({
path: '/login', path: '/login',
@ -77,6 +77,6 @@ ajax.interceptors.response.use(
function refreshToken(response) { function refreshToken(response) {
let token = response.headers.authorization let token = response.headers.authorization
if (token) { if (token) {
Cookies.set('token', res.data.token, { expires: 30, domain: import.meta.env.VITE_APP_SSO_DOMAIN }) Cookies.set('token', res.data.token, { expires: 30, domain: useShopStore.sso_domain })
} }
} }

@ -1610,6 +1610,11 @@ prr@~1.0.1:
resolved "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz" resolved "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz"
integrity sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw== integrity sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==
qrcode.vue@^3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/qrcode.vue/-/qrcode.vue-3.4.0.tgz#4513ff1a4734cb7184086c2fd439f0d462c6d281"
integrity sha512-4XeImbv10Fin16Fl2DArCMhGyAdvIg2jb7vDT+hZiIAMg/6H6mz9nUZr/dR8jBcun5VzNzkiwKhiqOGbloinwA==
qs@6.11.0: qs@6.11.0:
version "6.11.0" version "6.11.0"
resolved "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz" resolved "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz"

Loading…
Cancel
Save