diff --git a/web/.gitignore b/web/.gitignore index 90e126daf..152d35c0f 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -1,5 +1,4 @@ node_modules -*.log* .nuxt .nitro .cache diff --git a/web/api/member.ts b/web/api/member.ts index ac7c02704..06e0f5cee 100644 --- a/web/api/member.ts +++ b/web/api/member.ts @@ -5,27 +5,27 @@ export function getMemberInfo() { /** * 会员信息修改 */ -export function updateMember(data : AnyObject) { +export function modifyMember(data: AnyObject) { return request.put(`member/modify/${data.field}`, data, { showErrorMessage: true }) } /** * 获取积分流水 */ -export function getPointList(data : AnyObject) { +export function getPointList(data: AnyObject) { return request.get('member/account/point', data) } /** * 获取余额流水 */ -export function getBalanceList(data : AnyObject) { +export function getBalanceList(data: AnyObject) { return request.get('member/account/balance', data) } /** * 登录会员绑定手机号 */ -export function bindMobile(data : AnyObject) { +export function bindMobile(data: AnyObject) { return request.put('member/mobile', data, { showErrorMessage: true }) } \ No newline at end of file diff --git a/web/api/system.ts b/web/api/system.ts index 0f544abc5..3c1d2c0b9 100644 --- a/web/api/system.ts +++ b/web/api/system.ts @@ -47,13 +47,6 @@ export function getWechatSkdConfig(data: AnyObject) { return request.get('wechat/jssdkconfig', data) } -/** - * 上传图片 - */ -export function uploadImage(data: AnyObject) { - return request.upload('file/image', data, { showErrorMessage: true }) -} - /** * 拉取图片 */ diff --git a/web/app.vue b/web/app.vue index a8dab3971..82729e23b 100644 --- a/web/app.vue +++ b/web/app.vue @@ -18,6 +18,12 @@ import useMemberStore from '@/stores/member' // 引入全局样式 import '@/assets/styles/index.scss' +if (process.client) { + const match = location.href.match(/\/s(\d*)\//) + const cookie = useCookie('siteId') + match ? cookie.value = match[1] : cookie.value = null +} + // 初始化设置语言 const systemStore = useSystemStore() const locale = computed(() => (systemStore.lang === 'zh-cn' ? zhCn : en)) @@ -37,8 +43,10 @@ watch(route, (nval, oval) => { // 设置页面title let path = route.path == '/' ? '/index' : route.path + // 处理部署后不知道为什么url会自动拼接上 / 的问题 + if (path.slice(-1) == '/') path = path.slice(0, -1) path = !path.lastIndexOf('/') ? `${path}/index` : path - const key = path.replace('/', '').replaceAll('/', '.') + let key = path.replace('/', '').replaceAll('/', '.') setTimeout(() => { useHead({ diff --git a/web/assets/images/index_carousel.png b/web/assets/images/index_carousel.png index 034ad88bb..38515e1f2 100644 Binary files a/web/assets/images/index_carousel.png and b/web/assets/images/index_carousel.png differ diff --git a/web/components/sms-code/index.vue b/web/components/sms-code/index.vue index 3e9a4aefe..f958eeacc 100644 --- a/web/components/sms-code/index.vue +++ b/web/components/sms-code/index.vue @@ -73,6 +73,7 @@ captcha.refresh() const sendSms = useSendSms() const send = () => { + formData.mobile = prop.mobile if (sendSms.canGetCode.value) { captchaDialog.value = true } @@ -87,8 +88,10 @@ const confirm = async () => { if (sendRes) { value.value = sendRes captchaDialog.value = false + loading.value = false } else if (sendRes === false) { captcha.refresh() + loading.value = false } } }) diff --git a/web/composables/useLang.ts b/web/composables/useLang.ts index d7a0f5ac4..8faf483ad 100644 --- a/web/composables/useLang.ts +++ b/web/composables/useLang.ts @@ -2,7 +2,9 @@ import useAppStore from '~/stores/app' export function t(message: string) { const i18n = useNuxtApp().$getI18n() - const path = useAppStore().route + let path = useAppStore().route + // 处理部署后不知道为什么url会自动拼接上 / 的问题 + if (path != '/' && path.slice(-1) == '/') path = path.slice(0, -1) const file = path == '/' ? 'index' : path.replace('/', '').replaceAll('/', '.') const key = `${file}.${message}` return i18n.global.t(key) != key ? i18n.global.t(key) : i18n.global.t(message) diff --git a/web/lang/zh-cn/article.detail.json b/web/lang/zh-cn/article.detail.json new file mode 100644 index 000000000..96fc010c4 --- /dev/null +++ b/web/lang/zh-cn/article.detail.json @@ -0,0 +1,3 @@ +{ + "title": "文章" +} \ No newline at end of file diff --git a/web/lang/zh-cn/article.list.json b/web/lang/zh-cn/article.list.json new file mode 100644 index 000000000..96fc010c4 --- /dev/null +++ b/web/lang/zh-cn/article.list.json @@ -0,0 +1,3 @@ +{ + "title": "文章" +} \ No newline at end of file diff --git a/web/lang/zh-cn/auth.login.json b/web/lang/zh-cn/auth.login.json new file mode 100644 index 000000000..7c3ae2482 --- /dev/null +++ b/web/lang/zh-cn/auth.login.json @@ -0,0 +1,13 @@ +{ + "logining": "登录中", + "usernamePlaceholder": "请输入账号", + "passwordPlaceholder": "请输入密码", + "resetpwd": "忘记密码", + "noAccount": "还没有账号", + "toRegister": "去注册", + "and": "和", + "agreeTips": "登录代表您同意", + "usernameLogin": "密码登录", + "mobileLogin": "验证码登录", + "mobilePlaceholder": "请输入手机号" +} \ No newline at end of file diff --git a/web/lang/zh-cn/pages.json b/web/lang/zh-cn/pages.json index 01a5cfd3d..bc017438c 100644 --- a/web/lang/zh-cn/pages.json +++ b/web/lang/zh-cn/pages.json @@ -11,6 +11,10 @@ "member": { "index": "欢迎页", "center": "个人中心" - } + }, + "article": { + "list": "文章", + "detail": "文章" + } } } \ No newline at end of file diff --git a/web/layouts/components/header/index.vue b/web/layouts/components/header/index.vue index 77070187b..206e4764e 100644 --- a/web/layouts/components/header/index.vue +++ b/web/layouts/components/header/index.vue @@ -1,13 +1,13 @@