diff --git a/fir_client/src/components/FirAppInfosBase.vue b/fir_client/src/components/FirAppInfosBase.vue
index 4bebd14..18f0d8b 100644
--- a/fir_client/src/components/FirAppInfosBase.vue
+++ b/fir_client/src/components/FirAppInfosBase.vue
@@ -141,14 +141,14 @@
if (data.code === 1000) {
this.appinfos = data.data;
this.master_release = data.data.master_release;
- this.$store.dispatch("getUser", data.userinfo);
+ this.$store.dispatch("doUserinfo", data.userinfo);
this.appinfos["icon_url"] = this.master_release.icon_url;
this.$store.dispatch('doucurrentapp', this.appinfos);
} else if (data.code === 1003) {
this.$router.push({name: 'FirApps'});
} else {
// eslint-disable-next-line no-console
- console.log("失败了");
+ console.log("Error");
}
}, {
"methods": "GET",
diff --git a/fir_client/src/components/FirAppInfosbaseinfo.vue b/fir_client/src/components/FirAppInfosbaseinfo.vue
index ccbfd6d..7a61130 100644
--- a/fir_client/src/components/FirAppInfosbaseinfo.vue
+++ b/fir_client/src/components/FirAppInfosbaseinfo.vue
@@ -76,7 +76,7 @@
uploadimgs(data => {
if (data.code === 1000) {
// eslint-disable-next-line no-console
- console.log(data.data);
+ // console.log(data.data);
this.$message.success('上传成功');
this.updateinfo();
@@ -153,7 +153,7 @@
if (data.code === 1000) {
this.appinfos = data.data;
this.master_release = data.data.master_release;
- this.$store.dispatch("getUser", data.userinfo);
+ this.$store.dispatch("doUserinfo", data.userinfo);
this.appinfos["icon_url"] = this.master_release.icon_url;
this.$store.dispatch('doucurrentapp', this.appinfos);
@@ -161,7 +161,7 @@
this.$router.push({name: 'FirApps'});
} else {
// eslint-disable-next-line no-console
- console.log("失败了");
+ console.log("Error");
}
}, {
"methods": "GET",
diff --git a/fir_client/src/components/FirAppInfoscombo.vue b/fir_client/src/components/FirAppInfoscombo.vue
index 04bc921..37f42d3 100644
--- a/fir_client/src/components/FirAppInfoscombo.vue
+++ b/fir_client/src/components/FirAppInfoscombo.vue
@@ -130,7 +130,7 @@
} else {
// eslint-disable-next-line no-console
- console.log("失败了");
+ console.log("Error");
}
}, {
diff --git a/fir_client/src/components/FirApps.vue b/fir_client/src/components/FirApps.vue
index ac830a3..1f5208b 100644
--- a/fir_client/src/components/FirApps.vue
+++ b/fir_client/src/components/FirApps.vue
@@ -279,7 +279,7 @@
+ ref="appmain" style="margin: 40px 20px;height: 100%">
@@ -661,7 +661,7 @@
this.has_next = data.has_next;
this.orgapplists = this.applists.slice(); //深拷贝
this.hdata = data.hdata;
- this.$store.dispatch("getUser", data.userinfo);
+ this.$store.dispatch("doUserinfo", data.userinfo);
this.searchapps();
// this.$store.dispatch('doucurrentapp', {'firapps':1});
@@ -692,7 +692,7 @@
loading.close();
this.$message.error("应用解析失败,请检查是否为APP应用");
// eslint-disable-next-line no-console
- console.log('err ----> ', err);
+ console.log('Error ', err);
});
return false;
},
diff --git a/fir_client/src/components/FirHeader.vue b/fir_client/src/components/FirHeader.vue
index da217b6..a004358 100644
--- a/fir_client/src/components/FirHeader.vue
+++ b/fir_client/src/components/FirHeader.vue
@@ -76,7 +76,7 @@
this.$cookies.remove("username");
this.$cookies.remove("first_name");
this.$store.dispatch('doucurrentapp', {});
- this.$store.dispatch('getUser', {});
+ this.$store.dispatch('doUserinfo', {});
this.$router.push({name: 'FirLogin'});
} else {
this.$message.error("退出失败")
diff --git a/fir_client/src/components/FirLogin.vue b/fir_client/src/components/FirLogin.vue
index e211afd..4f704f9 100644
--- a/fir_client/src/components/FirLogin.vue
+++ b/fir_client/src/components/FirLogin.vue
@@ -86,10 +86,10 @@
type: 'success'
});
this.$cookies.remove("auth_token");
- this.$cookies.set("token", data['token']);
- this.$cookies.set("username", data.userinfo.username);
- this.$cookies.set("first_name", data.userinfo.first_name);
- this.$store.dispatch("get_user", data.userinfo);
+ this.$cookies.set("token", data['token'],3600 * 24 * 30);
+ this.$cookies.set("username", data.userinfo.username,3600 * 24 * 30);
+ this.$cookies.set("first_name", data.userinfo.first_name,3600 * 24 * 30);
+ this.$store.dispatch("doUserinfo", data.userinfo);
set_auth_token();
this.$router.push({name: 'FirApps'})
} else {
diff --git a/fir_client/src/components/FirSuperSignBase.vue b/fir_client/src/components/FirSuperSignBase.vue
index 9196972..d68aae9 100644
--- a/fir_client/src/components/FirSuperSignBase.vue
+++ b/fir_client/src/components/FirSuperSignBase.vue
@@ -614,7 +614,7 @@
getUserInfoFun() {
userinfos(data => {
if (data.code === 1000) {
- this.$store.dispatch("getUser", data.data);
+ this.$store.dispatch("doUserinfo", data.data);
} else {
this.$message.error("用户信息获取失败")
}
diff --git a/fir_client/src/components/FirUserProfileBase.vue b/fir_client/src/components/FirUserProfileBase.vue
index c52fcc6..3aa6f25 100644
--- a/fir_client/src/components/FirUserProfileBase.vue
+++ b/fir_client/src/components/FirUserProfileBase.vue
@@ -79,7 +79,7 @@
uploadimgs(data => {
if (data.code === 1000) {
// eslint-disable-next-line no-console
- console.log(data.data);
+ // console.log(data.data);
this.$message.success('上传成功');
this.updateUserInfo({"methods": 'GET'});
@@ -122,7 +122,7 @@
userinfos(data => {
if (data.code === 1000) {
this.userinfo = data.data;
- this.$store.dispatch("getUser", data.data);
+ this.$store.dispatch("doUserinfo", data.data);
this.$store.dispatch('doucurrentapp', {});
this.imageUrl = data.data.head_img;
@@ -144,7 +144,7 @@
uploadimgs(data => {
if (data.code === 1000) {
// eslint-disable-next-line no-console
- console.log(data.data);
+ // console.log(data.data);
let certinfo = data.data;
this.uploadtostorage(file, certinfo);
}
diff --git a/fir_client/src/components/FirUserProfileInfo.vue b/fir_client/src/components/FirUserProfileInfo.vue
index 8eee63c..2eab141 100644
--- a/fir_client/src/components/FirUserProfileInfo.vue
+++ b/fir_client/src/components/FirUserProfileInfo.vue
@@ -118,7 +118,7 @@
userinfos(data => {
if (data.code === 1000) {
this.userinfo = data.data;
- this.$store.dispatch("getUser", data.data);
+ this.$store.dispatch("doUserinfo", data.data);
if (data.data.sms_code) {
this.$notify({
title: '验证码',
diff --git a/fir_client/src/main.js b/fir_client/src/main.js
index e57c6d6..9c5978a 100644
--- a/fir_client/src/main.js
+++ b/fir_client/src/main.js
@@ -32,7 +32,7 @@ router.beforeEach((to, from, next) => {
avatar: VueCookies.get('avatar'),
notice_num: VueCookies.get('notice_num')
};
- store.dispatch('getUser', user)
+ store.dispatch('doUserinfo', user)
}
next()
diff --git a/fir_client/src/restful/index.js b/fir_client/src/restful/index.js
index 2364131..6f92c20 100644
--- a/fir_client/src/restful/index.js
+++ b/fir_client/src/restful/index.js
@@ -30,7 +30,7 @@ export function set_auth_token() {
} else {
let token = VueCookies.get('token');
let username = VueCookies.get('username');
- VueCookies.set("auth_token", Base64.encode(token + ':' + username));
+ VueCookies.set("auth_token", Base64.encode(token + ':' + username),3600 * 24 * 30);
}
}
// 更改加载的样式
@@ -111,7 +111,7 @@ function getData(methods = true, url, params = {}, callBack, load, isCode = fals
})
.catch(function (error) {
ErrorMsg(error);
- callBack(null);
+ callBack({"code":-1});
});
} else if (methods === "PUT") {
@@ -126,7 +126,7 @@ function getData(methods = true, url, params = {}, callBack, load, isCode = fals
})
.catch(function (error) {
ErrorMsg(error);
- callBack(null);
+ callBack({"code":-1});
});
} else if (methods === 'POST') {
@@ -142,7 +142,7 @@ function getData(methods = true, url, params = {}, callBack, load, isCode = fals
})
.catch(function (error) {
ErrorMsg(error);
- callBack(null);
+ callBack({"code":-1});
});
} else {
Axios
@@ -152,8 +152,7 @@ function getData(methods = true, url, params = {}, callBack, load, isCode = fals
})
.catch(function (error) {
ErrorMsg(error);
-
- callBack(null);
+ callBack({"code":-1});
});
}
}
@@ -345,7 +344,7 @@ export function uploadstorage(certinfo, file, successCallback, processCallback)
data.append('certinfo', JSON.stringify(certinfo));
Axios.post(certinfo.upload_url, data, config).then(res => {
// eslint-disable-next-line no-console
- console.log(res);
+ // console.log(res);
successCallback(res)
}).catch(err => {
// eslint-disable-next-line no-console
diff --git a/fir_client/src/store/index.js b/fir_client/src/store/index.js
index fb08c41..941b903 100644
--- a/fir_client/src/store/index.js
+++ b/fir_client/src/store/index.js
@@ -17,7 +17,7 @@ const store = new Vuex.Store({
userInfoIndex: 0,
},
mutations: {
- get_user(state, data) {
+ setuserinfo(state, data) {
state.userinfo = data;
},
setappInfoIndex(state, val) {
@@ -31,8 +31,8 @@ const store = new Vuex.Store({
}
},
actions: {
- getUser(context, data) {
- context.commit('get_user', data);
+ doUserinfo(context, data) {
+ context.commit('setuserinfo', data);
},
doappInfoIndex(context, val) {
context.commit('setappInfoIndex', val)
diff --git a/fir_client/src/utils/index.js b/fir_client/src/utils/index.js
index 6864f13..96c97b0 100644
--- a/fir_client/src/utils/index.js
+++ b/fir_client/src/utils/index.js
@@ -140,9 +140,9 @@ export function uploadaliyunoss(file, certinfo, app, successcallback, processcal
const progress = async function progress(p, checkpoint) {
currentCheckpoint = checkpoint;
// eslint-disable-next-line no-console
- console.log(Math.floor(p * 100));
+ // console.log(Math.floor(p * 100));
// eslint-disable-next-line no-console
- console.log(checkpoint);
+ // console.log(checkpoint);
processcallback(Math.floor(p * 100));
};
@@ -156,7 +156,7 @@ export function uploadaliyunoss(file, certinfo, app, successcallback, processcal
};
client.multipartUpload(certinfo.upload_key, file, options).then((res) => {
// eslint-disable-next-line no-console
- console.log('upload success: %j', res);
+ // console.log('upload success: %j', res);
successcallback(res);
currentCheckpoint = null;
}).catch((err) => {
diff --git a/fir_download/src/restful/download.js b/fir_download/src/restful/download.js
index 5408426..b1efa39 100644
--- a/fir_download/src/restful/download.js
+++ b/fir_download/src/restful/download.js
@@ -85,7 +85,7 @@ function getData(url, params = {}, callBack) {
alert('网络连接失败')
}
- callBack(null);
+ callBack({"code":-1});
});
}
diff --git a/fir_ser/api/utils/auth.py b/fir_ser/api/utils/auth.py
index 35ea71a..e6c871c 100644
--- a/fir_ser/api/utils/auth.py
+++ b/fir_ser/api/utils/auth.py
@@ -38,6 +38,7 @@ class ExpiringTokenAuthentication(BaseAuthentication):
raise AuthenticationFailed({"code": 1001, "error": "无效的token"})
if user_obj.is_active:
cache.set(auth_key, cacheuserinfo, 3600 * 24 * 7)
+ # cache.expire(auth_key, timeout=3600 * 24 * 7)
return user_obj, auth_token
else:
raise AuthenticationFailed({"code": 1001, "error": "用户被禁用"})