Browse Source

初始化

master
jianglong 3 years ago
parent
commit
5f5aabea19
  1. 16
      application/admin/controller/general/Profile.php
  2. 1
      application/admin/controller/qingdong/department/Staff.php
  3. 1
      application/admin/library/Auth.php
  4. 8
      application/admin/view/general/profile/index.html
  5. 1
      application/admin/view/index/login.html
  6. 3
      application/admin/view/index/register.html
  7. 4
      application/admin/view/qingdong/product/company/edit.html
  8. 5
      application/common/controller/Backend.php
  9. 2
      application/config.php

16
application/admin/controller/general/Profile.php

@ -59,13 +59,13 @@ class Profile extends Backend
// if (!Validate::is($params['email'], "email")) { // if (!Validate::is($params['email'], "email")) {
// $this->error(__("Please input correct email")); // $this->error(__("Please input correct email"));
// } // }
// if (isset($params['password'])) { if (isset($params['password'])) {
// if (!Validate::is($params['password'], "/^[\S]{6,30}$/")) { if (!Validate::is($params['password'], "/^[\S]{6,30}$/")) {
// $this->error(__("Please input correct password")); $this->error(__("Please input correct password"));
// } }
// $params['salt'] = Random::alnum(); $params['salt'] = Random::alnum();
// $params['password'] = md5(md5($params['password']) . $params['salt']); $params['password'] = md5(md5($params['password']) . $params['salt']);
// } }
// $exist = Admin::where('email', $params['email'])->where('id', '<>', $this->auth->id)->find(); // $exist = Admin::where('email', $params['email'])->where('id', '<>', $this->auth->id)->find();
// if ($exist) { // if ($exist) {
// $this->error(__("Email already exists")); // $this->error(__("Email already exists"));
@ -73,7 +73,7 @@ class Profile extends Backend
if ($params) { if ($params) {
$admin = Session::get('admin')?Session::get('admin'):Session::get('member'); $admin = Session::get('admin')?Session::get('admin'):Session::get('member');
if(!$admin){ if(!$admin){
$this->redirect('index/register', [], 302); $this->redirect('index/login', [], 302);
} }
$admin = Admin::get($admin['id']); $admin = Admin::get($admin['id']);

1
application/admin/controller/qingdong/department/Staff.php

@ -173,7 +173,6 @@ class Staff extends Base {
} }
Db::commit(); Db::commit();
}catch (Exception $e){ }catch (Exception $e){
var_dump($e);
Db::rollback(); Db::rollback();
$this->error($e->getMessage()); $this->error($e->getMessage());
} }

1
application/admin/library/Auth.php

@ -156,7 +156,6 @@ class Auth extends \fast\Auth
{ {
$admin = Admin::get(intval($this->id)); $admin = Admin::get(intval($this->id));
if ($admin) { if ($admin) {
var_dump(111122222);
$admin->token = ''; $admin->token = '';
$admin->save(); $admin->save();
} }

8
application/admin/view/general/profile/index.html

@ -75,10 +75,10 @@
<label for="nickname" class="control-label">{:__('Nickname')}:</label> <label for="nickname" class="control-label">{:__('Nickname')}:</label>
<input type="text" class="form-control" id="nickname" name="row[nickname]" value="{$admin.nickname|htmlentities}" data-rule="required"/> <input type="text" class="form-control" id="nickname" name="row[nickname]" value="{$admin.nickname|htmlentities}" data-rule="required"/>
</div> </div>
<!-- <div class="form-group">--> <div class="form-group">
<!-- <label for="password" class="control-label">{:__('Password')}:</label>--> <label for="password" class="control-label">{:__('Password')}:</label>
<!-- <input type="password" class="form-control" id="password" placeholder="{:__('Leave password blank if dont want to change')}" autocomplete="new-password" name="row[password]" value="" data-rule="password"/>--> <input type="password" class="form-control" id="password" placeholder="{:__('Leave password blank if dont want to change')}" autocomplete="new-password" name="row[password]" value="" data-rule="password"/>
<!-- </div>--> </div>
<div class="form-group"> <div class="form-group">
<button type="submit" class="btn btn-primary">{:__('Submit')}</button> <button type="submit" class="btn btn-primary">{:__('Submit')}</button>
<button type="reset" class="btn btn-default">{:__('Reset')}</button> <button type="reset" class="btn btn-default">{:__('Reset')}</button>

1
application/admin/view/index/login.html

@ -133,6 +133,7 @@
</div> </div>
<!--@AdminLoginFormEnd--> <!--@AdminLoginFormEnd-->
</form> </form>
<a href="{:url('index/register')}" style="color:#899fe1;">切换手机号登录</a>
</div> </div>
</div> </div>
</div> </div>

3
application/admin/view/index/register.html

@ -96,6 +96,7 @@
</div> </div>
<div class="login-form"> <div class="login-form">
<img id="profile-img" class="profile-img-card" src="__CDN__/assets/img/avatar.png"/> <img id="profile-img" class="profile-img-card" src="__CDN__/assets/img/avatar.png"/>
<p id="profile-name" class="profile-name-card"></p> <p id="profile-name" class="profile-name-card"></p>
<form action="" method="post" id="login-form"> <form action="" method="post" id="login-form">
@ -116,9 +117,11 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<button type="button" class="btn btn-success btn-lg btn-block" style="background:#899fe1;">{:__('Sign in')}</button> <button type="button" class="btn btn-success btn-lg btn-block" style="background:#899fe1;">{:__('Sign in')}</button>
</div> </div>
<!--@AdminLoginFormEnd--> <!--@AdminLoginFormEnd-->
</form> </form>
<a href="{:url('index/login')}" style="color:#899fe1;">切换账号密码登录</a>
</div> </div>
</div> </div>
</div> </div>

4
application/admin/view/qingdong/product/company/edit.html

@ -15,7 +15,7 @@
<div class="col-xs-12 col-sm-12"> <div class="col-xs-12 col-sm-12">
<div class="form-group col-sm-10"> <div class="form-group col-sm-10">
<label for="c-nickname">联系人:</label> <label for="c-nickname">联系人:</label>
<input id="c-nickname" data-rule="required" class="form-control" placeholder="请输入企业名称" name="row[nickname]" <input id="c-nickname" data-rule="required" class="form-control" placeholder="请输入企业联系人" name="row[nickname]"
type="text" value="{$row.nickname|htmlentities}"> type="text" value="{$row.nickname|htmlentities}">
</div> </div>
</div> </div>
@ -23,7 +23,7 @@
<div class="col-xs-12 col-sm-12"> <div class="col-xs-12 col-sm-12">
<div class="form-group col-sm-10"> <div class="form-group col-sm-10">
<label for="c-mobile">联系方式:</label> <label for="c-mobile">联系方式:</label>
<input id="c-mobile" data-rule="required" class="form-control" placeholder="请输入企业名称" name="row[mobile]" <input id="c-mobile" data-rule="required" class="form-control" placeholder="请输入企业联系方式" name="row[mobile]"
type="text" value="{$row.mobile|htmlentities}"> type="text" value="{$row.mobile|htmlentities}">
</div> </div>
</div> </div>

5
application/common/controller/Backend.php

@ -158,16 +158,15 @@ class Backend extends Controller
// 检测是否需要验证登录 // 检测是否需要验证登录
if (!$this->auth->match($this->noNeedLogin)) { if (!$this->auth->match($this->noNeedLogin)) {
//检测是否登录 //检测是否登录
var_dump($admin);
if (!$this->auth->isLogin() && !$this->auth->isMemberLogin()) { if (!$this->auth->isLogin() && !$this->auth->isMemberLogin()) {
Hook::listen('admin_nologin', $this); Hook::listen('admin_nologin', $this);
$url = Session::get('referer'); $url = Session::get('referer');
$url = $url ? $url : $this->request->url(); $url = $url ? $url : $this->request->url();
if (in_array($this->request->pathinfo(), ['/', 'index/index'])) { if (in_array($this->request->pathinfo(), ['/', 'index/index'])) {
$this->redirect('index/register', [], 302, ['referer' => $url]); $this->redirect('index/login', [], 302, ['referer' => $url]);
exit; exit;
} }
$this->error(__('Please login first'), url('index/register', ['url' => $url])); $this->error(__('Please login first'), url('index/login', ['url' => $url]));
} }
// // 判断是否需要验证权限 // // 判断是否需要验证权限

2
application/config.php

@ -277,7 +277,7 @@ return [
//登录页默认背景图 //登录页默认背景图
'login_background' => "", 'login_background' => "",
//是否启用多级菜单导航 //是否启用多级菜单导航
'multiplenav' => false, 'multiplenav' => true,
//是否开启多选项卡(仅在开启多级菜单时起作用) //是否开启多选项卡(仅在开启多级菜单时起作用)
'multipletab' => true, 'multipletab' => true,
//是否默认展示子菜单 //是否默认展示子菜单

Loading…
Cancel
Save