“hanlingqiang vor 3 Jahren
Ursprung
Commit
4d1e112c3f

Datei-Diff unterdrückt, da er zu groß ist
+ 432 - 82
package-lock.json


+ 1 - 1
src/views/weibao/App.vue

@@ -13,7 +13,7 @@ export default {
     return {}
   },
   created() {
-    this.loginApp()
+    // this.loginApp()
   },
   methods: {
     async loginApp() {

BIN
src/views/weibao/assets/login/bg.jpeg


BIN
src/views/weibao/assets/login/bottomBg1.png


+ 9 - 1
src/views/weibao/router/router.js

@@ -3,7 +3,15 @@ import VueRouter from 'vue-router'
 
 Vue.use(VueRouter)
 
-const routes = [{
+const routes = [
+    {
+        path: '/login',
+        name: 'Login',
+        meta: {
+            keepAlive: true
+        },
+        component: () => import('../views/login/index.vue')
+    },{
         path: '/home',
         name: 'Home',
         meta: {

+ 128 - 0
src/views/weibao/views/login/index.vue

@@ -0,0 +1,128 @@
+<template>
+  <div>
+    <div class="img_top">
+      <img class="img" src="../../assets/login/bg.jpeg" />
+    </div>
+
+    <p class="title">邹平未保客户端</p>
+    <van-form>
+      <van-field
+        v-model="username"
+        name="用户名"
+        label="用户名:"
+        placeholder="用户名"
+        :rules="[{ required: true, message: '请输入用户名' }]"
+      />
+      <van-field
+        v-model="password"
+        type="password"
+        name="密码:"
+        label="密码:"
+        placeholder="密码"
+        :rules="[{ required: true, message: '请输入密码' }]"
+      />
+      <div class="submit_bg" style="margin: 60px 26px">
+        <van-button
+          round
+          block
+          type="info"
+          native-type="submit"
+          @click="onSubmit"
+          >登录</van-button
+        >
+      </div>
+    </van-form>
+    <div class="img_bottom">
+      <img class="img" src="../../assets/login/bottomBg1.png" />
+    </div>
+  </div>
+</template>
+<script>
+import { loginApp } from '../../../../api/index.js'
+export default {
+  components: {},
+  name: "Login",
+  data() {
+    return {
+      imgUrl: "../../assets/login/bg.jpeg",
+      username: "",
+      password: "",
+    };
+  },
+  created() {},
+  methods: {
+    async onSubmit() {
+        if(this.username == "" || this.password == "") {
+            this.$toast("请输入账号或密码");
+            return;
+        }
+        const res = await loginApp({
+            loginName: this.username,//'15620220622'
+            // loginName: '16601217325',
+            password: this.password,//'123456'
+        })
+        if(res.data.jwtToken) {
+            this.$toast.success("登录成功");
+            sessionStorage.setItem('userInfo', JSON.stringify(res.data))
+            sessionStorage.setItem('x-token', res.data.jwtToken)
+            this.$router.replace('/home')
+        } else {
+            this.$toast.fail("账号或密码错误");
+        }
+    }
+  },
+};
+</script>
+<style lang="scss" scoped>
+.img_top {
+  .img {
+    width: 100%;
+    height: 100%;
+    position: fixed;
+    top: 0;
+    left: 0;
+    z-index: -1;
+  }
+}
+.title {
+  margin: 300px 0 100px;
+  height: 50px;
+  line-height: 50px;
+  font-style: normal;
+  font-weight: 500;
+  font-size: 48px;
+  color: #1a1a1a;
+  text-align: center;
+}
+/deep/.van-cell {
+    margin-top: 100px;
+    background-color:transparent;
+    width: 94%;
+    margin: 0 auto;
+    .van-field__label {
+        color: #333333;
+        font-size: 30px;
+       width: 120px;
+       text-align: center;
+       line-height: 80px;
+       
+    }
+    .van-field__control {
+        height: 80px;
+        padding-left: 8px;
+        box-sizing: border-box;
+        color: #222222;
+        font-size: 32px;
+    }
+}
+ 
+.img_bottom {
+  .img {
+    position: fixed;
+    z-index: -1;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+  }
+}
+</style>

+ 3 - 0
vue.config.js

@@ -40,6 +40,9 @@ function resolve(dir) {
 }
 const port = process.env.port || process.env.npm_config_port || 12004 // dev port
 const name = 'vue Admin Template' // page title
+console.log('projectname===')
+console.log(process.argv)
+console.log(projectname)
 var pages = getEntry();
 module.exports = {
     productionSourceMap: false, // 生产禁止显示源代码

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.