From b3c9b0662a8c0e3702869724c145aa966ec0ddab Mon Sep 17 00:00:00 2001 From: ch Date: Thu, 5 May 2022 15:38:53 +0800 Subject: [PATCH] create project --- .babelrc | 16 +++ .editorconfig | 13 ++ .gitignore | 92 ++++++++++++ README.md | 97 +++++-------- assets/scss/global.scss | 34 +++++ components/BsHeader.vue | 18 +++ components/UiMoney.vue | 18 +++ env.config.js | 45 ++++++ jest.config.js | 22 +++ layouts/default.vue | 17 +++ nuxt.config.js | 80 +++++++++++ package.json | 35 +++++ pages/account/address.vue | 23 +++ pages/account/home/index.vue | 23 +++ pages/account/home/module/LogisitcsInfo.vue | 23 +++ pages/account/home/module/Message.vue | 23 +++ pages/account/message.vue | 23 +++ pages/account/userInfo.vue | 23 +++ pages/cart/index.vue | 22 +++ pages/goods/detail/_id.vue | 23 +++ pages/goods/list/index.vue | 23 +++ pages/index/index.vue | 49 +++++++ pages/index/module/Banner.vue | 24 ++++ pages/index/module/Seckill.vue | 24 ++++ pages/order/list/index.vue | 32 +++++ pages/order/saleAfter/detail.vue | 0 pages/order/saleAfter/list.vue | 0 pages/order/submit/index.vue | 23 +++ pages/order/submit/module/Address.vue | 22 +++ pages/order/submit/module/OrderInfo.vue | 23 +++ pages/sckill/index.vue | 22 +++ plugins/api/account.js | 37 +++++ plugins/api/base.js | 32 +++++ plugins/api/cart.js | 36 +++++ plugins/api/goods.js | 55 +++++++ plugins/api/order.js | 151 ++++++++++++++++++++ plugins/api/oss.js | 15 ++ plugins/api/seckill.js | 26 ++++ plugins/axios.js | 31 ++++ plugins/axiosTk.js | 22 +++ plugins/config/localKey.js | 9 ++ plugins/element-ui.js | 5 + plugins/env.js | 1 + plugins/storeStorage.js | 14 ++ plugins/utils/index.js | 13 ++ plugins/utils/other.js | 53 +++++++ static/favicon.ico | Bin 0 -> 8636 bytes store/README.md | 10 ++ store/index.js | 20 +++ test/NuxtLogo.spec.js | 9 ++ 50 files changed, 1391 insertions(+), 60 deletions(-) create mode 100644 .babelrc create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 assets/scss/global.scss create mode 100644 components/BsHeader.vue create mode 100644 components/UiMoney.vue create mode 100644 env.config.js create mode 100644 jest.config.js create mode 100644 layouts/default.vue create mode 100644 nuxt.config.js create mode 100644 package.json create mode 100644 pages/account/address.vue create mode 100644 pages/account/home/index.vue create mode 100644 pages/account/home/module/LogisitcsInfo.vue create mode 100644 pages/account/home/module/Message.vue create mode 100644 pages/account/message.vue create mode 100644 pages/account/userInfo.vue create mode 100644 pages/cart/index.vue create mode 100644 pages/goods/detail/_id.vue create mode 100644 pages/goods/list/index.vue create mode 100644 pages/index/index.vue create mode 100644 pages/index/module/Banner.vue create mode 100644 pages/index/module/Seckill.vue create mode 100644 pages/order/list/index.vue create mode 100644 pages/order/saleAfter/detail.vue create mode 100644 pages/order/saleAfter/list.vue create mode 100644 pages/order/submit/index.vue create mode 100644 pages/order/submit/module/Address.vue create mode 100644 pages/order/submit/module/OrderInfo.vue create mode 100644 pages/sckill/index.vue create mode 100644 plugins/api/account.js create mode 100644 plugins/api/base.js create mode 100644 plugins/api/cart.js create mode 100644 plugins/api/goods.js create mode 100644 plugins/api/order.js create mode 100644 plugins/api/oss.js create mode 100644 plugins/api/seckill.js create mode 100644 plugins/axios.js create mode 100644 plugins/axiosTk.js create mode 100644 plugins/config/localKey.js create mode 100644 plugins/element-ui.js create mode 100644 plugins/env.js create mode 100644 plugins/storeStorage.js create mode 100644 plugins/utils/index.js create mode 100644 plugins/utils/other.js create mode 100644 static/favicon.ico create mode 100644 store/README.md create mode 100644 store/index.js create mode 100644 test/NuxtLogo.spec.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..84c2e57 --- /dev/null +++ b/.babelrc @@ -0,0 +1,16 @@ +{ + "env": { + "test": { + "presets": [ + [ + "@babel/preset-env", + { + "targets": { + "node": "current" + } + } + ] + ] + } + } +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5d12634 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..48d2ca2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,92 @@ +# Created by .ignore support plugin (hsz.mobi) +### Node template +# Logs +/logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +.history/ + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# Nuxt generate +dist + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless + +# IDE / Editor +.idea + +# Service worker +sw.* + +# macOS +.DS_Store + +# Vim swap files +*.swp diff --git a/README.md b/README.md index 0e06634..557a022 100644 --- a/README.md +++ b/README.md @@ -1,92 +1,69 @@ # shop-pc -马士兵严选pc +## Build Setup -## Getting started +```bash +# install dependencies +$ npm install -To make it easy for you to get started with GitLab, here's a list of recommended next steps. +# serve with hot reload at localhost:3000 +$ npm run dev -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: +# build for production and launch server +$ npm run build +$ npm run start +# generate static project +$ npm run generate ``` -cd existing_repo -git remote add origin http://internel-git.mashibing.cn/yanxuan-frontend/shop-pc.git -git branch -M main -git push -uf origin main -``` -## Integrate with your tools +For detailed explanation on how things work, check out the [documentation](https://nuxtjs.org). + +## Special Directories -- [ ] [Set up project integrations](http://internel-git.mashibing.cn/yanxuan-frontend/shop-pc/-/settings/integrations) +You can create the following extra directories, some of which have special behaviors. Only `pages` is required; you can delete them if you don't want to use their functionality. -## Collaborate with your team +### `assets` -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) +The assets directory contains your uncompiled assets such as Stylus or Sass files, images, or fonts. -## Test and Deploy +More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/assets). -Use the built-in continuous integration in GitLab. +### `components` -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) +The components directory contains your Vue.js components. Components make up the different parts of your page and can be reused and imported into your pages, layouts and even other components. -*** +More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/components). -# Editing this README +### `layouts` -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. +Layouts are a great help when you want to change the look and feel of your Nuxt app, whether you want to include a sidebar or have distinct layouts for mobile and desktop. -## Suggestions for a good README -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. +More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/layouts). -## Name -Choose a self-explaining name for your project. -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. +### `pages` -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. +This directory contains your application views and routes. Nuxt will read all the `*.vue` files inside this directory and setup Vue Router automatically. -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. +More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/get-started/routing). -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. +### `plugins` -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. +The plugins directory contains JavaScript plugins that you want to run before instantiating the root Vue.js Application. This is the place to add Vue plugins and to inject functions or constants. Every time you need to use `Vue.use()`, you should create a file in `plugins/` and add its path to plugins in `nuxt.config.js`. -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. +More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/plugins). -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. +### `static` -## Contributing -State if you are open to contributions and what your requirements are for accepting them. +This directory contains your static files. Each file inside this directory is mapped to `/`. -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. +Example: `/static/robots.txt` is mapped as `/robots.txt`. -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. +More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/static). -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. +### `store` -## License -For open source projects, say how it is licensed. +This directory contains your Vuex store files. Creating a file in this directory automatically activates Vuex. -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/store). diff --git a/assets/scss/global.scss b/assets/scss/global.scss new file mode 100644 index 0000000..3b8e20e --- /dev/null +++ b/assets/scss/global.scss @@ -0,0 +1,34 @@ + +* { + -webkit-box-sizing: border-box; box-sizing: border-box; + + -webkit-touch-callout:none; /*系统默认菜单被禁用*/ + -webkit-user-select:none; /*webkit浏览器*/ + -khtml-user-select:none; /*早期浏览器*/ + -moz-user-select:none;/*火狐*/ + -ms-user-select:none; /*IE10*/ + user-select:none; + &:after, &:before { + @extend *; + } +} +body, dl, dd, h1, h2, h3, h4, h5, p, figure, form, ul, ol { margin: 0; font-size: .16rem;} +ul, ol, input, button { padding: 0;} +ul, ol, li { list-style: none;list-style-type: none} +h1, h2, h3, h4, h5 { font-size: 100%;} +input { border: 0; margin: 0;} +img { width: 100%;} +a, button, input, optgroup, select, textarea, img { outline:none; -webkit-tap-highlight-color: rgba(0,0,0,0); } +a, img { -webkit-touch-callout: none; border: 0;} +html, body { position: absolute; min-height: 100%; height: 100%; width: 100%;} +input, textarea, img, button { vertical-align: middle; outline: none;} +body { + font-family: PingFang SC, Microsoft YaHei, Helvetica, STHeiTi, sans-serif !important; + color: #333; -webkit-font-smoothing: antialiased; font-smoothing: antialiased; + overflow-anchor: none} +table {border-collapse: collapse; border-spacing: 0; + color: #333;} +a { text-decoration:none; + color: #333; + &:hover { text-decoration:none;} +} diff --git a/components/BsHeader.vue b/components/BsHeader.vue new file mode 100644 index 0000000..85c89f8 --- /dev/null +++ b/components/BsHeader.vue @@ -0,0 +1,18 @@ + + + + \ No newline at end of file diff --git a/components/UiMoney.vue b/components/UiMoney.vue new file mode 100644 index 0000000..75d22c9 --- /dev/null +++ b/components/UiMoney.vue @@ -0,0 +1,18 @@ + + + + \ No newline at end of file diff --git a/env.config.js b/env.config.js new file mode 100644 index 0000000..553dd99 --- /dev/null +++ b/env.config.js @@ -0,0 +1,45 @@ +/* + * @Author: ch + * @Date: 2022-05-05 14:40:00 + * @LastEditors: ch + * @LastEditTime: 2022-05-05 15:32:20 + * @Description: 根据git分支生成对应环境的环境变量 + */ +const fs = require('fs'); +const path = require('path'); +const getRepoInfo = require('git-repo-info'); + +const envConfig = { + dev : { + + }, + test : { + base_url: 'xxx' + }, + reslese : { + + }, + prod : { + + } +} +const branch = getRepoInfo().branch; // 调用获取git信息 +const argv = global.process.argv; +let curEnvConfig = {}; +switch (branch){ + case 'msb_test': + curEnvConfig = envConfig.test; + break; + case 'msb_beta': + curEnvConfig = envConfig.release; + break; + case 'msb_prod': + curEnvConfig = envConfig.prod; + break; + default: + curEnvConfig = envConfig.dev; + break; + +} +let codeStr = `const ENV = ${JSON.stringify(curEnvConfig)}; export default ENV;`; +fs.writeFileSync(`${path.resolve(__dirname, './plugins')}/env.js`, codeStr); diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..8706530 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,22 @@ +module.exports = { + moduleNameMapper: { + '^@/(.*)$': '/$1', + '^~/(.*)$': '/$1', + '^vue$': 'vue/dist/vue.common.js' + }, + moduleFileExtensions: [ + 'js', + 'vue', + 'json' + ], + transform: { + '^.+\\.js$': 'babel-jest', + '.*\\.(vue)$': 'vue-jest' + }, + collectCoverage: true, + collectCoverageFrom: [ + '/components/**/*.vue', + '/pages/**/*.vue' + ], + testEnvironment: 'jsdom' +} diff --git a/layouts/default.vue b/layouts/default.vue new file mode 100644 index 0000000..37701a0 --- /dev/null +++ b/layouts/default.vue @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/nuxt.config.js b/nuxt.config.js new file mode 100644 index 0000000..f9e74da --- /dev/null +++ b/nuxt.config.js @@ -0,0 +1,80 @@ +/* + * @Author: ch + * @Date: 2022-05-03 22:14:16 + * @LastEditors: ch + * @LastEditTime: 2022-05-04 22:58:00 + * @Description: file content + */ +export default { + // Global page headers: https://go.nuxtjs.dev/config-head + head: { + title: 'shop-pc', + htmlAttrs: { + lang: 'en' + }, + meta: [ + { charset: 'utf-8' }, + { name: 'viewport', content: 'width=device-width, initial-scale=1' }, + { hid: 'description', name: 'description', content: '' }, + { name: 'format-detection', content: 'telephone=no' } + ], + link: [ + { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } + ] + }, + router: { + extendRoutes(routes, resolve) { + routes.push({ + name: 'custom', + path: '/', + component: resolve(__dirname, 'pages/index/index.vue') + }) + } + }, + + // Global CSS: https://go.nuxtjs.dev/config-css + css: [ + '@assets/scss/global.scss', + 'element-ui/lib/theme-chalk/index.css' + ], + + // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins + plugins: [ + '@/plugins/element-ui', + '@/plugins/axios', + { src: '@plugins/axiosTk.js', ssr: false }, + { src: '@plugins/storeStorage.js', ssr: false }, + ], + + // Auto import components: https://go.nuxtjs.dev/config-components + components: true, + + // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules + buildModules: [ + ], + + // Modules: https://go.nuxtjs.dev/config-modules + modules: [ + '@nuxtjs/axios', + 'cookie-universal-nuxt', + ['cookie-universal-nuxt', { alias: 'cookiz' }], + ], + + // Build Configuration: https://go.nuxtjs.dev/config-build + build: { + transpile: [/^element-ui/], + }, + axios: { + // 表示开启代理 + proxy: true, + }, + proxy: { + '/mall/': { + // target: 'http://114.55.64.39:3004', // 目标接口域名 + target: 'https://you-gateway.mashibing.com/', // 目标接口域名 + pathRewrite: { + changeOrigin: true, // 表示是否跨域 + }, + }, + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..04c9885 --- /dev/null +++ b/package.json @@ -0,0 +1,35 @@ +{ + "name": "shop-pc", + "version": "1.0.0", + "private": true, + "scripts": { + "dev": "nuxt", + "build": "nuxt build", + "start": "nuxt start", + "generate": "nuxt generate", + "test": "jest" + }, + "dependencies": { + "@nuxtjs/axios": "^5.13.6", + "cookie-universal-nuxt": "^2.1.5", + "core-js": "^3.19.3", + "element-ui": "^2.15.6", + "js-util-all": "^1.0.6", + "node-sass": "^4.14.1", + "nuxt": "^2.15.8", + "sass": "^1.32.13", + "sass-loader": "^7.3.1", + "vue": "^2.6.14", + "vue-server-renderer": "^2.6.14", + "vue-template-compiler": "^2.6.14", + "webpack": "^4.46.0" + }, + "devDependencies": { + "@vue/test-utils": "^1.3.0", + "babel-core": "7.0.0-bridge.0", + "babel-jest": "^27.4.4", + "git-repo-info": "^2.1.1", + "jest": "^27.4.4", + "vue-jest": "^3.0.4" + } +} diff --git a/pages/account/address.vue b/pages/account/address.vue new file mode 100644 index 0000000..a0b2d29 --- /dev/null +++ b/pages/account/address.vue @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/pages/account/home/index.vue b/pages/account/home/index.vue new file mode 100644 index 0000000..f867020 --- /dev/null +++ b/pages/account/home/index.vue @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/pages/account/home/module/LogisitcsInfo.vue b/pages/account/home/module/LogisitcsInfo.vue new file mode 100644 index 0000000..2ecbfa7 --- /dev/null +++ b/pages/account/home/module/LogisitcsInfo.vue @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/pages/account/home/module/Message.vue b/pages/account/home/module/Message.vue new file mode 100644 index 0000000..e42c46a --- /dev/null +++ b/pages/account/home/module/Message.vue @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/pages/account/message.vue b/pages/account/message.vue new file mode 100644 index 0000000..4dc0aea --- /dev/null +++ b/pages/account/message.vue @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/pages/account/userInfo.vue b/pages/account/userInfo.vue new file mode 100644 index 0000000..5f232bf --- /dev/null +++ b/pages/account/userInfo.vue @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/pages/cart/index.vue b/pages/cart/index.vue new file mode 100644 index 0000000..3ddeb1b --- /dev/null +++ b/pages/cart/index.vue @@ -0,0 +1,22 @@ + + + + \ No newline at end of file diff --git a/pages/goods/detail/_id.vue b/pages/goods/detail/_id.vue new file mode 100644 index 0000000..4c82df9 --- /dev/null +++ b/pages/goods/detail/_id.vue @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/pages/goods/list/index.vue b/pages/goods/list/index.vue new file mode 100644 index 0000000..c930b79 --- /dev/null +++ b/pages/goods/list/index.vue @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue new file mode 100644 index 0000000..f3fd609 --- /dev/null +++ b/pages/index/index.vue @@ -0,0 +1,49 @@ + + + + diff --git a/pages/index/module/Banner.vue b/pages/index/module/Banner.vue new file mode 100644 index 0000000..d88150c --- /dev/null +++ b/pages/index/module/Banner.vue @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/pages/index/module/Seckill.vue b/pages/index/module/Seckill.vue new file mode 100644 index 0000000..3c85476 --- /dev/null +++ b/pages/index/module/Seckill.vue @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/pages/order/list/index.vue b/pages/order/list/index.vue new file mode 100644 index 0000000..5f0a200 --- /dev/null +++ b/pages/order/list/index.vue @@ -0,0 +1,32 @@ + + + \ No newline at end of file diff --git a/pages/order/saleAfter/detail.vue b/pages/order/saleAfter/detail.vue new file mode 100644 index 0000000..e69de29 diff --git a/pages/order/saleAfter/list.vue b/pages/order/saleAfter/list.vue new file mode 100644 index 0000000..e69de29 diff --git a/pages/order/submit/index.vue b/pages/order/submit/index.vue new file mode 100644 index 0000000..cc35f91 --- /dev/null +++ b/pages/order/submit/index.vue @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/pages/order/submit/module/Address.vue b/pages/order/submit/module/Address.vue new file mode 100644 index 0000000..0a8d2a8 --- /dev/null +++ b/pages/order/submit/module/Address.vue @@ -0,0 +1,22 @@ + + + + \ No newline at end of file diff --git a/pages/order/submit/module/OrderInfo.vue b/pages/order/submit/module/OrderInfo.vue new file mode 100644 index 0000000..3ed4bdc --- /dev/null +++ b/pages/order/submit/module/OrderInfo.vue @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/pages/sckill/index.vue b/pages/sckill/index.vue new file mode 100644 index 0000000..65e42e8 --- /dev/null +++ b/pages/sckill/index.vue @@ -0,0 +1,22 @@ + + + + \ No newline at end of file diff --git a/plugins/api/account.js b/plugins/api/account.js new file mode 100644 index 0000000..47cbd85 --- /dev/null +++ b/plugins/api/account.js @@ -0,0 +1,37 @@ +/* + * @Author: ch + * @Date: 2022-05-04 18:24:03 + * @LastEditors: ch + * @LastEditTime: 2022-05-04 22:43:19 + * @Description: file content + */ +import {axiosTk} from "../axiosTk"; +import {axios} from "../axios"; +import { ToAsyncAwait } from "../utils"; + +const BASE_URL = '/uc'; +/** + * 获取当前登录用户信息 + */ +export const ApiGetCurrentUser = () => + ToAsyncAwait(axiosTk.get(`${BASE_URL}/user/current`)); + +/** + * 修改用户信息 + * @param {*} data + */ +export const ApiPutUser = (data) => + ToAsyncAwait(axiosTk.put(`${BASE_URL}/user/`, data)); + + +/** + * 登录 + * @param {*} data + */ +export const ApiPostLogin = (data) => ToAsyncAwait(axios.post(`${BASE_URL}/user/login`, data)); +/** + * 获取手机验证码 + * @param {*} params + */ +export const ApiGetCode = (params) => ToAsyncAwait(axios.get(`${BASE_URL}/user/login/verificationCode`, params)); + diff --git a/plugins/api/base.js b/plugins/api/base.js new file mode 100644 index 0000000..651e7d4 --- /dev/null +++ b/plugins/api/base.js @@ -0,0 +1,32 @@ +/* + * @Author: ch + * @Date: 2022-05-04 18:24:03 + * @LastEditors: ch + * @LastEditTime: 2022-05-04 22:42:08 + * @Description: file content + */ +import {axiosTk} from "../axiosTk"; +import { ToAsyncAwait } from "../utils"; + + +const BASE_URL = '/mall/base'; +/** + * 获取收货地址 + */ +export const ApiGetAddress = () => + ToAsyncAwait(axiosTk.get(`${BASE_URL}/receiveAddress`)); +/** + * 新增收货地址 + */ +export const ApiPostAddress = (data) => + ToAsyncAwait(axiosTk.post(`${BASE_URL}/receiveAddress`, data)); +/** + * 收货地址修改 + */ +export const ApiPutAddress = (data) => + ToAsyncAwait(axiosTk.put(`${BASE_URL}/receiveAddress`, data)); +/** + * 收货删除 + */ +export const ApiDeleteAddress = (data) => + ToAsyncAwait(axiosTk.delete(`${BASE_URL}/receiveAddress?idList=${data.idList}`)); \ No newline at end of file diff --git a/plugins/api/cart.js b/plugins/api/cart.js new file mode 100644 index 0000000..54bd972 --- /dev/null +++ b/plugins/api/cart.js @@ -0,0 +1,36 @@ +/* + * @Author: ch + * @Date: 2022-05-04 18:24:03 + * @LastEditors: ch + * @LastEditTime: 2022-05-04 22:41:25 + * @Description: file content + */ +import {axiosTk} from "../axiosTk"; +import { ToAsyncAwait } from "../utils"; + +const BASE_URL = '/mall/product'; + +/** + * 设置购物车数量 + * @param {id,number} data + */ +export const ApiPutCartNum = (data) => + ToAsyncAwait(axiosTk.put(`${BASE_URL}/shoppingCart/number`, data)); + +/** + * 往购物车中添加商品 + * @param {prodcutId, productSkuId, number} data + */ +export const ApiPutAddCart = (data) => + ToAsyncAwait(axiosTk.put(`${BASE_URL}/shoppingCart/increase`, data)); +/** + * 删除购物车中的商品 + * @param {idList} data + */ +export const ApiDeleteCartGoods = (data) => + ToAsyncAwait(axiosTk.delete(`${BASE_URL}/shoppingCart?idList=${data.idList}`, data)); +/** + * 获取购物车列表 + */ +export const ApiGetCartList = () => + ToAsyncAwait(axiosTk.get(`${BASE_URL}/shoppingCart`)); diff --git a/plugins/api/goods.js b/plugins/api/goods.js new file mode 100644 index 0000000..7c1e930 --- /dev/null +++ b/plugins/api/goods.js @@ -0,0 +1,55 @@ +/* + * @Author: ch + * @Date: 2022-05-04 18:24:03 + * @LastEditors: ch + * @LastEditTime: 2022-05-04 22:40:26 + * @Description: file content + */ +import {axios} from "../axios"; +import { ToAsyncAwait } from "../utils"; + +const BASE_URL = '/mall/product'; +/** + * 获取商品,瀑布流 + * @param {*} params + */ +export const ApiGetGoodsList = (params) => + ToAsyncAwait(axios.get(`${BASE_URL}/app/product/page`, params)); +/** + * 获取推荐商品 + * @param {*} params + */ +export const ApiGetRecommendedGoodsList = (params) => + ToAsyncAwait(axios.get(`${BASE_URL}/app/product/recommended`, params)); +/** + * 获取商品详情 + * @param {*} params + */ +export const ApiGetGoodsDetail = (params) => + ToAsyncAwait(axios.get(`${BASE_URL}/app/product/${params.id}`)); +/** + * 获取商品sku信息 + * @param {*} productId + */ +export const ApiGetGoodsSkus = (params) => +ToAsyncAwait(axios.get(`${BASE_URL}/app/product/sku`,params)); + +/** + * 获取首页分类导航 + */ +export const ApiGetCategoryNav = () => +ToAsyncAwait(axios.get(`${BASE_URL}/app/product/categoryNavigation`)); + + +/** + * 获取一级分类列表 + */ +export const ApiGetCategoryOneList = () => +ToAsyncAwait(axios.get(`${BASE_URL}/app/productCategory/levelOne`)); + + +/** + * 获取二级分类和商品列表 + */ +export const ApiGetCategoryTwoAndGoods = (params) => +ToAsyncAwait(axios.get(`${BASE_URL}/app/productCategory/listCategoryAndProduct/${params.categoryId}`)); \ No newline at end of file diff --git a/plugins/api/order.js b/plugins/api/order.js new file mode 100644 index 0000000..aef6bbb --- /dev/null +++ b/plugins/api/order.js @@ -0,0 +1,151 @@ + + +/* + * @Author: ch + * @Date: 2022-05-04 18:17:25 + * @LastEditors: ch + * @LastEditTime: 2022-05-04 22:46:02 + * @Description: file content + */ +import {axiosTk} from "../axiosTk"; + +const BASE_URL = '/mall/trade'; +const APPID = 'wx0643970a8e86d028'; + +/** + * 获取订单 + * @param {*} params + */ +export const ApiGetOrderList = (params) => + ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/tradeOrder/page`, params)); +/** + * 获取立即购买预订单 + * @param {*} data + */ +export const ApiGetBeforeOrder = (data) => + ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/tradeOrder/buyAdvanceOrder`, data)); + +/** + * 获取购物车预订单 + * @param {*} data + */ +export const ApiGetBeforeCartOrder = (data) => + ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/tradeOrder/cartAdvanceOrder`, data)); + +/** + * 订单详情 + * @param {*} id + */ +export const ApiGetOrderDetail = (id) => + ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/tradeOrder/${id}`)); + +/** + * 订单商品详情信息 + * @param {*} orderProductId + */ +export const ApiGetOrderProductDetail = ({orderProductId}) => + ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/tradeOrder/product/${orderProductId}`)); + +/** +* 提交订单 +* @param {*} data +*/ +export const ApiGetOrderPaySatus = ({orderId}) => + ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/tradeOrder/payResult/${orderId}`)); + + +/** + * 获取物流信息 + * @param {*} orderId + */ +export const ApiGetOrderLogistics = ({orderId}) => + ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/tradeOrder/logistics/${orderId}`)); +/** + * 确认收货 + * @param {*} orderId + */ +export const ApiPutOrderReceive = (params) => + ToAsyncAwait(axiosTk.put(`${BASE_URL}/app/tradeOrder/receive`, params)); +/** + * 提交订单 + * @param {*} data + */ +export const ApiPostSubmitOrder = (data) => + ToAsyncAwait(axiosTk.post(`${BASE_URL}/app/tradeOrder/submitOrder`, data)); + +/** + * 取消订单 + * @param {*} data + */ +export const ApiPutCancelOrder = (data) => + ToAsyncAwait(axiosTk.put(`${BASE_URL}/app/tradeOrder/cancel`, data)); + + +/** + * 获取订单统计数据 + */ +export const ApiGetOrderStatistics = () => + ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/tradeOrder/statistics`)) + + + + + + + + +/** + * 申请售后 + * @param {*} data + */ +export const ApiPostApplySaleAfter = (data) => + ToAsyncAwait(axiosTk.post(`${BASE_URL}/app/refundOrder/applyRefund`, data)); + +/** + * 修改售后申请 + * @param {*} data + */ +export const ApiPostEditSaleAfter = (data) => +ToAsyncAwait(axiosTk.put(`${BASE_URL}/app/refundOrder/updateRefund`, data)); + +/** + * 撤销售后申请 + * @param {*} data + */ +export const ApiPostCancelSaleAfter = (data) => + ToAsyncAwait(axiosTk.put(`${BASE_URL}/app/refundOrder/cancelRefund`, data)); + +/** + * 售后订单列表 + * @param {*} data + */ +export const ApiGetSaleAfterOrderList = (params) => + ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/refundOrder/page`, params)); +/** + * 售后订单详情 + * @param {*} data + */ +export const ApiGetSaleAfterOrderDetail = (params) => + ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/refundOrder/refundInfo`, params)); +/** + * 售后物流公司 + * @param {*} data + */ +export const ApiGetLogisticsCompanylist = (params) => + ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/refundOrder/logisticsCompany`)); +/** + * 售后提交物流信息 + * @param {*} data + */ +export const ApiPutLogisticsInfo = (data) => + ToAsyncAwait(axiosTk.put(`${BASE_URL}/app/refundOrder/completeRefund`, data)); + + + + +/** + * 微信h5支付,获取支付URL + * @param {*} data + */ +export const ApiPostWxH5Pay = (data) => + ToAsyncAwait(axiosTk.post(`${BASE_URL}/pay/wxPay/h5`, data)); diff --git a/plugins/api/oss.js b/plugins/api/oss.js new file mode 100644 index 0000000..c75f57b --- /dev/null +++ b/plugins/api/oss.js @@ -0,0 +1,15 @@ +/* + * @Author: ch + * @Date: 2022-05-04 18:24:03 + * @LastEditors: ch + * @LastEditTime: 2022-05-04 22:40:06 + * @Description: file content + */ +import {axiosTk} from "../axiosTk"; +import { ToAsyncAwait } from "../utils"; + +const BASE_URL = '/oss/oss'; + + export const ApiPostGetOssConfig = (data) => + ToAsyncAwait(axiosTk.post(`${BASE_URL}/generateOssSignature`, data)); + diff --git a/plugins/api/seckill.js b/plugins/api/seckill.js new file mode 100644 index 0000000..efd77ed --- /dev/null +++ b/plugins/api/seckill.js @@ -0,0 +1,26 @@ +/* + * @Author: ch + * @Date: 2022-05-04 18:24:03 + * @LastEditors: ch + * @LastEditTime: 2022-05-04 22:44:12 + * @Description: file content + */ +import {axios} from "../axios"; +import { ToAsyncAwait } from "../utils"; + +const BASE_URL = '/mall/marketing'; + + export const ApiGetHomeSeckill = () => + ToAsyncAwait(axios.get(`${BASE_URL}/app/activity/home`)); + +/** + * 获取当天秒杀时段 + */ + export const ApiGetSeckillTimes = () => + ToAsyncAwait(axios.get(`${BASE_URL}/app/activity/time`)); +/** + * 获取当天秒杀时段 + */ + export const ApiGetSeckillGoods = (params) => + ToAsyncAwait(axios.get(`${BASE_URL}/app/activity/product`, params)); + diff --git a/plugins/axios.js b/plugins/axios.js new file mode 100644 index 0000000..850d5e3 --- /dev/null +++ b/plugins/axios.js @@ -0,0 +1,31 @@ +/* + * @Author: ch + * @Date: 2022-05-03 23:04:45 + * @LastEditors: ch + * @LastEditTime: 2022-05-04 18:32:54 + * @Description: file content + */ +let axios = null +export default function({app, $axios, req}) { + // if(req){ + // let str = 'Safari' + // if(req.headers['user-agent'].includes('Chrome')){ + // str = 'Chrome' + // } + // console.log(str, req.headers['cookie'].split('token')[1]); + // } + +// export default function ({app, $axios}) { + $axios.onRequest(()=>{ + + }) + $axios.onResponse(res => { + if (res.data.code === 200) { + return res.data.result; + } else { + return Promise.reject(res.data.error); + } + }); + axios = $axios; +} +export { axios } \ No newline at end of file diff --git a/plugins/axiosTk.js b/plugins/axiosTk.js new file mode 100644 index 0000000..96b6ff1 --- /dev/null +++ b/plugins/axiosTk.js @@ -0,0 +1,22 @@ +/* + * @Author: ch + * @Date: 2022-05-04 17:11:07 + * @LastEditors: ch + * @LastEditTime: 2022-05-04 21:50:14 + * @Description: file content + */ +let axiosTk = null; +export default function ({$axios, store}, inject) { + const $axiosTk = $axios.create(); + $axiosTk.onRequest( config =>{ + if(!store.state.token){ + return Promise.reject({message : '要先登录才能操作哦~'}); + } + config.headers.Authorization = store.state.token; + return config; + }); + inject('$axiosTk', $axiosTk); + axiosTk = $axiosTk; + + } +export {axiosTk} \ No newline at end of file diff --git a/plugins/config/localKey.js b/plugins/config/localKey.js new file mode 100644 index 0000000..b7c1320 --- /dev/null +++ b/plugins/config/localKey.js @@ -0,0 +1,9 @@ +/* + * @Author: ch + * @Date: 2022-05-04 21:02:38 + * @LastEditors: ch + * @LastEditTime: 2022-05-04 21:03:14 + * @Description: file content + */ +const LOCAL_BASE = 'msbPc:'; +export const TOKEN = `${LOCAL_BASE}tk`; \ No newline at end of file diff --git a/plugins/element-ui.js b/plugins/element-ui.js new file mode 100644 index 0000000..9ec8b61 --- /dev/null +++ b/plugins/element-ui.js @@ -0,0 +1,5 @@ +import Vue from 'vue' +import Element from 'element-ui' +import locale from 'element-ui/lib/locale/lang/en' + +Vue.use(Element, { locale }) diff --git a/plugins/env.js b/plugins/env.js new file mode 100644 index 0000000..773756e --- /dev/null +++ b/plugins/env.js @@ -0,0 +1 @@ +const ENV = {"base_url":"xxx"}; export default ENV; \ No newline at end of file diff --git a/plugins/storeStorage.js b/plugins/storeStorage.js new file mode 100644 index 0000000..fde218e --- /dev/null +++ b/plugins/storeStorage.js @@ -0,0 +1,14 @@ + + +/* + * @Author: ch + * @Date: 2022-05-04 21:15:17 + * @LastEditors: ch + * @LastEditTime: 2022-05-04 22:05:15 + * @Description: 服务端没有localStorage对象,在Sotre中不能直接取值,在plugins中统一为state做一次初始取值处理 + */ +import { TOKEN } from "./config/localKey"; +export default ({store})=>{ + // 获取storage中的token + store.commit('SET_TOKEN',localStorage.getItem(TOKEN)); +} \ No newline at end of file diff --git a/plugins/utils/index.js b/plugins/utils/index.js new file mode 100644 index 0000000..64d214b --- /dev/null +++ b/plugins/utils/index.js @@ -0,0 +1,13 @@ +/* + * @Author: ch + * @Date: 2022-05-04 20:29:55 + * @LastEditors: ch + * @LastEditTime: 2022-05-04 21:58:02 + * @Description: file content + */ + +import * as other from './other'; + +export * from './other'; + +export default { ...other} \ No newline at end of file diff --git a/plugins/utils/other.js b/plugins/utils/other.js new file mode 100644 index 0000000..6b818b9 --- /dev/null +++ b/plugins/utils/other.js @@ -0,0 +1,53 @@ +/* + * @Author: ch + * @Date: 2022-05-04 21:57:26 + * @LastEditors: ch + * @LastEditTime: 2022-05-04 22:24:07 + * @Description: file content + */ + + +import { + toAsyncAwait as ToAsyncAwait, + isPhone as IsPhone, + formatDate as FormatDate, + createUUID as CreateUUID, + toSearchJson as ToSearchJson +} from "js-util-all" + +/** 防抖函数 + * 首次运行时把定时器赋值给一个变量, 第二次执行时, + * 如果间隔没超过定时器设定的时间则会清除掉定时器, + * 重新设定定时器, 依次反复, 当我们停止下来时, + * 没有执行清除定时器, 超过一定时间后触发回调函数。 +*/ +const Debounce = (fn, delay) => { + let timer + return function () { + const that = this + const _args = arguments // 存一下传入的参数 + if (timer) { + clearTimeout(timer) + } + timer = setTimeout(function () { + fn.apply(that, _args) + }, delay) + } +} + + +// 工具类的文件需要把文件提供的工具类统一放最下方做一个统一输出 +export { + // async await 标识结果处理 + ToAsyncAwait, + // 判断是否为手机号 + IsPhone, + // 时间格式化 + FormatDate, + // 创建UUID + CreateUUID, + // 请求Search参数转化为JSON格式 + ToSearchJson, + // 防抖函数 + Debounce +} \ No newline at end of file diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..d751f60c6d606d10dc8fcc6200b4dd747dd1e1ce GIT binary patch literal 8636 zcmc&)^-~+n(+^&tXp6gBgMJ~nTX3g%ixw%+0L3jpixdm)!KGMnZAyXSZpA6?8l1q( z^H;okb8~yMKiq!S=4NLB0JP`zAE5yl0VPZT0QoZ?rK6=nfJcq@%o2cA74`m;{V_AhDIUiN=_x{uRUY_%}lF~~WR$;EkAC!Lwx?ZMK;eOry75s9MeHn{G=mFvRMXh@|w*v6TX=LTCnjS(7@=hZsdL z#q2QAD}eyfSXd1KKxPZ|54qz2K4$bSPpdO#9u$2I=4Hv)1UmDy0CqU|FhSJ96;A2Ap9BG6a>fMfXIlCAhEwcB_m69bIi6JSk(xk61e zT_eedZgl`4+xLpc3Q@0ldyvOsVq&v(azy^{8z1$FmPl3u00_@_eNT9IR{taloAJ_n zTsapKL|@!H42hQl00cG**OsJNV`$(HYL7~!KE8;ISb#YiAmQ}B@OKUgtBhO1xtWOy z@2^h}W5Mq9SLguhxJ#3<*N55m=XX*BsSFpC1~jOD$hRPoSw-#h*} zAn*+Un7+O;27Q#4NPm6ePskZeG)EWS#mp_S{XXa*;hg7IV&LrVe*0Yw0DjdR{AcCSiofwzDsG^26YmhNpX7rDkUb*4 z6WKus4HOb`BVZs^-tlE9)gcvNdV3o*ELnWQiNPO;!Avw~i%a$0TWRSzqo#jfJ3Ivk z!(iQmZg$mk|3IJG1k-vS(SH4M4UVgHQ;PPoc$th)@n*gIx);J|i3S)Cu8f=vQu&0T zCHXQ0W;Kcbt|bj8pAvZFqkU~TSGy-j%t+f=kC9Mrt-h~P&D=+H$|X?7aE7-jYq zw#SwoK(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#@;dllNpG?od0MXC&r-fgwG9$++ZQ4{hjbB- zk$Sg@a3p#>dVW?*LH^ne|jZcU4YvLjLi<$`gtV|_&2+lu@3X=&s7!*xjKxsHCHvf%J4XW1Ao(giQajn z;xw)KDPI_8MLssG5*A<5=d;|&`JyM*UmVwc*_<-wdz~=Y=3j2^>N$TQUPp!*JJZFJ z!PO;Z75iFxQXhj=2Pk^F;+#Y8pNt_8vF2iW;C;bA3#(c*cFz4|c2?*iI8=g~zP+Kj zn&Z-Ka7M6*MfX7$KY1CpCVWn=B_!m=+l!w>JXM$8E?I>jnst3gDAf#$l2}^PHkDy- z1_m19a3;m$&f1_Q{iVhS?V^8sdW^p2rvyuAyAG2Toj5~sCPq&7)wA^LFuu{157t4W z#62+ml#_zAZYuijUuvHX@4cH@N*;94j=%dE>E>w|Z}mcYeNVty!ngNbvhkouT8!;W zwzTN_e!E+k;^sfon$9d;!T1N(lx1=Z8y&?$*h&snl+(4c!!WSv>h$?w4V$lk z5(a%$*=mQpRG5S5pT%bN2@N7kQ5Dc2E3S6p_c~6Y{)3DI-vhmtC*J;xqoS}QyXy&& z(3wur!}7}10Fj)++^X>Hh@#COl@hJD%J8W<*fz>res@^P5lQm@FmDi|cIqa=Rg_F? TAMreE0RVuNv=po5-$DNmO`MKU literal 0 HcmV?d00001 diff --git a/store/README.md b/store/README.md new file mode 100644 index 0000000..1972d27 --- /dev/null +++ b/store/README.md @@ -0,0 +1,10 @@ +# STORE + +**This directory is not required, you can delete it if you don't want to use it.** + +This directory contains your Vuex Store files. +Vuex Store option is implemented in the Nuxt.js framework. + +Creating a file in this directory automatically activates the option in the framework. + +More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store). diff --git a/store/index.js b/store/index.js new file mode 100644 index 0000000..c7c6892 --- /dev/null +++ b/store/index.js @@ -0,0 +1,20 @@ +/* + * @Author: ch + * @Date: 2022-05-04 20:35:20 + * @LastEditors: ch + * @LastEditTime: 2022-05-04 21:39:42 + * @Description: file content + */ + +import { TOKEN } from "../plugins/config/localKey"; + + +export const state = () => ({ + token: '' + }) +export const mutations = { + SET_TOKEN (state, token = ''){ + state.token = token; + token ? localStorage.setItem(TOKEN, token) : localStorage.removeItem(TOKEN); + } +} \ No newline at end of file diff --git a/test/NuxtLogo.spec.js b/test/NuxtLogo.spec.js new file mode 100644 index 0000000..fbdb343 --- /dev/null +++ b/test/NuxtLogo.spec.js @@ -0,0 +1,9 @@ +import { mount } from '@vue/test-utils' +import NuxtLogo from '@/components/NuxtLogo.vue' + +describe('NuxtLogo', () => { + test('is a Vue instance', () => { + const wrapper = mount(NuxtLogo) + expect(wrapper.vm).toBeTruthy() + }) +})