2018.03.05

项目初始化配置

  • setup git clone --depth=1 https://github.com/cipchk/ng-alain.git my-project

  • install npm ci (with npm v5.7.0, new)

  • set start scripts

    add proxy.config.json to src/

      {
          "/": {
              "target": "http://127.0.0.1:3000",
              "secure": false,
              "pathRewrite": {
                  "^/": ""
              },
              "changeOrigin": true
          }
      }
    

    update package.json

      scripts: {
          "start": "ng serve -o -proxy-config proxy.config.json",
      }
    
  • update assets resouce
    1. in file: src/assets/app-data.json
      ...
           "children": [
               {
                   "text": "仪表盘",
                   "translate": "dashboard",
                   "link": "/dashboard",
                   "icon": "icon-speedometer",
                   "children": [{
                       "text": "Workplace",
                       "link": "/dashboard/workplace",
                       "translate": "dashboard_workplace"
                   }]
               }, {
                   "text": "菜品",
                   "link": "/dishes/list",
                   "icon": "icon-speedometer"
               }
           ]
      ...
      
    2. add an image file: ydd-logo.png
    3. replace the file: favicon.ico
    4. update the file: src/index.html => title: 肴点点
  • remove useless template( src/app/routes/) folders: analysis, charts, data-v, editor, elements, extras, forms, logic, pro, maps, monitor, tables, widgets

  • update removed-template-componentsdate routes-routing.modules.ts and routes.modules.ts

    just remove these declarations of removed-template-components and remove its routing path configs.

  • update layout template

  • add DishesList Page and remove Github Page, Lock Page at src/layout/default/header/header.component.html

     <!-- add this -->
     <li>
         <div class="item">
             <span [routerLink]="['/dishes/list']">项目</span>
         </div>
     </li>
     <!-- remove Github Page, Lock Page -->
    
  • update site-logo, site-name, copyright info in file src/layout/passport/passport.component.html
    <!-- modify logo -->
    <!-- <img class="logo" src="./assets/img/logo-color.svg"> -->
    <img class="logo" src="./assets/img/ydd-logo.png">
    <span class="title">肴点点</span>

    <!-- modify copyright info -->
    <ng-template #copyright>
        Copyright <nz-icon nzType="copyright"></nz-icon> 2018 肴点点出品
    </ng-template>

认证模块开发

  • add AuthService to CoreModule: ng g s core/pwd/auth

  • update LoginComponent's form model and rebind view

  • update RegisterComponent's form model and rebind view

解决 git shallow update not allowed 问题的方法

 ydd-mgr git:(master) git push -u origin master
 Counting objects: 525, done.
 Delta compression using up to 4 threads.
 Compressing objects: 100% (433/433), done.
 Writing objects: 100% (525/525), 3.24 MiB | 1.20 MiB/s, done.
 Total 525 (delta 120), reused 454 (delta 83)
 remote: Resolving deltas: 100% (120/120), done.
 To https://git.coding.net/Cansion/ydd-mgr.git
  ! [remote rejected] master -> master (shallow update not allowed)

As it seems you have used git clone --depth to clone your local version. This results in a shallow clone. One limitation of such a clone is that you can't push from it into a new repository. This means that you have to unshallow your repository. To do so you will need to add your old remote again.

  • git remote add old <path-to-old-remote>
  • git fetch --unshallow old

results matching ""

    No results matching ""