fix:修改返回数据

This commit is contained in:
wangzenghua 2025-03-21 07:46:29 +01:00
parent 3239483d94
commit d173232ae5
4 changed files with 17 additions and 18 deletions

View File

@ -1,4 +1,4 @@
import request from '@/utils/request';
import request from '@/utils/request'
// 登录方法
export function login(username, password, code, uuid) {
@ -10,7 +10,7 @@ export function login(username, password, code, uuid) {
},
method: 'post',
data: { username, password, code, uuid },
});
})
}
// 注册方法
@ -22,7 +22,7 @@ export function register(data) {
},
method: 'post',
data: data,
});
})
}
// 刷新方法
@ -30,7 +30,7 @@ export function refreshToken() {
return request({
url: '/auth/refresh',
method: 'post',
});
})
}
// 获取用户详细信息
@ -38,7 +38,7 @@ export function getInfo() {
return request({
url: '/system/user/getInfo',
method: 'get',
});
})
}
// 退出方法
@ -46,7 +46,7 @@ export function logout() {
return request({
url: '/auth/logout',
method: 'delete',
});
})
}
// 获取验证码
@ -58,5 +58,5 @@ export function getCodeImg() {
},
method: 'get',
timeout: 20000,
});
})
}

View File

@ -7,14 +7,13 @@ const TokenKey = 'Admin-Token';
const ExpiresInKey = 'Admin-Expires-In';
export function getToken() {
return true
// let token = Cookies.get(TokenKey);
// if (undefined === token || null == token || 'null' === token) {
// token = getQueryString('Authorization');
// if (null != token || 'null' !== token) Cookies.set(TokenKey, token);
// }
// if (undefined === token || null == token || 'null' === token) token = false;
// return token;
let token = Cookies.get(TokenKey);
if (undefined === token || null == token || 'null' === token) {
token = getQueryString('Authorization');
if (null != token || 'null' !== token) Cookies.set(TokenKey, token);
}
if (undefined === token || null == token || 'null' === token) token = false;
return token;
}
export function setToken(token) {

View File

@ -28,7 +28,7 @@ service.interceptors.request.use(
// 是否需要防止数据重复提交
const isRepeatSubmit = (config.headers || {}).repeatSubmit === false;
if (getToken() && !isToken) {
config.headers['Authorization'] = 'Bearer ' + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
config.headers['Authorization'] = getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
}
// get请求映射params参数
if (config.method === 'get' && config.params) {

View File

@ -18,7 +18,7 @@ module.exports = {
// 部署生产环境和开发环境下的URL。
// 默认情况下Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
publicPath: `/sub-admin/`,
publicPath: './',
// 在npm run build 或 yarn build 时 生成文件的目录名称要和baseUrl的生产环境路径一致默认dist
outputDir: 'dist',
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
@ -68,7 +68,7 @@ module.exports = {
libraryTarget: 'umd', // 把微应用打包成 umd 库格式
jsonpFunction: `${name}`,
filename: `[name].[hash].js`,
chunkFilename: `[name].[hash].js`
chunkFilename: `[name].[hash].js`,
},
plugins: [
new CompressionPlugin({