stjdydayou 4 anni fa
parent
commit
1af24c5a37

+ 8 - 0
src/api/oauth.js

@@ -15,6 +15,14 @@ export function login(data) {
   })
 }
 
+export function changePassword(data) {
+  return request({
+    url: '/oauth/changePassword',
+    method: 'post',
+    data
+  })
+}
+
 export function getOauthInfo() {
   return request({
     url: '/oauth/getOauthInfo',

+ 9 - 9
src/api/place/base_info.js

@@ -2,7 +2,7 @@ import request from '@/utils/request'
 
 export function findPage(data) {
   return request({
-    url: '/bz/data/info/findPage',
+    url: '/place/info/findPage',
     method: 'post',
     data
   })
@@ -10,7 +10,7 @@ export function findPage(data) {
 
 export function save(data) {
   return request({
-    url: '/bz/data/info/save',
+    url: '/place/info/save',
     method: 'post',
     data
   })
@@ -18,7 +18,7 @@ export function save(data) {
 
 export function updateById(id, data) {
   return request({
-    url: '/bz/data/info/updateById',
+    url: '/place/info/updateById',
     method: 'post',
     params: { id },
     data
@@ -27,7 +27,7 @@ export function updateById(id, data) {
 
 export function deleteByIds(ids) {
   return request({
-    url: '/bz/data/info/deleteByIds',
+    url: '/place/info/deleteByIds',
     method: 'post',
     data: ids
   })
@@ -35,14 +35,14 @@ export function deleteByIds(ids) {
 
 export function findAllDataType() {
   return request({
-    url: '/bz/data/info/findAllDataType',
+    url: '/place/info/findAllDataType',
     method: 'post'
   })
 }
 
 export function findDataBaseInfoExtends(baseInfoId, categoryId) {
   return request({
-    url: '/bz/data/info/findDataBaseInfoExtends',
+    url: '/place/info/findDataBaseInfoExtends',
     method: 'post',
     params: { baseInfoId, categoryId }
   })
@@ -50,7 +50,7 @@ export function findDataBaseInfoExtends(baseInfoId, categoryId) {
 
 export const findByMapBounds = (maxlng, maxlat, minlng, minlat, categoryId) => {
   return request({
-    url: '/bz/data/info/findByMapBounds',
+    url: '/place/info/findByMapBounds',
     method: 'POST',
     params: { maxlng, maxlat, minlng, minlat, categoryId }
   })
@@ -58,14 +58,14 @@ export const findByMapBounds = (maxlng, maxlat, minlng, minlat, categoryId) => {
 
 export const findByGroupByDataType = () => {
   return request({
-    url: '/bz/data/info/findByGroupByDataType',
+    url: '/place/info/findByGroupByDataType',
     method: 'POST'
   })
 }
 
 export function findSelectByKeyword(keyword) {
   return request({
-    url: '/bz/data/info/findSelectByKeyword',
+    url: '/place/info/findSelectByKeyword',
     method: 'post',
     params: { keyword }
   })

+ 4 - 4
src/api/place/category.js

@@ -2,7 +2,7 @@ import request from '@/utils/request'
 
 export function findPage(data) {
   return request({
-    url: '/bz/data/type/findPage',
+    url: '/place/category/findPage',
     method: 'post',
     data
   })
@@ -10,7 +10,7 @@ export function findPage(data) {
 
 export function save(data) {
   return request({
-    url: '/bz/data/type/save',
+    url: '/place/category/save',
     method: 'post',
     data
   })
@@ -18,7 +18,7 @@ export function save(data) {
 
 export function updateById(id, data) {
   return request({
-    url: '/bz/data/type/updateById',
+    url: '/place/category/updateById',
     method: 'post',
     params: { id },
     data
@@ -27,7 +27,7 @@ export function updateById(id, data) {
 
 export function deleteByIds(ids) {
   return request({
-    url: '/bz/data/type/deleteByIds',
+    url: '/place/category/deleteByIds',
     method: 'post',
     data: ids
   })

+ 4 - 4
src/api/place/category_extend_column.js

@@ -2,7 +2,7 @@ import request from '@/utils/request'
 
 export function findPage(data) {
   return request({
-    url: '/bz/data/type/extend/column/findPage',
+    url: '/place/category/extend/column/findPage',
     method: 'post',
     data
   })
@@ -10,7 +10,7 @@ export function findPage(data) {
 
 export function save(data) {
   return request({
-    url: '/bz/data/type/extend/column/save',
+    url: '/place/category/extend/column/save',
     method: 'post',
     data
   })
@@ -18,7 +18,7 @@ export function save(data) {
 
 export function updateById(id, data) {
   return request({
-    url: '/bz/data/type/extend/column/updateById',
+    url: '/place/category/extend/column/updateById',
     method: 'post',
     params: { id },
     data
@@ -27,7 +27,7 @@ export function updateById(id, data) {
 
 export function deleteByIds(ids) {
   return request({
-    url: '/bz/data/type/extend/column/deleteByIds',
+    url: '/place/category/extend/column/deleteByIds',
     method: 'post',
     data: ids
   })

+ 68 - 0
src/layout/components/ChangePasswordForm.vue

@@ -0,0 +1,68 @@
+<template>
+  <el-dialog
+    v-if="visible"
+    title="修改登录密码"
+    width="400px"
+    :visible.sync="visible"
+    :modal-append-to-body="false"
+  >
+    <el-form v-loading="isLoading" :model="form">
+      <el-form-item>
+        <el-input v-model="form.loginPassword" type="password" placeholder="请输入原登录密码"/>
+      </el-form-item>
+      <el-form-item>
+        <el-input v-model="form.newPassword" type="password" placeholder="请输入新的登录密码"/>
+      </el-form-item>
+      <el-form-item>
+        <el-input v-model="form.confirmPassword" type="password" placeholder="请再次输入新的登录密码"/>
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="visible = false">取 消</el-button>
+      <el-button type="primary" @click="handleSubmit">确 定</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+
+import { changePassword } from '@/api/oauth'
+
+export default {
+  components: {},
+  data() {
+    return {
+      isLoading: false,
+      visible: false,
+      form: {
+        loginPassword: '',
+        newPassword: '',
+        confirmPassword: ''
+      }
+    }
+  },
+  mounted() {
+  },
+  methods: {
+    open() {
+      this.visible = true
+      this.form = {
+        loginPassword: '',
+        newPassword: '',
+        confirmPassword: ''
+      }
+    },
+    handleSubmit() {
+      console.log('>>>>>>>>>>>>', this.form)
+      this.isLoading = true
+      changePassword(this.form).then(res => {
+        console.log(res)
+        this.visible = false
+        this.$emit('ok')
+      }).finally(() => {
+        this.isLoading = false
+      })
+    }
+  }
+}
+</script>

+ 11 - 6
src/layout/components/Navbar.vue

@@ -6,28 +6,27 @@
       @toggleClick="toggleSideBar"
     />
 
-    <breadcrumb class="breadcrumb-container" />
+    <breadcrumb class="breadcrumb-container"/>
 
     <div class="right-menu">
       <el-dropdown class="right-container" trigger="click">
         <a>
           {{ oauthInfo && oauthInfo.nickName }}
-          <i class="el-icon-caret-bottom" />
+          <i class="el-icon-caret-bottom"/>
         </a>
 
         <el-dropdown-menu slot="dropdown" class="user-dropdown">
           <router-link to="/">
             <el-dropdown-item> 首页</el-dropdown-item>
           </router-link>
-          <router-link to="/">
-            <el-dropdown-item>修改登录密码</el-dropdown-item>
-          </router-link>
+          <el-dropdown-item @click.native="changePasswd">修改登录密码</el-dropdown-item>
           <el-dropdown-item divided @click.native="logout">
             <span style="display: block">注销登录</span>
           </el-dropdown-item>
         </el-dropdown-menu>
       </el-dropdown>
     </div>
+    <change-password-form ref="changePasswordForm"/>
   </div>
 </template>
 
@@ -35,11 +34,13 @@
 import { mapGetters } from 'vuex'
 import Breadcrumb from '@/components/Breadcrumb'
 import Hamburger from '@/components/Hamburger'
+import ChangePasswordForm from './ChangePasswordForm'
 
 export default {
   components: {
     Breadcrumb,
-    Hamburger
+    Hamburger,
+    ChangePasswordForm
   },
   computed: {
     ...mapGetters(['sidebar', 'oauthInfo'])
@@ -51,6 +52,10 @@ export default {
     async logout() {
       await this.$store.dispatch('user/logout')
       this.$router.push(`/login?redirect=${this.$route.fullPath}`)
+    },
+    changePasswd() {
+      console.log('>>>>>>>>')
+      this.$refs.changePasswordForm.open()
     }
   }
 }

+ 1 - 1
src/layout/components/Sidebar/Logo.vue

@@ -24,7 +24,7 @@ export default {
   },
   data() {
     return {
-      title: '数据中心开放平台',
+      title: '数据资源中心',
       logo: undefined
     }
   }

+ 1 - 1
src/settings.js

@@ -1,6 +1,6 @@
 module.exports = {
 
-  title: '数据中心开放平台',
+  title: '数据资源中心',
 
   /**
    * @type {boolean} true | false

+ 1 - 1
src/views/login/index.vue

@@ -2,7 +2,7 @@
   <div class="login-container">
     <el-card :body-style="{padding:0}" shadow="none">
       <div slot="header" class="clearfix">
-        <span>数据中心开放平台</span>
+        <span>数据资源中心</span>
         <div style="float: right; color: #666666">
           服务热线:<span style="color: #FF970F;font-weight: bold">400-698-5980</span>
         </div>