yujialong 1 week ago
parent b6e29d675a
commit 2988ea46da
  1. 11
      src/components/upload/config.js
  2. 2
      src/pages/theoryExam/index.vue
  3. 2
      src/plugins/requests/index.js

@ -2,10 +2,19 @@
* 阿里云oss配置 * 阿里云oss配置
* */ * */
import Util from '@/libs/util'
import store from '@/store'
export default async function () { export default async function () {
try { try {
let RE = localStorage.getItem('osc') let RE = localStorage.getItem('osc')
if (RE) RE = JSON.parse(RE) if (RE) {
RE = JSON.parse(RE)
} else {
Util.errorMsg('登录过期,请重新登录!')
setTimeout(() => {
store.dispatch('user/logout')
}, 1500)
}
return RE ? { return RE ? {
// oss账号信息 // oss账号信息
config: { config: {

@ -637,6 +637,7 @@ export default {
}] }]
ques.attachmentName = file.name ques.attachmentName = file.name
ques.attachmentUrl = url ques.attachmentUrl = url
ques.answered = 1
this.submit(0) this.submit(0)
} catch (e) { } } catch (e) { }
}, },
@ -661,6 +662,7 @@ export default {
ques.fileList = [] ques.fileList = []
ques.attachmentName = '' ques.attachmentName = ''
ques.attachmentUrl = '' ques.attachmentUrl = ''
ques.answered = 0
this.submit(0) this.submit(0)
}, },

@ -14,7 +14,7 @@ service.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8"
// 请求拦截器 // 请求拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
let token = Util.local.get(Setting.tokenKey); let token = Util.local.get(Setting.tokenKey);
if (token) config.headers.token = token; if (token) config.headers.token = token
return config; return config;
}, err => { }, err => {
Util.errorMsg({ Util.errorMsg({

Loading…
Cancel
Save