Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
repair_workers_h5
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
石盼盼
repair_workers_h5
Commits
128fd00c
Commit
128fd00c
authored
Aug 27, 2021
by
郭欢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'登录流程,'
parent
81a16d36
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
220 deletions
+50
-220
apiList.js
src/api/apiList.js
+9
-94
index.js
src/router/index.js
+40
-116
login.vue
src/views/login/login.vue
+1
-10
No files found.
src/api/apiList.js
View file @
128fd00c
...
...
@@ -13,113 +13,28 @@ const h5Url = 'https://repair.zeruiedu.com' // 测试h5线上地址
// const httpUrl = 'https://fenghexm.xueyoubangedu.com' // 正式接口
// const h5Url = 'http://depository.fhxmcy.com' // 正式h5线上地址
const
wxLogin
=
'
/api/worker/login
'
// 微信登录获取token、登录状态
const
curScope
=
'
scopes=snsapi_base&type=1
'
export
default
{
// url地址
WINDOWHREF_LOGIN
:
`
${
httpUrl
}
/api/scm/login?callBack=
${
h5Url
}
/login&scopes=snsapi_base&type=1`
,
WINDOWHREF_LOGIN_
ROUTE
:
`
${
httpUrl
}
/api/scm/login?callBack=
${
window
.
location
.
href
}
&scopes=snsapi_base&type=1`
,
WINDOWHREF_INDEX
:
`
${
httpUrl
}
/api/scm/login?callBack=
${
h5Url
}
&scopes=snsapi_base&type=1`
,
WINDOWHREF_ASK
:
`
${
httpUrl
}
/api/scm/login?callBack=
${
h5Url
}
&scopes=snsapi_userinfo&type=1`
,
WINDOWHREF_LOGIN
:
`
${
httpUrl
}
${
wxLogin
}
?callBack=
${
h5Url
}
/login&
${
curScope
}
`
,
// 身份失效跳转的登录
WINDOWHREF_LOGIN_
TOKEN
:
`
${
httpUrl
}${
wxLogin
}
?callBack=
${
window
.
location
.
href
}
&
${
curScope
}
`
,
// 获取token和登录状态
WINDOWHREF_INDEX
:
`
${
httpUrl
}
${
wxLogin
}
?callBack=
${
h5Url
}
&
${
curScope
}
`
,
//
WINDOWHREF_ASK
:
`
${
httpUrl
}
${
wxLogin
}
?callBack=
${
h5Url
}
&scopes=snsapi_userinfo&type=1`
,
// 绑定后用户进行授权
// 登录相关
SENDCODE
:
baseUrl
+
'
/worker/send
'
,
// 发送验证码
BINDLOGIN
:
baseUrl
+
'
/worker/bind/login
'
,
// 手机号验证码登录绑定微信
USERINFO
:
baseUrl
+
'
/worker/user/info
'
,
// 获取用户信息
REPAIR_LIST
:
baseUrl
+
'
/worker/repair/list
'
,
// 工人/审核员端报修单列表
ORDER_STATUS
:
baseUrl
+
'
/worker/repair/order/status
'
,
// 获取订单状态
REPAIR_BEGIN
:
baseUrl
+
'
/worker/repair/begin
'
,
// 开始维修接口
REPAIR_ORDER_DETAIL
:
baseUrl
+
'
/worker/repair/order/detail
'
,
// 报修单详情
REPAIR_ORDER
:
baseUrl
+
'
/worker/material/order
'
,
// 发起收费生成耗材单
MATERIAL_REMARK
:
baseUrl
+
'
/worker/material/remark
'
,
// 备注耗材
MATERIAL_REMARK
:
baseUrl
+
'
/worker/material/remark
'
// 备注耗材
// BINDLOGINTWO: baseUrl + '/scm/bind/login/two', // 绑定后台账号
// REFRESHTOKEN: baseUrl + '/scm/change/token', // 更新token
// LOGOUT: baseUrl + '/scm/logout', // 更新token
// 首页
WARNGOODS
:
baseUrl
+
'
/scm/warn_goods/today
'
,
// 今日预警
WARNGOODSADD
:
baseUrl
+
'
/scm/warn_goods/addCars
'
,
// 采购预警-点击将商品添加至购物车
SUPPLIER
:
baseUrl
+
'
/scm/supplier/my
'
,
// 机构列表
CHANGE_SUPPLIER
:
baseUrl
+
'
/scm/change_agency
'
,
// 切换机构
TIPSNUM
:
baseUrl
+
'
/scm/home/index
'
,
// 首页提示数量
// 消息
NOTICELIST
:
baseUrl
+
'
/scm/notice/list
'
,
// 消息
// 个人中心
WXLIST
:
baseUrl
+
'
/scm/supplier/wx_list
'
,
// 获取机构绑定的微信列表
SUPPLIWRDETAIL
:
baseUrl
+
'
/scm/supplier/detail
'
,
// 获取机构详情
// //////////////////// 筛选 列表 /////////////////////
PROVIDERLIST
:
baseUrl
+
'
/scm/purchase_return/get_providers
'
,
// 供应商列表
SHOPLIST
:
baseUrl
+
'
/scm/supplier_trade_return/get_shop_list
'
,
// 商铺列表
// //////////////////// 采购管理 /////////////////////
// 采购计划
CATE
:
baseUrl
+
'
/scm/cates
'
,
// 采购计划分类列表
CATEGOODS
:
baseUrl
+
'
/scm/goods
'
,
// 采购计划分类商品列表 搜索商品列表
CHANGECART
:
baseUrl
+
'
/scm/car_goods
'
,
// 更改购物车数量
CARTLIST
:
baseUrl
+
'
/scm/cars
'
,
// 购物车列表
CLEARCART
:
baseUrl
+
'
/scm/clear_car
'
,
// 清空购物车
ADDPLAN
:
baseUrl
+
'
/scm/add_plan
'
,
// 提交采购计划
PLANLIST
:
baseUrl
+
'
/scm/plan_list
'
,
// 采购计划列表
PURCHASE_DETAIL
:
baseUrl
+
'
/scm/purchase_detail
'
,
// 详情 1:采购计划,2:采购订单,3:入库订单
PLANAUDIT
:
baseUrl
+
'
/scm/audit
'
,
// 采购计划-审核
PLANDELETE
:
baseUrl
+
'
/scm/del
'
,
// 采购计划-删除
PLANBILLS
:
baseUrl
+
'
/scm/bills
'
,
// 相关单据
// 采购订单
PURORDERLIST
:
baseUrl
+
'
/scm/order_list
'
,
// 采购订单列表
PURORDERCANCEL
:
baseUrl
+
'
/scm/order_cancel
'
,
// 采购订单-取消
// 入库订单
ENTRYLIST
:
baseUrl
+
'
/scm/purchase/into/storehouses/list
'
,
// 入库订单列表
ENTRYGOODS
:
baseUrl
+
'
/scm/purchase/into/storehouses/goods
'
,
// 入库商品列表
ENTRYCHECK
:
baseUrl
+
'
/scm/order_store
'
,
// 验收入库详情
PURENTRY
:
baseUrl
+
'
/scm/order_intostore
'
,
// 验收入库
// //////////////////// 销售管理 /////////////////////
SALELIST
:
baseUrl
+
'
/scm/supplier_trade/list
'
,
// 销售列表
SALEDETAIL
:
baseUrl
+
'
/scm/supplier_trade/operation_out
'
,
// 销售详情
SALE_EDIT_DETAIL
:
baseUrl
+
'
/scm/supplier_trade/detail
'
,
// 销售编辑详情
SALE_EDIT_SAVE
:
baseUrl
+
'
/scm/supplier_trade/alter
'
,
// 销售编辑详情
SALEOUT
:
baseUrl
+
'
/scm/supplier_trade/out
'
,
// 验收出库
SALEGOODSLIST
:
baseUrl
+
'
/scm/supplier_trade_good/goods_list
'
,
// 销售商品
// //////////////////// 档案管理 /////////////////////
// 调价
ADJUSTPRICE
:
baseUrl
+
'
/scm/adjust/price/list
'
,
// 调价列表
ADJUSTPRICEDETAIL
:
baseUrl
+
'
/scm/adjust/price/detail
'
,
// 调价详情
ADJUSTPRICEGOODS
:
baseUrl
+
'
/scm/adjust/price/goods
'
,
// 调价商品列表
// 调库
ADJUSTSTOCK
:
baseUrl
+
'
/scm/adjust/stock/list
'
,
// 调库列表
ADJUSTSTOCKDETAIL
:
baseUrl
+
'
/scm/adjust/stock/detail
'
,
// 调库列表详情
ADJUSTSTOCKGOODS
:
baseUrl
+
'
/scm/adjust/stock/goods
'
,
// 调库商品列表
// //////////////////// 运维管理 /////////////////////
// 采购退货
PURCHASERETURN
:
baseUrl
+
'
/scm/purchase_return/list
'
,
// 采购退货列表
PURCHASERETURN_DETAIL
:
baseUrl
+
'
/scm/purchase_return/details
'
,
// 采购退货详情
PURCHASERETURN_CREATE
:
baseUrl
+
'
/scm/purchase_return/create
'
,
// 采购退货添加
PURCHASERETURN_DETELE
:
baseUrl
+
'
/scm/purchase_return/destroy
'
,
// 采购退货删除
PURCHASERETURN_EDIT
:
baseUrl
+
'
/scm/purchase_return/edit
'
,
// 采购退货编辑
PURCHASERETURN_CHECK
:
baseUrl
+
'
/scm/purchase_return/check
'
,
// 采购退货审核
// 销售退货
SALERETURN
:
baseUrl
+
'
/scm/supplier_trade_return/list
'
,
// 销售退货列表
SALERETURN_DETAIL
:
baseUrl
+
'
/scm/supplier_trade_return/details
'
,
// 销售退货详情
SALERETURN_CREATE
:
baseUrl
+
'
/scm/supplier_trade_return/create
'
,
// 销售退货添加
SALERETURN_EDIT
:
baseUrl
+
'
/scm/supplier_trade_return/edit
'
,
// 销售退货编辑
SALERETURN_DELETE
:
baseUrl
+
'
/scm/supplier_trade_return/destroy
'
,
// 销售退货删除
SALERETURN_CHECK
:
baseUrl
+
'
/scm/supplier_trade_return/check
'
,
// 销售退货审核
// 商品档案
GOODSCLASS
:
baseUrl
+
'
/scm/goods_record
'
,
// 商品档案列表
// 赠送入库
FREELIST
:
baseUrl
+
'
/scm/free/gift/storage/list
'
,
// 赠送入库列表
FREE_CREATE
:
baseUrl
+
'
/scm/free/gift/storage/stock
'
,
// 赠送入库新增
FREE_CHECK
:
baseUrl
+
'
/scm/free/gift/storage/check
'
,
// 赠送入库审核
FREE_DELETE
:
baseUrl
+
'
/scm/free/gift/storage/delete
'
,
// 赠送入库删除
GOODS_ADD_CHOOSE
:
baseUrl
+
'
/scm/free/gift/storage/goods/list
'
,
// 搜索商品-添加商品页
// 协助订单
ASSIST_CREATE
:
baseUrl
+
'
/scm/help/add_trade
'
,
// 协助订单列表
ASSIST_LIST
:
baseUrl
+
'
/scm/help/trade_list
'
,
// 协助订单列表
ASSIST_DETAIL
:
baseUrl
+
'
/scm/help/trade_detail
'
,
// 协助订单详情
ASSIST_DETELE
:
baseUrl
+
'
/scm/help/trade_del
'
,
// 协助订单删除
ASSIST_CODE
:
baseUrl
+
'
/scm/help/pay_code
'
// 协助订单扫码支付
}
src/router/index.js
View file @
128fd00c
import
Vue
from
'
vue
'
import
VueRouter
from
'
vue-router
'
import
Home
from
'
../views/tabbar/Home.vue
'
//
import selfApi from '@/api/apiList'
import
selfApi
from
'
@/api/apiList
'
Vue
.
use
(
VueRouter
)
const
routes
=
[
{
path
:
'
/
home
'
,
path
:
'
/
'
,
name
:
'
home
'
,
meta
:
{
title
:
'
工单
'
,
...
...
@@ -16,20 +16,16 @@ const routes = [
},
component
:
Home
},
// 登录
{
path
:
'
/
'
,
redirect
:
'
/login
'
},
{
path
:
'
/my
'
,
name
:
'
my
'
,
path
:
'
/login
'
,
name
:
'
login
'
,
meta
:
{
title
:
'
我的
'
,
title
:
'
登录
'
,
hideBack
:
true
},
component
:
()
=>
import
(
'
../views/tabbar/my
.vue
'
)
component
:
()
=>
import
(
'
@/views/login/login
.vue
'
)
},
{
path
:
'
/mine
'
,
name
:
'
mine
'
,
...
...
@@ -48,25 +44,6 @@ const routes = [
},
component
:
()
=>
import
(
'
../views/tabbar/modifyPhone.vue
'
)
},
// 登录
{
path
:
'
/login
'
,
name
:
'
login
'
,
meta
:
{
title
:
'
登录
'
,
hideBack
:
true
},
component
:
()
=>
import
(
'
@/views/login/login.vue
'
)
},
{
path
:
'
/againLogin
'
,
name
:
'
againLogin
'
,
meta
:
{
title
:
'
登录
'
,
hideBack
:
true
},
component
:
()
=>
import
(
'
@/views/login/againlogin.vue
'
)
},
// 个人中心
{
path
:
'
/charge
'
,
...
...
@@ -76,22 +53,6 @@ const routes = [
hideBack
:
true
},
component
:
()
=>
import
(
'
@/views/my/charge.vue
'
)
},
{
path
:
'
/relationUsers
'
,
name
:
'
relationUsers
'
,
meta
:
{
title
:
'
我的
'
},
component
:
()
=>
import
(
'
@/views/my/relation-users.vue
'
)
},
{
path
:
'
/addRelation
'
,
name
:
'
addRelation
'
,
meta
:
{
title
:
'
绑定机构
'
},
component
:
()
=>
import
(
'
@/views/my/add-relation.vue
'
)
}
]
...
...
@@ -99,7 +60,7 @@ const router = new VueRouter({
mode
:
'
history
'
,
base
:
process
.
env
.
BASE_URL
,
routes
,
scrollBehavior
(
to
,
from
,
savePosition
)
{
scrollBehavior
(
to
,
from
,
savePosition
)
{
if
(
savePosition
)
{
return
savePosition
}
else
{
...
...
@@ -112,75 +73,38 @@ const router = new VueRouter({
})
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
next
()
// console.log(to)
// localStorage.setItem('fromQuery',from.path); //记录路由
// console.log(to.path)
/** 商品列表 */
// if (to.path.indexOf('goodsList/') !== -1) {
// switch (to.params.type) {
// case 'entry':
// to.meta.title = '入库商品'
// break
// case 'out':
// to.meta.title = '出库商品'
// break
// case 'sale':
// to.meta.title = '销售商品'
// break
// default:
// to.meta.title = '商品列表'
// break
// }
// } else if (to.path.indexOf('returnGoods/list/') !== -1) {
// switch (to.params.type) {
// case 'purchase':
// to.meta.title = '采购退货'
// break
// case 'sale':
// to.meta.title = '销售退货'
// break
// default:
// to.meta.title = '商品列表'
// break
// }
// }
// let token = window.localStorage.getItem('token')
// let status = window.localStorage.getItem('status')
// if (to.path === '/againLogin') {
// next()
// return true
// }
// if (to.path === '/login' && token && status) {
// next()
// return true
// }
// if (to.query.token && to.query.status) {
// console.log('ok-------0', status)
// token = to.query.token
// status = to.query.status
// // console.log(token)
// // console.log(status)
// window.localStorage.setItem('token', token)
// window.localStorage.setItem('status', status)
// }
// if (token && status === '200') {
// console.log('ok-------1', 200)
// next()
// } else if (token && status === '100') {
// console.log('ok-------2', 100)
// setTimeout(() => {
// next({
// path: '/login'
// })
// }, 50)
// return true
// } else {
// console.log('ok-------3')
// window.document.location = selfApi.WINDOWHREF_LOGIN_ROUTE // url-
// return true
// }
let
token
=
window
.
localStorage
.
getItem
(
'
token
'
)
let
status
=
window
.
localStorage
.
getItem
(
'
status
'
)
if
(
to
.
path
===
'
/login
'
&&
token
&&
status
)
{
next
()
return
true
}
if
(
to
.
query
.
token
&&
to
.
query
.
status
)
{
console
.
log
(
'
ok-------0
'
,
status
)
token
=
to
.
query
.
token
status
=
to
.
query
.
status
// console.log(token)
// console.log(status)
window
.
localStorage
.
setItem
(
'
token
'
,
token
)
window
.
localStorage
.
setItem
(
'
status
'
,
status
)
}
if
(
token
&&
status
===
'
200
'
)
{
console
.
log
(
'
ok-------1
'
,
200
)
next
()
}
else
if
(
token
&&
status
===
'
100
'
)
{
console
.
log
(
'
ok-------2
'
,
100
)
setTimeout
(()
=>
{
next
({
path
:
'
/login
'
})
},
50
)
return
true
}
else
{
console
.
log
(
'
ok-------3
'
)
// return
window
.
document
.
location
=
selfApi
.
WINDOWHREF_LOGIN_TOKEN
// url-
return
true
}
})
router
.
afterEach
((
to
,
from
,
next
)
=>
{
...
...
src/views/login/login.vue
View file @
128fd00c
...
...
@@ -49,7 +49,6 @@ export default {
return
false
},
getCode
()
{
console
.
log
(
111
);
if
(
this
.
isSending
)
return
if
(
this
.
tel
.
length
!==
11
)
{
this
.
$toast
(
'
请正确输入手机号码
'
)
...
...
@@ -64,7 +63,6 @@ export default {
.
catch
(()
=>
{})
},
countDown
()
{
// const _this = this
let
seconds
=
60
this
.
timer
=
setInterval
(()
=>
{
seconds
--
...
...
@@ -82,10 +80,9 @@ export default {
tel
:
this
.
tel
,
code
:
this
.
code
}
// const _this = this
this
.
$http
.
post
(
this
.
$myApi
.
BINDLOGIN
,
curParams
)
.
then
(
res
=>
{
this
.
$router
.
replace
(
'
/home
'
)
window
.
document
.
location
=
this
.
$myApi
.
WINDOWHREF_ASK
// url-
})
.
catch
(()
=>
{})
},
...
...
@@ -109,12 +106,6 @@ export default {
}
next
()
}
// beforeCreate () {
// document.querySelector('body').setAttribute('style', 'background: #ffffff')
// },
// beforeDestroy () {
// document.querySelector('body').removeAttribute('style')
// }
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment