Преглед на файлове

隐私声明服务条款弹窗

sunlupeng преди 1 година
родител
ревизия
e70cf77e8f
променени са 3 файла, в които са добавени 39 реда и са изтрити 6 реда
  1. 2 2
      .env.dev
  2. 7 0
      src/api/login.js
  3. 30 4
      src/views/register.vue

+ 2 - 2
.env.dev

@@ -8,9 +8,9 @@ VUE_APP_TITLE = 爱思系统
 # 赵培清
 # VUE_APP_BASE_API = 'http://192.168.100.213:48080'
 # 王东坡
-# VUE_APP_BASE_API = 'http://192.168.100.64:48081'
+VUE_APP_BASE_API = 'http://192.168.100.64:48081'
 # 测试
-VUE_APP_BASE_API = 'http://47.103.79.143:48081'
+# VUE_APP_BASE_API = 'http://47.103.79.143:48081'
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 7 - 0
src/api/login.js

@@ -1,6 +1,13 @@
 import request from '@/utils/request'
 import { getRefreshToken } from '@/utils/auth'
 import service from '@/utils/request'
+//根据类型获得平台协议type:1服务条款 2隐私声明
+export function agreement(type) {
+  return request({
+    url: '/system/agreement/get/type?type=' + type,
+    method: 'get'
+  })
+}
 
 // 登录方法
 export function login(username, password, captchaVerification, socialType, socialCode, socialState) {

+ 30 - 4
src/views/register.vue

@@ -38,9 +38,9 @@
               </el-form-item>
               <div class="service-laws">
                 点击注册表明你已阅读并同意
-                <a class="terms" href="https://www.jiandaoyun.com/index/term" target="_blank">《服务条款》</a>
+                <span class="terms" @click="getAgreement(1)">《服务条款》</span>
-                <a class="terms" href="https://www.jiandaoyun.com/index/term/privacy" target="_blank">《隐私声明》</a>
+                <span class="terms" @click="getAgreement(2)">《隐私声明》</span>
               </div>
               <!-- 下方的下一步按钮 -->
               <el-form-item style="width:100%;">
@@ -61,15 +61,27 @@
         </div>
       </div>
     </div>
+    <el-dialog
+      :title="title"
+      :visible.sync="dialogVisible"
+      width="50%">
+      <div v-html="agreementData"></div>
+      <span slot="footer" class="dialog-footer" style="display: flex;justify-content: center">
+        <el-button style="width:50%;font-size: 24px;" type="danger" @click="dialogVisible = false">我已知晓</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { sendSmsCode } from "@/api/login";
+import { sendSmsCode,agreement } from "@/api/login";
 import {setTenantId} from "@/utils/auth";
 export default {
   data() {
     return {
+      title:'',
+      agreementData:'',
+      dialogVisible: false,
       mobileCodeTimer: 0,
       loginForm: {
         mobile: "",
@@ -100,6 +112,17 @@ export default {
 
   },
   methods: {
+    getAgreement(type){
+      if(type == 1){
+        this.title = '服务条款';
+      }else{
+        this.title = '隐私声明';
+      }
+      agreement(type).then(response => {
+          this.agreementData = response.data.content; 
+          this.dialogVisible = true;
+      })
+    },
     //跳转登录
     doLogin() {
       this.$router.push({ path: '/login' })
@@ -141,7 +164,9 @@ export default {
 </script>
 <style lang="scss" scoped>
 @import "~@/assets/styles/login.scss";
-
+::v-deep .el-dialog__title,::v-deep .el-dialog__headerbtn{
+  font-size: 24px;
+}
 .login-title {
   color: #141e31;
   font-size: 32px;
@@ -157,6 +182,7 @@ export default {
 }
 
 .service-laws .terms {
+  cursor: pointer;
   color: #1890ff;
 }