作者 李芳银

第一次提交

正在显示 100 个修改的文件 包含 285 行增加0 行删除

要显示太多修改。

为保证性能只显示 100 of 100+ 个文件。

  1 +> 1%
  2 +last 2 versions
  3 +not dead
  1 +[*.{js,jsx,ts,tsx,vue}]
  2 +indent_style = space
  3 +indent_size = 2
  4 +trim_trailing_whitespace = true
  5 +insert_final_newline = true
  1 +module.exports = {
  2 + root: true,
  3 + env: {
  4 + node: true
  5 + },
  6 + extends: [
  7 + 'plugin:vue/essential',
  8 + // '@vue/standard'
  9 + ],
  10 + parserOptions: {
  11 + parser: 'babel-eslint'
  12 + },
  13 + rules: {
  14 + "space-before-function-paren": 0,
  15 + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
  16 + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
  17 + },
  18 + globals: {
  19 + wx: true
  20 + },
  21 +}
  1 +.DS_Store
  2 +node_modules
  3 +/dist
  4 +
  5 +# local env files
  6 +.env.local
  7 +.env.*.local
  8 +
  9 +# Log files
  10 +npm-debug.log*
  11 +yarn-debug.log*
  12 +yarn-error.log*
  13 +
  14 +# Editor directories and files
  15 +.idea
  16 +.vscode
  17 +*.suo
  18 +*.ntvs*
  19 +*.njsproj
  20 +*.sln
  21 +*.sw?
  1 +module.exports = {
  2 + presets: [
  3 + ["@vue/cli-plugin-babel/preset", {
  4 + useBuiltIns: "entry",
  5 + }]
  6 + ]
  7 +}
此 diff 太大无法显示。
  1 +{
  2 + "name": "koudaishangcheng-pc",
  3 + "version": "0.1.0",
  4 + "private": true,
  5 + "scripts": {
  6 + "serve": "vue-cli-service serve",
  7 + "build": "vue-cli-service build",
  8 + "lint": "eslint --fix --ext .js,.vue src"
  9 + },
  10 + "dependencies": {
  11 + "axios": "^0.19.2",
  12 + "bignumber.js": "^9.0.0",
  13 + "core-js": "^3.6.4",
  14 + "element-ui": "^2.13.0",
  15 + "js-base64": "^3.5.2",
  16 + "json-bigint": "^0.3.0",
  17 + "qrcode2": "^1.2.3",
  18 + "qrcodejs2": "0.0.2",
  19 + "swiper": "^5.3.7",
  20 + "vue": "^2.6.11",
  21 + "vue-awesome-swiper": "^4.1.0",
  22 + "vue-clipboard2": "^0.3.1",
  23 + "vue-cropper": "^0.5.5",
  24 + "vue-lazyload": "^1.3.3",
  25 + "vue-quill-editor": "^3.0.6",
  26 + "vue-router": "^3.0.7",
  27 + "vue-video-player": "^5.0.2"
  28 + },
  29 + "devDependencies": {
  30 + "@vue/cli-plugin-babel": "^4.3.0",
  31 + "@vue/cli-plugin-eslint": "^4.3.0",
  32 + "@vue/cli-service": "^4.3.0",
  33 + "@vue/eslint-config-standard": "^5.1.2",
  34 + "babel-eslint": "^10.1.0",
  35 + "babel-polyfill": "^6.26.0",
  36 + "compression-webpack-plugin": "^6.0.3",
  37 + "eslint": "^6.7.2",
  38 + "eslint-plugin-import": "^2.20.2",
  39 + "eslint-plugin-node": "^11.1.0",
  40 + "eslint-plugin-promise": "^4.2.1",
  41 + "eslint-plugin-standard": "^4.0.0",
  42 + "eslint-plugin-vue": "^6.2.2",
  43 + "less": "^3.0.4",
  44 + "less-loader": "^5.0.0",
  45 + "lint-staged": "^9.5.0",
  46 + "vue-template-compiler": "^2.6.11",
  47 + "vuex": "^3.4.0",
  48 + "weixin-js-sdk": "^1.6.0"
  49 + },
  50 + "gitHooks": {
  51 + "pre-commit": "lint-staged"
  52 + },
  53 + "lint-staged": {
  54 + "*.{js,jsx,vue}": [
  55 + "vue-cli-service lint",
  56 + "git add"
  57 + ]
  58 + }
  59 +}
  1 +<!DOCTYPE html>
  2 +<html lang="en">
  3 +
  4 +<head>
  5 + <meta charset="utf-8">
  6 + <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7 + <meta name="viewport" content="width=device-width,initial-scale=1.0">
  8 + <!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico"> -->
  9 + <link rel="icon" href="<%= BASE_URL %>logo.png">
  10 + <title>口袋宇宙,专注英文教育的内容提供商</title>
  11 + <!-- <title><%= htmlWebpackPlugin.options.title %></title> -->
  12 +
  13 +</head>
  14 +
  15 +<body>
  16 +
  17 + <noscript>
  18 + <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
  19 + Please enable it to continue.</strong>
  20 + </noscript>
  21 + <div id="app"></div>
  22 + <!-- built files will be auto injected -->
  23 +</body>
  24 + <script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
  25 +
  26 +
  27 +</html>
  1 +<template>
  2 + <div id="app">
  3 + <!-- <keep-alive>
  4 + <router-view v-if="isRouterAlive"></router-view>
  5 + </keep-alive>-->
  6 + <keep-alive>
  7 + <router-view v-if="$route.meta.keepAlive"></router-view>
  8 + </keep-alive>
  9 + <router-view v-if="!$route.meta.keepAlive"></router-view>
  10 + </div>
  11 +</template>
  12 +
  13 +<script>
  14 +export default {
  15 + provide() {
  16 + return {
  17 + reload: this.reload
  18 + };
  19 + },
  20 + data() {
  21 + return {
  22 + isRouterAlive: true,
  23 + };
  24 + },
  25 + meta: {
  26 + keepAlive: true,
  27 + },
  28 + created() {
  29 + this.IsPC()
  30 + var store = require('../src/store')
  31 + //在页面加载时读取sessionStorage里的状态信息
  32 + if (sessionStorage.getItem("store")) {
  33 + // this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem("store"))))
  34 + }
  35 + // //在页面刷新时将vuex里的信息保存到sessionStorage里
  36 + window.addEventListener("beforeunload", () => {
  37 + // sessionStorage.setItem("store", JSON.stringify(this.$store.state))
  38 + })
  39 + },
  40 +
  41 + mounted: function () {
  42 +
  43 +
  44 + },
  45 +
  46 + methods: {
  47 + IsPC() {
  48 + var userAgentInfo = navigator.userAgent;
  49 + var Agents = ["Android", "iPhone",
  50 + "SymbianOS", "Windows Phone",
  51 + "iPad", "iPod"];
  52 + var flag = false;
  53 + for (var v = 0; v < Agents.length; v++) {
  54 + if (userAgentInfo.indexOf(Agents[v]) != -1) {
  55 + // window.location.href = 'https://m.glaforteachers.com/'
  56 + flag = true;
  57 + // break;
  58 + }
  59 + }
  60 + if (flag) {
  61 + window.location.href = 'https://m.glaforteachers.com/'
  62 + }
  63 + return flag;
  64 +
  65 + },
  66 + saveState() {
  67 + localStorage.setItem('KEY', JSON.stringify(this.$store.state.KEY))
  68 + },
  69 + reload() {
  70 + this.isRouterAlive = false;
  71 + this.$nextTick(function () {
  72 + this.isRouterAlive = true;
  73 + });
  74 + },
  75 + }
  76 +};
  77 +</script>
  78 +
  79 +<style>
  80 +#app {
  81 + font-family: PingFang SC;
  82 + -webkit-font-smoothing: antialiased;
  83 + -moz-osx-font-smoothing: grayscale;
  84 + color: #0d1e2e;
  85 + overflow-y: hidden;
  86 + background-color: #fbf8fb;
  87 +}
  88 +.cropper-view-box img {
  89 + display: none !important;
  90 +}
  91 +</style>
  1 +// 导出一个配置好的axios提供给main挂载
  2 +import axios from 'axios'
  3 +import Vue from 'vue'
  4 +import local from '@/utils/local'
  5 +import router from '@/router'
  6 +import JSONBIG from 'json-bigint'
  7 +
  8 +Vue.use(router)
  9 +axios.defaults.baseURL = 'https://glaforteachers.com/';
  10 +axios.defaults.transformResponse = [(data) => {
  11 + try {
  12 + return JSONBIG.parse(data)
  13 + } catch (e) {
  14 + return data
  15 + }
  16 +}]
  17 +
  18 +// 请求拦截器
  19 +axios.interceptors.request.use(config => {
  20 + // 1. 获取token
  21 + const user = local.getUser() || {} // 这里得到的是一个字符串 是token 的字符串
  22 + // console.log("user", user)
  23 + config.headers.Authorization = `Bearer ${user}`
  24 + config.headers.token = user
  25 + return config;
  26 +}, err => {
  27 + return Promise.reject(err)
  28 +})
  29 +// 响应拦截器
  30 +axios.interceptors.response.use(res => {
  31 + if (res.data.code == 1) {
  32 + return Promise.resolve(res);
  33 + } else {
  34 + return Promise.reject(res);
  35 + }
  36 +}, err => {
  37 + console.log(err);
  38 + const status = err.response.status
  39 + // 2. 判断401
  40 + console.log(status);
  41 + if (status === 401) {
  42 + // this.$message.error('该页面登录后才可访问')
  43 + } else if (status === 404) {
  44 + router.push('/404')
  45 + } else if (err.response.code === 0) {
  46 + return router.replace('/404')
  47 + }
  48 + return Promise.reject(err)
  49 +})
  50 +
  51 +export default axios