mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-11-22 00:16:47 +08:00
feat(projects): 抽离部分登陆逻辑,支持Token或JWT校验方式
This commit is contained in:
@@ -23,7 +23,7 @@ const apis: MockMethod[] = [
|
||||
{
|
||||
url: '/mock/login',
|
||||
method: 'post',
|
||||
response: (options: Service.MockOption): Service.MockServiceResult<ApiAuth.Token | null> => {
|
||||
response: (options: Service.MockOption): Service.MockServiceResult<ApiAuth.JWT | null> => {
|
||||
const { userName = undefined, password = undefined } = options.body;
|
||||
|
||||
if (!userName || !password) {
|
||||
@@ -101,7 +101,7 @@ const apis: MockMethod[] = [
|
||||
{
|
||||
url: '/mock/updateToken',
|
||||
method: 'post',
|
||||
response: (options: Service.MockOption): Service.MockServiceResult<ApiAuth.Token | null> => {
|
||||
response: (options: Service.MockOption): Service.MockServiceResult<ApiAuth.JWT | null> => {
|
||||
const { refreshToken = '' } = options.body;
|
||||
|
||||
const findItem = userModel.find(item => item.refreshToken === refreshToken);
|
||||
|
||||
Reference in New Issue
Block a user