wang-hao-jie
2022-08-25 2b506494d7c73a3978004bd0b32a5d0783b25efa
默认更改列表
10个文件已修改
253 ■■■■■ 已修改文件
public/index.html 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Main.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/change-pass/change-pass.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/home.vue 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login.vue 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/main-components/header.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/main-components/user.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/my-components/xboot/set-password.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/your/area-manage/areaManage.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/index.html
@@ -6,7 +6,7 @@
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
  <!--<link rel="icon" href="<%= BASE_URL %>logo.png">-->
  <title>唐山烟草配送管理后台</title>
  <title>安全配送管理后台</title>
  <meta name="keywords"
    content="">
  <meta name="description"
@@ -62,15 +62,6 @@
  <!--<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mapbox-gl@2.3.0/dist/mapbox-gl.css">-->
  <!--<link rel="stylesheet"-->
    <!--href="https://cdn.jsdelivr.net/npm/@mapbox/mapbox-gl-geocoder@4.7.1/dist/mapbox-gl-geocoder.css">-->
  <script>
    (function () {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?64e52d9ed8f5acc3eb7d60058e2fb7ab";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>
  <style>
    .page-loading-wrap {
      padding: 120px;
src/views/Main.vue
@@ -30,7 +30,8 @@
            <!--v-show="!shrink && menuTheme == 'light' && mainTheme != 'darkMode'"-->
            <!--src="@/assets/yancao.png"-->
          <!--/>-->
          <img src="@/assets/yancao.png"/>
          <!--<img src="@/assets/yancao.png"/>-->
          菜单栏
        </div>
      </shrinkable-menu>
    </div>
src/views/change-pass/change-pass.vue
@@ -28,7 +28,7 @@
          </FormItem>
          <FormItem label="新密码" prop="newPass">
            <SetPassword
              placeholder="请输入新密码,长度为6-20个字符"
              placeholder="请输入新密码,长度为8-20个字符"
              v-model="form.newPass"
              @on-change="changeInputPass"
            />
@@ -54,6 +54,7 @@
</template>
<script>
  import { getOtherSet } from "@/api/index";
import SetPassword from "@/views/my-components/xboot/set-password";
import { changePass } from "@/api/index";
export default {
@@ -100,7 +101,7 @@
            trigger: "change",
          },
          {
            min: 6,
            min: 8,
            message: "请至少输入6个字符",
            trigger: "blur",
          },
@@ -129,6 +130,10 @@
      this.strength = strength;
    },
    submit() {
      if(this.strength!='强'){
        this.$Message.error("请使用强密码包含数字,大小写字母,特殊字符,且不少于8位");
        return;
      }
      let params = {
        password: this.form.oldPass,
        newPass: this.form.newPass,
@@ -143,7 +148,7 @@
              this.visible = false;
              this.$Modal.success({
                title: "修改密码成功",
                content: "修改密码成功,请保管好您的新账号密码",
                content: "为了账号安全,系统稍后将强制退出,请用新密码重新登陆。",
              });
            }
          });
src/views/home/home.vue
@@ -5,7 +5,7 @@
<template>
  <div>
    <div v-show="currNav == 'xboot'" class="home">
      <a :href="this.token" target="_blank">唐山烟草大屏地址</a>
      <a :href="this.token" target="_blank">大屏地址</a>
      <!--<Row :gutter="10">-->
        <!--&lt;!&ndash; 左上侧 用户信息及github链接 &ndash;&gt;-->
        <!--<Col :xs="24" :sm="24" :lg="24" :xl="8">-->
@@ -455,6 +455,7 @@
</template>
<script>
  import { getStore } from '../../libs/storage';
import { ipInfo, getNotice } from "@/api/index";
import visitVolume from "./components/visitVolume.vue";
import visitSeparation from "./components/visitSeparation.vue";
@@ -467,6 +468,7 @@
import Cookies from "js-cookie";
// import "gitalk/dist/gitalk.css";
import Gitalk from "gitalk";
export default {
  name: "home",
@@ -545,11 +547,29 @@
        }
      });
    },
    toCode(str) {  //加密字符串
      //定义密钥,36个字母和数字
      var key = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
      var st = key.length;  //获取密钥的长度
      var a = key.split("");  //把密钥字符串转换为字符数组
      var s = "",b, b1, b2, b3;  //定义临时变量
      for (var i = 0; i <str.length; i ++) {  //遍历字符串
        b = str.charCodeAt(i);  //逐个提取每个字符,并获取Unicode编码值
        b1 = b % st;  //求Unicode编码值得余数
        b = (b - b1) / st;  //求最大倍数
        b2 = b % st;  //求最大倍数的于是
        b = (b - b2) / st;  //求最大倍数
        b3 = b % st;  //求最大倍数的余数
        s += a[b3] + a[b2] + a[b1];  //根据余数值映射到密钥中对应下标位置的字符
      }
      return s;  //返回这些映射的字符
    }
  },
  mounted() {
    //this.token = 'http://111.63.178.115:9093?token='+new Date().getTime();
    this.token = 'http://localhost:8080?token='+new Date().getTime();
    //this.token = 'http://localhost:8080'
    this.token = 'http://111.63.178.115:9093?token=$vj$xCShfaQRUQlF8lqL1lwWi2auOrkLfkoecRuDWiJXlTnSg1mh6BODfjieo3ncsosjiocew';
    //alert(this.toCode('管理员'))
    //this.token = 'http://localhost:8080?token='+this.toCode('管理员');
    //this.token = 'http://localhost:8080?token=$vj$xCShfaQRUQlF8lqL1lwWi2auOrkLfkoecRuDWiJXlTnSg1mh6BODfjieo3ncsosjiocew';
    // this.init();
    // // 通知
    // let noticeFlag = "noticeShowed";
src/views/login.vue
@@ -10,7 +10,7 @@
            <Col class="content">
            <div>
                <Header />
                <div v-if="!socialLogining">
                <div v-if="!socialLogining" style="margin-top: 150px">
                            <Form
                                    ref="usernameLoginForm"
                                    :model="form"
@@ -18,6 +18,9 @@
                                    class="form"
                                    v-if="tabName == 'username'"
                            >
                                <FormItem>
                                    <h1 style="margin-left: 40%;">登&nbsp陆</h1>
                                </FormItem>
                                <FormItem prop="username">
                                    <Input
                                            v-model="form.username"
@@ -39,34 +42,34 @@
                                            autocomplete="off"
                                    />
                                </FormItem>
                                <!--<FormItem prop="imgCode">-->
                                    <!--<Row-->
                                            <!--type="flex"-->
                                            <!--justify="space-between"-->
                                            <!--style="align-items: center; overflow: hidden"-->
                                    <!--&gt;-->
                                        <!--<Input-->
                                                <!--v-model="form.imgCode"-->
                                                <!--size="large"-->
                                                <!--clearable-->
                                                <!--placeholder="请输入图片验证码"-->
                                                <!--:maxlength="10"-->
                                                <!--class="input-verify"-->
                                        <!--/>-->
                                        <!--<div-->
                                                <!--class="code-image"-->
                                                <!--style="position: relative; font-size: 12px"-->
                                        <!--&gt;-->
                                            <!--<Spin v-if="loadingCaptcha" fix></Spin>-->
                                            <!--<img-->
                                                    <!--:src="captchaImg"-->
                                                    <!--@click="getCaptchaImg"-->
                                                    <!--alt="加载验证码失败"-->
                                                    <!--style="width: 110px; cursor: pointer; display: block"-->
                                            <!--/>-->
                                        <!--</div>-->
                                    <!--</Row>-->
                                <!--</FormItem>-->
                                <FormItem prop="imgCode">
                                    <Row
                                            type="flex"
                                            justify="space-between"
                                            style="align-items: center; overflow: hidden"
                                    >
                                        <Input
                                                v-model="form.imgCode"
                                                size="large"
                                                clearable
                                                placeholder="请输入图片验证码"
                                                :maxlength="10"
                                                class="input-verify"
                                        />
                                        <div
                                                class="code-image"
                                                style="position: relative; font-size: 12px"
                                        >
                                            <Spin v-if="loadingCaptcha" fix></Spin>
                                            <img
                                                    :src="captchaImg"
                                                    @click="getCaptchaImg"
                                                    alt="加载验证码失败"
                                                    style="width: 110px; cursor: pointer; display: block"
                                            />
                                        </div>
                                    </Row>
                                </FormItem>
                            </Form>
                    <!--<Row justify="space-between" align="middle">-->
@@ -121,6 +124,7 @@
    <!--</VueFurcateTree>-->
    <!--</div>-->
</template>
@@ -191,6 +195,7 @@
                    }
                ],
                showMore: false,
                code:"",
                captchaId: "",
                captchaImg: "",
                loadingCaptcha: true,
@@ -207,6 +212,7 @@
                    password: "",
                    code: "",
                },
                showChangePass: false,
            };
        },
        methods: {
@@ -215,7 +221,8 @@
                initCaptcha().then((res) => {
                    this.loadingCaptcha = false;
                    if (res.success) {
                        this.captchaId = res.result;
                        this.code = res.result.code;
                        this.captchaId = res.result.captchaId;
                        this.captchaImg = drawCodeImage + this.captchaId;
                    }
                });
@@ -284,6 +291,11 @@
            },
            submitLogin() {
                if (this.tabName == "username") {
                    if(this.code.toUpperCase()!=this.form.imgCode.toUpperCase()){
                        this.$Message.error("验证码错误");
                        this.getCaptchaImg();
                        return
                    }
                            this.loading = true;
                            login({
                                username: this.form.username,
@@ -478,16 +490,16 @@
                });
            },
            test() {
                this.$Notice.info({
                    title: "测试体验账号",
                    desc: "账号:test或test2<br>密码:123456",
                });
                // this.$Notice.info({
                //     title: "测试体验账号",
                //     desc: "账号:test或test2<br>密码:123456",
                // });
            },
        },
        mounted() {
            //this.showNotice();
            this.relatedLogin();
            //this.getCaptchaImg();
            this.getCaptchaImg();
        },
    };
</script>
src/views/main-components/header.vue
@@ -1,13 +1,12 @@
<template>
  <div>
    <div class="header">
      <img
        src="@/assets/yancao.png"
        width="220px"
        v-if="mainTheme == 'darkMode'"
      />
      <img src="@/assets/yancao.png" width="320px" v-else />
      <!--<div class="description">{{ 唐山烟草 }}</div>-->
      <!--<img-->
        <!--src="@/assets/keji.jpeg"-->
        <!--width="320px"-->
        <!--v-if="mainTheme == 'darkMode'"-->
      <!--/>-->
      <!--<img src="@/assets/keji.jpeg" width="420px" v-else />-->
    </div>
  </div>
</template>
src/views/main-components/user.vue
@@ -53,10 +53,44 @@
  data() {
    return {
      showChangePass: false,
      flag:0,
    };
  },
  methods: {
    init() {},
    init() {
      let psw = this.getStore("userInfo");
      psw = JSON.parse(psw).description;
      this.checkStrengthValue(psw);
    },
    checkStrengthValue(v) {
      // 评级制判断密码强度 最高5
      let grade = 0;
      if (/\d/.test(v)) {
        grade++; //数字
      }
      if (/[a-z]/.test(v)) {
        grade++; //小写
      }
      if (/[A-Z]/.test(v)) {
        grade++; //大写
      }
      if (/\W/.test(v)) {
        grade++; //特殊字符
      }
      if (v.length >= 8) {
        grade++;
      }
      if(grade<5){
        this.showChangePass = true;
        this.flag++;
        if(this.flag>1){
          this.handleClickUserDropdown("loginout");
        }
        setInterval(() => {
          this.init();
        }, 1000*60)
      }
    },
    handleClickUserDropdown(name) {
      if (name == "ownSpace") {
        util.openNewPage(this, "ownspace_index");
src/views/my-components/xboot/set-password.vue
@@ -20,7 +20,7 @@
          hide-info
          style="margin: 13px 0;"
        />
        <br />请至少输入 6 个字符。请不要使
        <br />请至少输入 8 个字符。请不要使
        <br />用容易被猜到的密码。
      </div>
    </Poptip>
@@ -76,7 +76,7 @@
      if (/\W/.test(v)) {
        grade++; //特殊字符
      }
      if (v.length >= 10) {
      if (v.length >= 8) {
        grade++;
      }
      this.grade = grade;
src/views/your/area-manage/areaManage.vue
@@ -781,6 +781,9 @@
      if(this.areaForm.description==undefined){
        this.areaForm.description="";
      }
      if(this.areaForm.carId==undefined){
        this.areaForm.carId="";
      }
      this.$refs.areaForm.validate((valid) => {
        if (valid) {
          if (this.modalType == 0) {
vue.config.js
@@ -6,44 +6,50 @@
        port: 9999,
        proxy: {
            '/xboot': {
                target: 'http://127.0.0.1:8888',  // 请求本地 需要xboot后端项目
                ws: true
                target: 'http://127.0.0.1:9091',  // 请求本地 需要xboot后端项目
                //target: 'http://192.168.0.162:8888',  // 请求本地 需要xboot后端项目
                //target: 'http://111.63.178.115:9091',
                ws: true,
                changeOrigin:true,
                pathRewrite:{
                    '/api':''
                }
            },
            '/foo': {
                target: '<other_url>'
            }
        }
        },
    },
    // 打包时不生成.map文件 避免看到源码
    productionSourceMap: false,
    // 部署优化
    configureWebpack: {
        // 使用CDN
        externals: {
            vue: 'Vue',
            'vue-i18n': 'VueI18n',
            axios: 'axios',
            'vue-router': 'VueRouter',
            vuex: 'Vuex',
            'view-design': 'iview',
            echarts: 'echarts',
            apexcharts: 'ApexCharts',
            'vue-apexcharts': 'VueApexCharts',
            xlsx: 'XLSX',
            dplayer: 'DPlayer',
            'print-js': 'printJS',
            html2canvas: 'html2canvas',
            'vue-json-pretty': 'VueJsonPretty',
            'vue-lazyload': 'VueLazyload',
            gitalk: 'Gitalk',
            'js-cookie': 'Cookies',
            wangEditor: 'wangEditor',
            quill: 'Quill',
            stompjs: 'Stomp',
            'sockjs-client': 'SockJS',
            vuedraggable: 'vuedraggable',
            viewerjs: 'Viewer'
        },
        // externals: {
        //     vue: 'Vue',
        //     'vue-i18n': 'VueI18n',
        //     axios: 'axios',
        //     'vue-router': 'VueRouter',
        //     vuex: 'Vuex',
        //     'view-design': 'iview',
        //     echarts: 'echarts',
        //     apexcharts: 'ApexCharts',
        //     'vue-apexcharts': 'VueApexCharts',
        //     xlsx: 'XLSX',
        //     dplayer: 'DPlayer',
        //     'print-js': 'printJS',
        //     html2canvas: 'html2canvas',
        //     'vue-json-pretty': 'VueJsonPretty',
        //     'vue-lazyload': 'VueLazyload',
        //     gitalk: 'Gitalk',
        //     'js-cookie': 'Cookies',
        //     wangEditor: 'wangEditor',
        //     quill: 'Quill',
        //     stompjs: 'Stomp',
        //     'sockjs-client': 'SockJS',
        //     vuedraggable: 'vuedraggable',
        //     viewerjs: 'Viewer'
        // },
        plugins: [
            // GZIP压缩
            new CompressionPlugin({