feat: 注册

This commit is contained in:
2025-08-23 14:25:27 +08:00
parent fe65a0aa5e
commit e763c6944a
10 changed files with 448 additions and 321 deletions
+3 -4
View File
@@ -6,7 +6,7 @@ import { BASE_URL, Authorization } from '@/utils/config.js'
function request(options) {
const { url, method = 'GET', data = {}, headers = {}, isShowLoading = true } = options;
// const token = uni.getStorageSync(tokenKey); // 获取token, 根据实际情况调整获取方式
const token = getStorageFun(TOKEN_NAME); // 获取token, 根据实际情况调整获取方式
let defaultHeaders = {
@@ -14,10 +14,9 @@ function request(options) {
'HSM-AUTH': token ? token : '', // 如果存在token, 则添加到请求头中
'content-type': ['post', 'POST'].includes(method) ? 'application/x-www-form-urlencoded' : 'application/json',
};
if(options.cha){
defaultHeaders['content-type']= 'application/json'
if (options.cha) {
defaultHeaders['content-type'] = 'application/json'
}
console.log('defaultHeaders',defaultHeaders,method)
if (token) {
defaultHeaders['HSM-AUTH'] = token;
}