优化代码

super_signature
nineven 5 years ago
parent 33e16c9284
commit b32a12a597
  1. 4
      fir_client/src/components/FirAppInfosBase.vue
  2. 6
      fir_client/src/components/FirAppInfosbaseinfo.vue
  3. 2
      fir_client/src/components/FirAppInfoscombo.vue
  4. 6
      fir_client/src/components/FirApps.vue
  5. 2
      fir_client/src/components/FirHeader.vue
  6. 8
      fir_client/src/components/FirLogin.vue
  7. 2
      fir_client/src/components/FirSuperSignBase.vue
  8. 6
      fir_client/src/components/FirUserProfileBase.vue
  9. 2
      fir_client/src/components/FirUserProfileInfo.vue
  10. 2
      fir_client/src/main.js
  11. 13
      fir_client/src/restful/index.js
  12. 6
      fir_client/src/store/index.js
  13. 6
      fir_client/src/utils/index.js
  14. 2
      fir_download/src/restful/download.js
  15. 1
      fir_ser/api/utils/auth.py

@ -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",

@ -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",

@ -130,7 +130,7 @@
} else {
// eslint-disable-next-line no-console
console.log("失败了");
console.log("Error");
}
}, {

@ -279,7 +279,7 @@
<div
ref="appmain" style="margin: 40px 20px">
ref="appmain" style="margin: 40px 20px;height: 100%">
<el-row style="max-height: 460px; margin: 0 auto;" :gutter="10" class="page-apps">
@ -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;
},

@ -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("退出失败")

@ -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 {

@ -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("用户信息获取失败")
}

@ -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);
}

@ -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: '验证码',

@ -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()

@ -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

@ -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)

@ -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) => {

@ -85,7 +85,7 @@ function getData(url, params = {}, callBack) {
alert('网络连接失败')
}
callBack(null);
callBack({"code":-1});
});
}

@ -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": "用户被禁用"})

Loading…
Cancel
Save