Browse Source

增加姓名字段

star7th 7 years ago
parent
commit
dabdbcd558

+ 1 - 1
server/Application/Api/Controller/MemberController.class.php

@@ -57,7 +57,7 @@ class MemberController extends BaseController {
             return ;
         } 
         if ($item_id > 0 ) {
-            $ret = D("ItemMember")->where(" item_id = '$item_id' ")->order(" addtime asc  ")->select();
+            $ret = D("ItemMember")->where(" item_id = '$item_id' ")->join(" left join user on user.uid = item_member.uid")->field("item_member.* , user.name as name")->order(" addtime asc  ")->select();
         }
         if ($ret) {
             foreach ($ret as $key => &$value) {

+ 1 - 1
server/Application/Api/Controller/TeamMemberController.class.php

@@ -69,7 +69,7 @@ class TeamMemberController extends BaseController {
         }
 
         if ($login_user['uid'] > 0 ) {
-            $ret = D("TeamMember")->where(" team_id = '$team_id' ")->order(" addtime desc  ")->select();
+            $ret = D("TeamMember")->where(" team_id = '$team_id' ")->join(" left join user on user.uid = team_member.member_uid")->field("team_member.* , user.name as name")->order(" addtime desc  ")->select();
         }
         if ($ret) {
             foreach ($ret as $key => &$value) {

+ 13 - 0
server/Application/Api/Controller/UserController.class.php

@@ -140,4 +140,17 @@ class UserController extends BaseController {
         $this->sendResult(array());
     }
 
+
+    public function updateInfo(){
+        $user = $this->checkLogin();
+        $uid = $user['uid'];
+        $name = I("name");
+
+        D("User")->where(" uid = '$uid' ")->save(array("name"=>$name));
+        $this->sendResult(array());
+
+    }
+
+
+
 }

+ 1 - 1
web/index.html

@@ -4,4 +4,4 @@
       "server": window.location.protocol +'//'+ window.location.host + window.location.pathname+ '../server/index.php?s=',
       //"lang" :'en'
       "lang" :'zh-cn'
-  }</script><link href=./static/css/app.7e2db271ee332e946dca288cb805f554.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.de5d312ffd15b4b84336.js></script><script type=text/javascript src=./static/js/vendor.89634a082eb5b01cb6e2.js></script><script type=text/javascript src=./static/js/app.3485cc80a2952e6ea112.js></script></body></html>
+  }</script><link href=./static/css/app.c653dea580ee73f37d03fd14bd03157f.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.441dac1e7e9622d50c15.js></script><script type=text/javascript src=./static/js/vendor.89634a082eb5b01cb6e2.js></script><script type=text/javascript src=./static/js/app.774555ecb0686c3104ad.js></script></body></html>

File diff suppressed because it is too large
+ 0 - 0
web/static/css/app.7e2db271ee332e946dca288cb805f554.css


File diff suppressed because it is too large
+ 0 - 0
web/static/css/app.c653dea580ee73f37d03fd14bd03157f.css


File diff suppressed because it is too large
+ 0 - 0
web/static/js/app.3485cc80a2952e6ea112.js


File diff suppressed because it is too large
+ 0 - 0
web/static/js/app.774555ecb0686c3104ad.js


+ 1 - 1
web/static/js/manifest.de5d312ffd15b4b84336.js → web/static/js/manifest.441dac1e7e9622d50c15.js

@@ -1 +1 @@
-!function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(t,c,a){for(var i,u,f,s=0,l=[];s<t.length;s++)u=t[s],o[u]&&l.push(o[u][0]),o[u]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(r&&r(t,c,a);l.length;)l.shift()();if(a)for(s=0;s<a.length;s++)f=n(n.s=a[s]);return f};var t={},o={2:0};n.e=function(e){function r(){i.onerror=i.onload=null,clearTimeout(u);var n=o[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),o[e]=void 0)}var t=o[e];if(0===t)return new Promise(function(e){e()});if(t)return t[2];var c=new Promise(function(n,r){t=o[e]=[n,r]});t[2]=c;var a=document.getElementsByTagName("head")[0],i=document.createElement("script");i.type="text/javascript",i.charset="utf-8",i.async=!0,i.timeout=12e4,n.nc&&i.setAttribute("nonce",n.nc),i.src=n.p+"static/js/"+e+"."+{0:"89634a082eb5b01cb6e2",1:"3485cc80a2952e6ea112"}[e]+".js";var u=setTimeout(r,12e4);return i.onerror=i.onload=r,a.appendChild(i),c},n.m=e,n.c=t,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="./",n.oe=function(e){throw console.error(e),e}}([]);
+!function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(t,c,a){for(var i,u,f,s=0,l=[];s<t.length;s++)u=t[s],o[u]&&l.push(o[u][0]),o[u]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(r&&r(t,c,a);l.length;)l.shift()();if(a)for(s=0;s<a.length;s++)f=n(n.s=a[s]);return f};var t={},o={2:0};n.e=function(e){function r(){i.onerror=i.onload=null,clearTimeout(u);var n=o[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),o[e]=void 0)}var t=o[e];if(0===t)return new Promise(function(e){e()});if(t)return t[2];var c=new Promise(function(n,r){t=o[e]=[n,r]});t[2]=c;var a=document.getElementsByTagName("head")[0],i=document.createElement("script");i.type="text/javascript",i.charset="utf-8",i.async=!0,i.timeout=12e4,n.nc&&i.setAttribute("nonce",n.nc),i.src=n.p+"static/js/"+e+"."+{0:"89634a082eb5b01cb6e2",1:"774555ecb0686c3104ad"}[e]+".js";var u=setTimeout(r,12e4);return i.onerror=i.onload=r,a.appendChild(i),c},n.m=e,n.c=t,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="./",n.oe=function(e){throw console.error(e),e}}([]);

+ 4 - 1
web/static/lang/en.js

@@ -43,7 +43,7 @@ exports.default = {
     'status_2':'未验证',
     'status_3':'未绑定',
     'binding':'绑定',
-    'modify':'修改',
+    'modify':'modify',
     'modify_password':'modify password',
     'old_password':'old password',
     'new_password':'new password',
@@ -248,4 +248,7 @@ exports.default = {
     "web_setting":"web setting",
     "register_open_label":"register open",
     "ldap_open_label":"ldap login",
+
+    "name":"name",
+    "name_tips":"your real name",
 };

+ 3 - 0
web/static/lang/zh-CN.js

@@ -255,4 +255,7 @@ exports.default = {
     "register_open_label":"开放用户注册",
     "ldap_open_label":"启用ldap登录",
 
+    "name":"姓名",
+    "name_tips":"推荐使用真实姓名",
+
 };

+ 11 - 1
web_src/src/components/item/Index.vue

@@ -188,7 +188,17 @@ export default {
           });
     },
     feedback(){
-      window.open('https://github.com/star7th/showdoc/issues');
+      if (DocConfig.lang =='en') {
+        window.open('https://github.com/star7th/showdoc/issues');
+      }else{
+        var msg = "你正在使用免费开源版showdoc,如有问题或者建议,请到github提issue:";
+        msg += "<a href='https://github.com/star7th/showdoc/issues' target='_blank'>https://github.com/star7th/showdoc/issues</a><br>";
+        msg += "如果你觉得showdoc好用,不妨给开源项目点一个star。良好的关注度和参与度有助于开源项目的长远发展。";
+        this.$alert(msg, {
+            dangerouslyUseHTMLString: true
+        });
+      }
+
     },
     item_top_class(top){
       if (top) {

+ 5 - 0
web_src/src/components/item/setting/Member.vue

@@ -14,6 +14,11 @@
             :label="$t('member_username')"
             width="100">
           </el-table-column>
+          <el-table-column
+            prop="name"
+            :label="$t('name')"
+            >
+          </el-table-column>
           <el-table-column
             prop="addtime"
             :label="$t('add_time')"

+ 6 - 1
web_src/src/components/team/Member.vue

@@ -15,6 +15,11 @@
               :label="$t('member_username')"
               >
             </el-table-column>
+            <el-table-column
+              prop="name"
+              :label="$t('name')"
+              >
+            </el-table-column>
             <el-table-column
               prop="addtime"
               :label="$t('addtime')"
@@ -23,7 +28,7 @@
 
             <el-table-column
               prop=""
-              width="180"
+              width="50"
               :label="$t('operation')">
               <template slot-scope="scope">
                 <el-button @click="deleteTeamMember(scope.row.id)" type="text" size="small">{{$t('delete')}}</el-button>

+ 90 - 47
web_src/src/components/user/Setting.vue

@@ -4,38 +4,65 @@
 
     <el-container>
           <el-card class="center-card">
-          <template>
             <router-link class="goback-btn "to="/item/index">{{$t('goback')}}</router-link>
-            <el-tabs  value="first" type="card">
-            
-              <el-tab-pane :label="$t('modify_password')" name="first">
-
-                <el-form  status-icon  label-width="0px" class="passwordForm" v-model="passwordForm">
-                  <el-form-item label="" >
-                    <el-input type="text" auto-complete="off" v-model="passwordForm.username" placeholder="" :disabled="true"></el-input>
+                <el-form  status-icon  label-width="75px" class="infoForm" v-model="infoForm">
+                  <el-form-item :label="$t('username')+':'" >
+                      <el-input type="text" auto-complete="off" v-model="infoForm.username" :disabled="true" placeholder="" ></el-input>
                   </el-form-item>
-                  <el-form-item label="" >
-                    <el-input type="password" auto-complete="off" :placeholder="$t('old_password')" v-model="passwordForm.password"></el-input>
+                  <!-- 
+                  <el-form-item :label="$t('email')+':'" >
+                       <span>{{emailForm.email}}({{emailForm.status}})</span> <a href="javasript:;" @click="dialogEmailFormVisible = true">{{$t("modify")}}</a>
                   </el-form-item>
-
-                  <el-form-item label="" >
-                    <el-input type="password" auto-complete="off" v-model="passwordForm.new_password" :placeholder="$t('new_password')"></el-input>
+                  -->
+                  <el-form-item :label="$t('name')+':'" >
+                      <el-input type="text" auto-complete="off" v-model="infoForm.name" :placeholder="$t('name_tips')" ></el-input>
                   </el-form-item>
 
-                   <el-form-item label="" >
-                    <el-button type="primary" style="width:100%;" @click="passwordFormSubmit" >{{$t('submit')}}</el-button>
+                  <el-form-item :label="$t('password')+':'">
+                      <a href="javasript:;" @click="dialogPasswordFormVisible = true">{{$t("modify")}}</a>
                   </el-form-item>
 
-                </el-form>
-
-            </el-tab-pane>
+                    <el-button type="primary" style="width:100%;" @click="formSubmit" >{{$t('submit')}}</el-button>
 
 
-            </el-tabs>
-          </template>
+                </el-form>
           </el-card>
     </el-container>
 
+    <!-- 修改email弹窗 -->
+    <el-dialog :visible.sync="dialogEmailFormVisible" top="10vh" width="300px">
+      <el-form class="emailForm">
+          <el-form-item label="" >
+            <el-input type="text" auto-complete="off" :placeholder="$t('input_email')" v-model="emailForm.email"></el-input>
+          </el-form-item>
+
+          <el-form-item label="" >
+            <el-input type="password" auto-complete="off" v-model="emailForm.password" :placeholder="$t('input_login_password')"></el-input>
+          </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogEmailFormVisible = false">{{$t('cancel')}}</el-button>
+        <el-button type="primary" @click="emailFormSubmit" >{{$t('confirm')}}</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 修改密码弹窗 -->
+    <el-dialog :visible.sync="dialogPasswordFormVisible" top="10vh" width="300px">
+      <el-form class="emailForm">
+            <el-form-item label="" >
+              <el-input type="password" auto-complete="off" :placeholder="$t('old_password')" v-model="passwordForm.password"></el-input>
+            </el-form-item>
+
+            <el-form-item label="" >
+              <el-input type="password" auto-complete="off" v-model="passwordForm.new_password" :placeholder="$t('new_password')"></el-input>
+            </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogPasswordFormVisible = false">{{$t('cancel')}}</el-button>
+        <el-button type="primary" @click="passwordFormSubmit" >{{$t('confirm')}}</el-button>
+      </div>
+    </el-dialog>
+
     <Footer> </Footer>
     
   </div>
@@ -51,20 +78,23 @@ export default {
   },
   data () {
     return {
-      passwordForm:{
+      infoForm:{
         username:'',
-        password:'',
-        new_password:''
+        name:'',
+      },
+      userInfo:{
+
       },
       emailForm:{
-        status:'',
         email:'',
+        status:'',
+      },
+      passwordForm:{
         password:'',
-        submit_text:''
+        new_password:'',
       },
-      userInfo:{
-
-      }
+      dialogEmailFormVisible:false,
+      dialogPasswordFormVisible:false,
     }
 
   },
@@ -81,17 +111,18 @@ export default {
               that.userInfo =  userInfo;
               that.passwordForm.username = userInfo.username;
               that.emailForm.email = userInfo.email ;
-              var status = that.$t("status")+':';
+              that.infoForm.username = userInfo.username ;
+              that.infoForm.name = userInfo.name ;
               if (userInfo.email.length > 0 ) {
                 that.emailForm.submit_text =that.$t("modify") ;
                 if (userInfo.email_verify > 0 ) {
-                  status += that.$t("status_1");
+                  status = that.$t("status_1");
 
                 }else{
-                  status += that.$t("status_2");
+                  status = that.$t("status_2");
                 }
               }else{
-                status += that.$t("status_3");
+                status = that.$t("status_3");
                 that.emailForm.submit_text =that.$t("binding") ;
               }
               that.emailForm.status = status ;
@@ -115,14 +146,11 @@ export default {
           that.axios.post(url, params)
             .then(function (response) {
               if (response.data.error_code === 0 ) {
-                that.$message.success(that.$t("modify_success"));
+                that.dialogPasswordFormVisible = false;
               }else{
                 that.$alert(response.data.error_message);
               }
               
-            })
-            .catch(function (error) {
-              console.log(error);
             });
       },
       emailFormSubmit(){
@@ -136,17 +164,31 @@ export default {
           that.axios.post(url, params)
             .then(function (response) {
               if (response.data.error_code === 0 ) {
-                that.$alert(that.$t("update_email_success"));
+                that.dialogEmailFormVisible = false;
+                this.get_user_info();
+              }else{
+                that.$alert(response.data.error_message);
+              }
+            });
+      },
+      formSubmit(){
+          var that = this ;
+          var url = DocConfig.server+'/api/user/updateInfo';
+
+          var params = new URLSearchParams();
+          params.append('name', this.infoForm.name);
+
+          that.axios.post(url, params)
+            .then(function (response) {
+              if (response.data.error_code === 0 ) {
+                that.$message.success(that.$t("modify_success"));
                 this.get_user_info();
               }else{
                 that.$alert(response.data.error_message);
               }
               
-            })
-            .catch(function (error) {
-              console.log(error);
             });
-      }
+      },
   },
 
   mounted(){
@@ -177,14 +219,15 @@ export default {
   height: 500px;
 }
 
-.passwordForm,.emailForm{
-  width:300px;
-  margin: 0 auto ;
-  margin-top: 50px;
-}
-
 .goback-btn{
   z-index: 999;
   margin-left: 500px;
 }
+
+.infoForm{
+  width: 350px;
+  margin: 0 auto ;
+  margin-top: 30px;
+  text-align: left;
+}
 </style>

+ 4 - 1
web_src/static/lang/en.js

@@ -43,7 +43,7 @@ exports.default = {
     'status_2':'未验证',
     'status_3':'未绑定',
     'binding':'绑定',
-    'modify':'修改',
+    'modify':'modify',
     'modify_password':'modify password',
     'old_password':'old password',
     'new_password':'new password',
@@ -248,4 +248,7 @@ exports.default = {
     "web_setting":"web setting",
     "register_open_label":"register open",
     "ldap_open_label":"ldap login",
+
+    "name":"name",
+    "name_tips":"your real name",
 };

+ 3 - 0
web_src/static/lang/zh-CN.js

@@ -255,4 +255,7 @@ exports.default = {
     "register_open_label":"开放用户注册",
     "ldap_open_label":"启用ldap登录",
 
+    "name":"姓名",
+    "name_tips":"推荐使用真实姓名",
+
 };

Some files were not shown because too many files changed in this diff