Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
7012759
feat: Add login page and user auth (#90)
qiyue2015 Apr 25, 2024
d625793
chore: Merge branch 'main' into v3
cwandev Jun 1, 2024
d8b8771
refactor: Use SFC `<route>` block for routes (#102)
cwandev Jun 3, 2024
014b5b7
Merge branch 'main' into v3
cwandev Jun 6, 2024
3fa02b0
chore: Merge branch 'main' into v3
cwandev Jun 12, 2024
a61765c
chore: Merge branch 'main' into v3
cwandev Jun 17, 2024
d79d4eb
Merge branch 'main' into v3
cwandev Jun 17, 2024
5ccb863
refactor: Remove transition animations (#103)
cwandev Jun 18, 2024
01ad535
Merge branch 'main' into v3
cwandev Jun 24, 2024
f89b4d6
Merge branch 'main' into v3
cwandev Jun 29, 2024
f1a3895
style: enhance homepage display
cwandev Jun 29, 2024
78bedd3
refactor: Simplify Tabbar visibility with whitelist (#103)
cwandev Jul 1, 2024
986aede
refactor: Remove store.js and use localStorage instead (#109)
cwandev Jul 1, 2024
8204597
chore: Remove pnpm deprecated warnings
cwandev Jul 1, 2024
62b2085
Merge branch 'main' into v3
cwandev Jul 20, 2024
e2bc895
Merge branch 'main' into v3
cwandev Jul 22, 2024
7de7f07
chore: upgrade unplugin-auto-import to 0.18.1
cwandev Jul 24, 2024
7c87e54
chore: fix types
cwandev Jul 24, 2024
4bf7e44
dx: remove common-intellisense
cwandev Jul 24, 2024
d64d86b
chore: fix eslint
cwandev Jul 25, 2024
660113d
chore: merge code
cwandev Aug 8, 2024
616b8da
chore: add goto-alias
cwandev Aug 8, 2024
000dddc
chore: add some `i18` field
ljt990218 Aug 16, 2024
dc601d1
refactor: Remove Container component, apply padding in app.vue
cwandev Aug 18, 2024
4bcdd0f
chore: merge code
cwandev Aug 18, 2024
f3209cd
chore: remove unused file references
cwandev Aug 18, 2024
5e4f817
Merge branch 'main' into v3
cwandev Aug 24, 2024
3bc26f8
refactor: update user center page (#110)
cwandev Aug 24, 2024
9ff2ce2
feat: Add settings page (#121)
cwandev Aug 26, 2024
151aa3b
chore: Update .npmrc
cwandev Aug 26, 2024
0badda2
chore: Update vscode settings
cwandev Aug 26, 2024
2cb9ce6
feat: Use vant's own auto-import resolver
cwandev Aug 26, 2024
44dff2b
chore: Update login page with logo (#89)
cwandev Aug 29, 2024
f9f2025
chore: merge code
cwandev Aug 29, 2024
00a26a2
Merge branch 'main' into v3
cwandev Sep 2, 2024
03c6045
refactor: login page (#89)
cwandev Sep 12, 2024
b4061d9
refactor: Move type files to src/types (#126)
cwandev Sep 12, 2024
1334b0b
wip: Add forgot-password (#123)
cwandev Sep 14, 2024
bc51ede
feat: Add get verification code (#123)
cwandev Sep 18, 2024
a290664
feat: Add reset password (#123)
cwandev Sep 19, 2024
d07894c
feat: Add user register page (#122)
cwandev Sep 20, 2024
46ac00b
chore: update deps
cwandev Sep 20, 2024
a1dca43
chore: Add vant notify style in optimizeDeps
cwandev Sep 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ members of the project's leadership.
## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
<https://www.contributor-covenant.org/faq>
2 changes: 0 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
shamefully-hoist=true
strict-peer-dependencies=false
package-manager-strict=false
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"recommendations": [
"Vue.volar",
"antfu.unocss",
"simonhe.common-intellisense",
"antfu.goto-alias",
"lokalise.i18n-ally",
"antfu.iconify"
]
Expand Down
31 changes: 12 additions & 19 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
{
// Enable the ESlint flat config support
"eslint.useFlatConfig": true,

// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
{ "rule": "style/*", "severity": "off", "fixable": true },
{ "rule": "format/*", "severity": "off", "fixable": true },
{ "rule": "*-indent", "severity": "off", "fixable": true },
{ "rule": "*-spacing", "severity": "off", "fixable": true },
{ "rule": "*-spaces", "severity": "off", "fixable": true },
{ "rule": "*-order", "severity": "off", "fixable": true },
{ "rule": "*-dangle", "severity": "off", "fixable": true },
{ "rule": "*-newline", "severity": "off", "fixable": true },
{ "rule": "*quotes", "severity": "off", "fixable": true },
{ "rule": "*semi", "severity": "off", "fixable": true }
],

// Enable eslint for all supported languages
Expand All @@ -42,19 +40,14 @@
"gql",
"graphql",
"astro",
"svelte",
"css",
"less",
"scss",
"pcss",
"postcss"
],

// Specify the UI library you need to prompt
"common-intellisense.showSlots": false,
"common-intellisense.ui": [
"vant4"
],

// Configuration of i18n i18n-ally
"i18n-ally.enabledParsers": ["json"],
"i18n-ally.displayLanguage": "zh-CN",
Expand Down
9 changes: 5 additions & 4 deletions build/vite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import legacy from '@vitejs/plugin-legacy'
import vue from '@vitejs/plugin-vue'
import UnoCSS from 'unocss/vite'
import AutoImport from 'unplugin-auto-import/vite'
import { VantResolver } from 'unplugin-vue-components/resolvers'
import { VantResolver } from '@vant/auto-import-resolver'
import Components from 'unplugin-vue-components/vite'
import { VueRouterAutoImports } from 'unplugin-vue-router'
import VueRouter from 'unplugin-vue-router/vite'
Expand All @@ -22,7 +22,7 @@ export function createVitePlugins() {
VueRouter({
extensions: ['.vue'],
routesFolder: 'src/pages',
dts: 'src/typed-router.d.ts',
dts: 'src/types/typed-router.d.ts',
}),

vue(),
Expand All @@ -38,7 +38,7 @@ export function createVitePlugins() {
extensions: ['vue'],
resolvers: [VantResolver()],
include: [/\.vue$/, /\.vue\?vue/],
dts: 'src/components.d.ts',
dts: 'src/types/components.d.ts',
}),

// https://github.com/antfu/unplugin-auto-import
Expand All @@ -60,10 +60,11 @@ export function createVitePlugins() {
},
unheadVueComposablesImports,
],
dts: 'src/auto-imports.d.ts',
dts: 'src/types/auto-imports.d.ts',
dirs: [
'src/composables',
],
resolvers: [VantResolver()],
}),

// https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n
Expand Down
6 changes: 4 additions & 2 deletions build/vite/optimize.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
const include = [
'axios',
'store',
'echarts',
'lodash-es',
'resize-detector',
'store/plugins/expire',
'vant/es/cell-group/style/index',
'vant/es/popup/style/index',
'vant/es/picker/style/index',
Expand All @@ -15,6 +13,10 @@ const include = [
'vant/es/empty/style/index',
'vant/es/icon/style/index',
'vant/es/stepper/style/index',
'vant/es/image/style/index',
'vant/es/form/style/index',
'vant/es/field/style/index',
'vant/es/notify/style/index',
]

const exclude = [
Expand Down
38 changes: 26 additions & 12 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
import antfu from '@antfu/eslint-config'

export default antfu({
// enable UnoCSS support
// https://unocss.dev/integrations/vscode
unocss: true,
export default antfu(
{
vue: true,
typescript: true,

formatters: {
css: true,
},
// enable UnoCSS support
// https://unocss.dev/integrations/vscode
unocss: true,

formatters: {
css: true,
},

ignores: [
'.github/**',
'scripts/**',
],
})
},
{
rules: {
'perfectionist/sort-imports': 'off',
'perfectionist/sort-exports': 'off',
'perfectionist/sort-named-exports': 'off',
},
},
{
ignores: [
'.github/**',
'scripts/**',
],
},
)
2 changes: 2 additions & 0 deletions mock/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import prose from './modules/prose.mock'
import user from './modules/user.mock'

export default {
...prose,
...user,
}
67 changes: 67 additions & 0 deletions mock/modules/user.mock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { defineMock } from 'vite-plugin-mock-dev-server'
import { builder } from '../util'

export default defineMock([
{
url: '/api/auth/login',
delay: 500,
body: () => {
return {
code: 0,
data: {
token: 'admin',
},
msg: 'success',
}
},
},
{
url: '/api/user/me',
delay: 100,
body: () => {
return {
code: 0,
data: {
uid: 1,
name: 'admin',
avatar: 'https://iconfont.alicdn.com/p/user/eZQFvSX6g8f1/f0d9fd95-a5f0-474d-98b0-d51e8450f2cf.png',
},
msg: 'success',
}
},
},
{
url: '/api/user/logout',
delay: 500,
body: () => {
return {
code: 0,
msg: 'success',
}
},
},
{
url: '/api/user/email-code',
delay: 1000,
body: () => {
const code = '123456'
return builder(code)
},
},
{
url: '/api/user/reset-password',
delay: 1000,
body: () => {
const res = true
return builder(res)
},
},
{
url: '/api/user/register',
delay: 1000,
body: () => {
const res = true
return builder(res)
},
},
])
67 changes: 33 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vue3-vant-mobile",
"type": "module",
"version": "2.3.11",
"packageManager": "pnpm@9.7.0",
"packageManager": "pnpm@9.10.0",
"description": "Vue + Vite H5 Starter Template",
"license": "MIT",
"scripts": {
Expand All @@ -17,61 +17,60 @@
"prepare": "husky"
},
"dependencies": {
"@unhead/vue": "^1.9.16",
"@unhead/vue": "^1.11.6",
"@vant/touch-emulator": "^1.4.0",
"@vant/use": "^1.6.0",
"@vueuse/core": "^11.0.0",
"axios": "^1.7.4",
"@vueuse/core": "^11.1.0",
"axios": "^1.7.7",
"echarts": "^5.5.1",
"lodash-es": "^4.17.21",
"nprogress": "^0.2.0",
"pinia": "^2.2.2",
"pinia-plugin-persistedstate": "^3.2.1",
"pinia-plugin-persistedstate": "^4.0.2",
"resize-detector": "^0.3.0",
"store": "^2.0.12",
"vant": "^4.9.4",
"vant": "^4.9.6",
"vconsole": "^3.15.1",
"vue": "^3.4.38",
"vue-i18n": "^9.13.1",
"vue-router": "^4.4.3"
"vue": "^3.5.6",
"vue-i18n": "^10.0.1",
"vue-router": "^4.4.5"
},
"devDependencies": {
"@antfu/eslint-config": "2.26.0",
"@iconify-json/carbon": "^1.1.37",
"@intlify/unplugin-vue-i18n": "^4.0.0",
"@antfu/eslint-config": "3.6.2",
"@iconify-json/carbon": "^1.2.1",
"@intlify/unplugin-vue-i18n": "^5.0.0",
"@types/lodash-es": "^4.17.12",
"@types/node": "^22.4.0",
"@types/node": "^22.5.5",
"@types/nprogress": "^0.2.3",
"@types/store": "^2.0.5",
"@unocss/eslint-plugin": "0.62.2",
"@unocss/preset-rem-to-px": "0.62.2",
"@unocss/eslint-plugin": "0.62.4",
"@unocss/preset-rem-to-px": "0.62.4",
"@vant/auto-import-resolver": "^1.2.1",
"@vitejs/plugin-legacy": "^5.4.2",
"@vitejs/plugin-vue": "^5.1.2",
"@vitejs/plugin-vue": "^5.1.4",
"autoprefixer": "^10.4.20",
"bumpp": "^9.5.1",
"bumpp": "^9.5.2",
"consola": "^3.2.3",
"cross-env": "^7.0.3",
"eslint": "^9.9.0",
"eslint": "^9.10.0",
"eslint-plugin-format": "^0.1.2",
"husky": "^9.1.4",
"husky": "^9.1.6",
"less": "^4.2.0",
"mockjs": "^1.1.0",
"postcss-mobile-forever": "^4.1.5",
"rollup": "^4.21.0",
"terser": "^5.31.6",
"typescript": "^5.5.4",
"unocss": "0.62.2",
"unplugin-auto-import": "^0.18.2",
"postcss-mobile-forever": "^4.1.6",
"rollup": "^4.22.0",
"terser": "^5.33.0",
"typescript": "^5.6.2",
"unocss": "0.62.4",
"unplugin-auto-import": "^0.18.3",
"unplugin-vue-components": "^0.27.4",
"unplugin-vue-router": "^0.10.7",
"vite": "^5.4.1",
"vite-plugin-mock-dev-server": "^1.7.1",
"vite-plugin-pwa": "^0.20.1",
"unplugin-vue-router": "^0.10.8",
"vite": "^5.4.6",
"vite-plugin-mock-dev-server": "^1.7.2",
"vite-plugin-pwa": "^0.20.5",
"vite-plugin-sitemap": "^0.7.1",
"vite-plugin-vconsole": "^2.1.1",
"vite-plugin-vue-devtools": "^7.3.8",
"vitest": "^2.0.5",
"vue-tsc": "^2.0.29"
"vite-plugin-vue-devtools": "^7.4.5",
"vitest": "^2.1.1",
"vue-tsc": "^2.1.6"
},
"pnpm": {
"peerDependencyRules": {
Expand Down
Loading