feat: 新增商家入驻隐私协议页,源码相关的api/utils目录规范化到src,配置vite代理api,axios接口拦截减少一层,添加env.local开发环境变量配置
This commit is contained in:
parent
088c1122c3
commit
8b682bf546
1
.env.local
Normal file
1
.env.local
Normal file
@ -0,0 +1 @@
|
|||||||
|
VUE_APP_BASE_URL = https://mall.gpxscs.cn
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -9,3 +9,5 @@ docs/_book
|
|||||||
# TODO: where does this rule come from?
|
# TODO: where does this rule come from?
|
||||||
test/
|
test/
|
||||||
|
|
||||||
|
node_modules/
|
||||||
|
.history
|
||||||
10
components.d.ts
vendored
10
components.d.ts
vendored
@ -8,25 +8,15 @@ export {}
|
|||||||
/* prettier-ignore */
|
/* prettier-ignore */
|
||||||
declare module 'vue' {
|
declare module 'vue' {
|
||||||
export interface GlobalComponents {
|
export interface GlobalComponents {
|
||||||
ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
|
|
||||||
ElButton: typeof import('element-plus/es')['ElButton']
|
ElButton: typeof import('element-plus/es')['ElButton']
|
||||||
ElCarousel: typeof import('element-plus/es')['ElCarousel']
|
ElCarousel: typeof import('element-plus/es')['ElCarousel']
|
||||||
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
|
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
|
||||||
ElCascader: typeof import('element-plus/es')['ElCascader']
|
|
||||||
ElCol: typeof import('element-plus/es')['ElCol']
|
ElCol: typeof import('element-plus/es')['ElCol']
|
||||||
ElForm: typeof import('element-plus/es')['ElForm']
|
ElForm: typeof import('element-plus/es')['ElForm']
|
||||||
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
|
||||||
ElInput: typeof import('element-plus/es')['ElInput']
|
ElInput: typeof import('element-plus/es')['ElInput']
|
||||||
ElOption: typeof import('element-plus/es')['ElOption']
|
|
||||||
ElRadio: typeof import('element-plus/es')['ElRadio']
|
|
||||||
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
|
||||||
ElRow: typeof import('element-plus/es')['ElRow']
|
ElRow: typeof import('element-plus/es')['ElRow']
|
||||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
|
||||||
ElStatistic: typeof import('element-plus/es')['ElStatistic']
|
ElStatistic: typeof import('element-plus/es')['ElStatistic']
|
||||||
ElStep: typeof import('element-plus/es')['ElStep']
|
|
||||||
ElSteps: typeof import('element-plus/es')['ElSteps']
|
|
||||||
ElUpload: typeof import('element-plus/es')['ElUpload']
|
|
||||||
FloatingMenu: typeof import('./src/components/floatingMenu.vue')['default']
|
FloatingMenu: typeof import('./src/components/floatingMenu.vue')['default']
|
||||||
Login: typeof import('./src/components/login.vue')['default']
|
Login: typeof import('./src/components/login.vue')['default']
|
||||||
Register: typeof import('./src/components/register.vue')['default']
|
Register: typeof import('./src/components/register.vue')['default']
|
||||||
|
|||||||
21
src/App.vue
21
src/App.vue
@ -1,4 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<template v-if="!isFullpage">
|
||||||
<div>
|
<div>
|
||||||
<HeadMenu @open-login-form="showLoginForm = true" @open-register-form="showRegisterForm = true" />
|
<HeadMenu @open-login-form="showLoginForm = true" @open-register-form="showRegisterForm = true" />
|
||||||
<div class="contain">
|
<div class="contain">
|
||||||
@ -10,16 +11,34 @@
|
|||||||
<Login :isVisible="showLoginForm" @close-login-form="showLoginForm = false" />
|
<Login :isVisible="showLoginForm" @close-login-form="showLoginForm = false" />
|
||||||
<Register :isVisible="showRegisterForm" @close-register-form="showRegisterForm = false" />
|
<Register :isVisible="showRegisterForm" @close-register-form="showRegisterForm = false" />
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<router-view class="routerView" />
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref, watch, computed, onMounted } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import HeadMenu from '@/views/HeadMenu.vue';
|
import HeadMenu from '@/views/HeadMenu.vue';
|
||||||
|
|
||||||
import Footer from '@/views/Footer.vue';
|
import Footer from '@/views/Footer.vue';
|
||||||
import Login from '@/components/login.vue';
|
import Login from '@/components/login.vue';
|
||||||
import Register from '@/components/register.vue';
|
import Register from '@/components/register.vue';
|
||||||
import Feedback from './components/floatingMenu.vue';
|
import Feedback from './components/floatingMenu.vue';
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
const showLoginForm = ref(false);
|
const showLoginForm = ref(false);
|
||||||
const showRegisterForm = ref(false); // 定义控制注册组件显示的变量
|
const showRegisterForm = ref(false); // 定义控制注册组件显示的变量
|
||||||
|
const fullpageRef = ref(true);
|
||||||
|
|
||||||
|
// 计算属性:根据当前路由的 meta 决定是否显示页头页脚
|
||||||
|
const isFullpage = computed(() => {
|
||||||
|
return route?.meta?.isFullpage || false;
|
||||||
|
});
|
||||||
|
|
||||||
|
fullpageRef.value = isFullpage.value
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
13
src/api/content.ts
Normal file
13
src/api/content.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import http from '@/utils/http';
|
||||||
|
|
||||||
|
export const CONTENT_API = {
|
||||||
|
getAgreement(params) {
|
||||||
|
const str = new URLSearchParams(params).toString();
|
||||||
|
return http({
|
||||||
|
method:'GET',
|
||||||
|
url:`/api/mobile/account/login/protocol?${str}`,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default CONTENT_API
|
||||||
@ -35,7 +35,7 @@
|
|||||||
import { ref, defineProps, defineEmits, watch, onMounted, onUnmounted } from 'vue';
|
import { ref, defineProps, defineEmits, watch, onMounted, onUnmounted } from 'vue';
|
||||||
import { useUserStore } from '@/stores/userStore';
|
import { useUserStore } from '@/stores/userStore';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { GetLogin, GetSmsCode, GetVerifyCode, GetAccountLogin } from '../../api/login';
|
import { GetLogin, GetSmsCode, GetVerifyCode, GetAccountLogin } from '@/api/login';
|
||||||
import { ElMessage } from 'element-plus/es';
|
import { ElMessage } from 'element-plus/es';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@ -53,8 +53,8 @@
|
|||||||
import { ref, defineProps, defineEmits, onMounted, onUnmounted } from 'vue';
|
import { ref, defineProps, defineEmits, onMounted, onUnmounted } from 'vue';
|
||||||
import { useUserStore } from '@/stores/userStore';
|
import { useUserStore } from '@/stores/userStore';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { GetSmsCode, GetLogin } from '../../api/login';
|
import { GetSmsCode, GetLogin } from '@/api/login';
|
||||||
import { getApproval_status } from '../../api/login';
|
import { getApproval_status } from '@/api/login';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -37,6 +37,14 @@ const routes=[
|
|||||||
name:'check',
|
name:'check',
|
||||||
component:()=>import('../views/start/check.vue')
|
component:()=>import('../views/start/check.vue')
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path:'/businessAgreementPrivacy',
|
||||||
|
name:'businessAgreementPrivacy',
|
||||||
|
component:()=>import('@/views/business/agreement/privacy.vue'),
|
||||||
|
meta:{
|
||||||
|
isFullpage: true
|
||||||
|
}
|
||||||
|
},
|
||||||
];
|
];
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history:createWebHistory(),
|
history:createWebHistory(),
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
// import store from '@/store'
|
// import store from '@/store'
|
||||||
|
|
||||||
const baseURL = "https://mall.gpxscs.cn/mobile";
|
const baseURL = import.meta.env.VUE_APP_BASE_URL;
|
||||||
|
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: baseURL, // url = base url + request url
|
baseURL: baseURL, // url = base url + request url
|
||||||
headers: {
|
headers: {
|
||||||
"X-Requested-With": "XMLHttpRequest",
|
// "X-Requested-With": "XMLHttpRequest",
|
||||||
"Content-Type": "application/json-patch+json",
|
// "Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
timeout: 5000, // request timeout
|
timeout: 5000, // request timeout
|
||||||
});
|
});
|
||||||
@ -29,7 +29,7 @@ service.interceptors.request.use(
|
|||||||
// response interceptor
|
// response interceptor
|
||||||
service.interceptors.response.use(
|
service.interceptors.response.use(
|
||||||
(response) => {
|
(response) => {
|
||||||
return response;
|
return response.data;
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
if (error.response.status === 401) {
|
if (error.response.status === 401) {
|
||||||
@ -67,7 +67,7 @@
|
|||||||
import { ref, onMounted, watch, onUnmounted } from 'vue';
|
import { ref, onMounted, watch, onUnmounted } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { useUserStore } from '@/stores/userStore';
|
import { useUserStore } from '@/stores/userStore';
|
||||||
import { getApproval_status } from '../../api/login';
|
import { getApproval_status } from '@/api/login';
|
||||||
|
|
||||||
const emits = defineEmits(['open-login-form', 'open-register-form']);
|
const emits = defineEmits(['open-login-form', 'open-register-form']);
|
||||||
|
|
||||||
|
|||||||
27
src/views/business/agreement/privacy.vue
Normal file
27
src/views/business/agreement/privacy.vue
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<template>
|
||||||
|
<div class="container" v-html="html"></div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue'
|
||||||
|
import CONTENT_API from '@/api/content';
|
||||||
|
|
||||||
|
const html = ref("")
|
||||||
|
|
||||||
|
const getContentData = async () => {
|
||||||
|
const res = await CONTENT_API.getAgreement({
|
||||||
|
protocols_key: 'joininPrivacyAgreement'
|
||||||
|
});
|
||||||
|
if (res?.status === 200) {
|
||||||
|
html.value = res.data.document;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
getContentData()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.container{
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -26,7 +26,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { Plus } from '@element-plus/icons-vue';
|
import { Plus } from '@element-plus/icons-vue';
|
||||||
import { uploadFile } from '../../../api/upload'; // 引入新的 API 方法
|
import { uploadFile } from '@/api/upload'; // 引入新的 API 方法
|
||||||
|
|
||||||
const feedbackObj = reactive({
|
const feedbackObj = reactive({
|
||||||
describe: '',
|
describe: '',
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
clickable Avatar: undefined
|
|
||||||
<template>
|
<template>
|
||||||
<div class="slider">
|
<div class="slider">
|
||||||
<div class="slider-container">
|
<div class="slider-container">
|
||||||
|
|||||||
@ -216,10 +216,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { getApproval_status, re_apply } from '../../../api/login';
|
import { getApproval_status, re_apply } from '@/api/login';
|
||||||
import { onMounted, ref, reactive } from 'vue';
|
import { onMounted, ref, reactive } from 'vue';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import { GetStoreCategories, transformStoreCategories, GetPostion, GetBank, merchApply, GetMerchDetail } from '../../../api/login';
|
import { GetStoreCategories, transformStoreCategories, GetPostion, GetBank, merchApply, GetMerchDetail } from '@/api/login';
|
||||||
import { useUserStore } from '@/stores/userStore';
|
import { useUserStore } from '@/stores/userStore';
|
||||||
import cityData from '../../stores/cityData';
|
import cityData from '../../stores/cityData';
|
||||||
import { Plus } from '@element-plus/icons-vue'
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
|
|||||||
@ -228,7 +228,7 @@ import type { CityDataStructure } from '../../stores/cityData';
|
|||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import { useUserStore } from '@/stores/userStore';
|
import { useUserStore } from '@/stores/userStore';
|
||||||
import { Plus } from '@element-plus/icons-vue'
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
import { GetStoreCategories, transformStoreCategories, GetPostion, GetBank, merchApply, GetAppDistrict } from '../../../api/login';
|
import { GetStoreCategories, transformStoreCategories, GetPostion, GetBank, merchApply, GetAppDistrict } from '@/api/login';
|
||||||
|
|
||||||
const active = ref(1);
|
const active = ref(1);
|
||||||
const formRef = ref(null);
|
const formRef = ref(null);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
||||||
"include": ["env.d.ts", "src/**/*", "src/**/*.vue", "api/login.js", "public/xiaofa_font"],
|
"include": ["env.d.ts", "src/**/*", "src/**/*.vue", "src/api/login.js", "public/xiaofa_font"],
|
||||||
"exclude": ["src/**/__tests__/*"],
|
"exclude": ["src/**/__tests__/*"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||||
|
|||||||
@ -82,5 +82,15 @@ export default defineConfig({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
server: {
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
target: 'https://mall.gpxscs.cn/',
|
||||||
|
changeOrigin: true,
|
||||||
|
secure: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user